linux_dsm_epyc7002/drivers/regulator
Krzysztof Adamski 32165230eb regulator: core: fix crash in error path of regulator_register
This problem was introduced by:
commit daad134d66 ("regulator: core: Request GPIO before creating
sysfs entries")

The error path was not updated correctly after moving GPIO registration
code and in case regulator_ena_gpio_free failed, device_unregister() was
called even though device_register() was not yet called.

This problem breaks the boot at least on all Tegra 32-bit devices. It
will also crash each device that specifices GPIO that is unavaiable at
regulator_register call. Here's error log I've got when forced GPIO to
be invalid:

[    1.116612] usb-otg-vbus-reg: Failed to request enable GPIO10: -22
[    1.122794] Unable to handle kernel NULL pointer dereference at
virtual address 00000044
[    1.130894] pgd = c0004000
[    1.133598] [00000044] *pgd=00000000
[    1.137205] Internal error: Oops: 5 [#1] SMP ARM

and here's backtrace from KDB:

Exception stack(0xef11fbd0 to 0xef11fc18)
fbc0:                                     00000000 c0738a14 00000000 00000000
fbe0: c0b2a0b0 00000000 00000000 c0738a14 c0b5fdf8 00000001 ef7f6074 ef11fc4c
fc00: ef11fc50 ef11fc20 c02a8344 c02a7f1c 60000013 ffffffff
[<c010cee0>] (__dabt_svc) from [<c02a7f1c>] (kernfs_find_ns+0x18/0xf8)
[<c02a7f1c>] (kernfs_find_ns) from [<c02a8344>] (kernfs_find_and_get_ns+0x40/0x58)
[<c02a8344>] (kernfs_find_and_get_ns) from [<c02ac4a4>] (sysfs_unmerge_group+0x28/0x68)
[<c02ac4a4>] (sysfs_unmerge_group) from [<c044389c>] (dpm_sysfs_remove+0x30/0x5c)
[<c044389c>] (dpm_sysfs_remove) from [<c0436ba8>] (device_del+0x48/0x1f4)
[<c0436ba8>] (device_del) from [<c0436d84>] (device_unregister+0x30/0x6c)
[<c0436d84>] (device_unregister) from [<c0403910>] (regulator_register+0x6d0/0xdac)
[<c0403910>] (regulator_register) from [<c04052d4>] (devm_regulator_register+0x50/0x84)
[<c04052d4>] (devm_regulator_register) from [<c0406298>] (reg_fixed_voltage_probe+0x25c/0x3c0)
[<c0406298>] (reg_fixed_voltage_probe) from [<c043d21c>] (platform_drv_probe+0x60/0xb0)
[<c043d21c>] (platform_drv_probe) from [<c043b078>] (driver_probe_device+0x24c/0x440)
[<c043b078>] (driver_probe_device) from [<c043b5e8>] (__device_attach_driver+0xc0/0x120)
[<c043b5e8>] (__device_attach_driver) from [<c043901c>] (bus_for_each_drv+0x6c/0x98)
[<c043901c>] (bus_for_each_drv) from [<c043ad20>] (__device_attach+0xac/0x138)
[<c043ad20>] (__device_attach) from [<c043b664>] (device_initial_probe+0x1c/0x20)
[<c043b664>] (device_initial_probe) from [<c043a074>] (bus_probe_device+0x94/0x9c)
[<c043a074>] (bus_probe_device) from [<c043a610>] (deferred_probe_work_func+0x80/0xcc)
[<c043a610>] (deferred_probe_work_func) from [<c01381d0>] (process_one_work+0x158/0x454)
[<c01381d0>] (process_one_work) from [<c013854c>] (worker_thread+0x38/0x510)
[<c013854c>] (worker_thread) from [<c013e154>] (kthread+0xe8/0x104)
[<c013e154>] (kthread) from [<c0108638>] (ret_from_fork+0x14/0x3c)

Signed-off-by: Krzysztof Adamski <krzysztof.adamski@tieto.com>
Reported-by: Jon Hunter <jonathanh@nvidia.com>
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-25 10:48:16 +09:00
..
88pm800.c Merge branch 'fix/88pm800' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-88pm800 2015-07-17 12:42:48 +01:00
88pm8607.c regulator: 88pm8607: Constify platform_device_id 2015-05-01 17:44:55 +01:00
aat2870-regulator.c regulator: drop owner assignment from platform_drivers 2014-10-20 16:21:29 +02:00
ab3100.c regulator: drop owner assignment from platform_drivers 2014-10-20 16:21:29 +02:00
ab8500-ext.c regulator: drop owner assignment from platform_drivers 2014-10-20 16:21:29 +02:00
ab8500.c regulator: drop owner assignment from platform_drivers 2014-10-20 16:21:29 +02:00
act8865-regulator.c regulator: act8865: support output voltage by VSET2[] bits 2015-10-02 17:53:24 +01:00
ad5398.c regulator: ad5398: Remove unnecessary MODULE_ALIAS() 2015-08-30 12:21:01 +01:00
anatop-regulator.c Merge remote-tracking branches 'regulator/topic/act8865', 'regulator/topic/anatop', 'regulator/topic/arizona', 'regulator/topic/axp20x' and 'regulator/topic/bcm590xx' into regulator-next 2015-11-04 11:19:37 +00:00
arizona-ldo1.c regulator: arizona-ldo1: Fix handling of GPIO 0 2015-10-16 15:48:39 +01:00
arizona-micsupp.c == Changes to existing drivers == 2015-04-14 17:29:55 -07:00
as3711-regulator.c regulator: drop owner assignment from platform_drivers 2014-10-20 16:21:29 +02:00
as3722-regulator.c regulator: drop owner assignment from platform_drivers 2014-10-20 16:21:29 +02:00
axp20x-regulator.c regulator: axp20x: Fix GPIO LDO enable value for AXP22x 2015-12-23 00:05:31 +00:00
bcm590xx-regulator.c regulator: bcm590xx: Remove unneeded semicolon 2015-09-14 19:48:34 +01:00
core.c regulator: core: fix crash in error path of regulator_register 2016-02-25 10:48:16 +09:00
da903x.c regulator: da9*: constify regulator_ops structures 2015-12-22 23:59:57 +00:00
da9052-regulator.c regulator: da9*: constify regulator_ops structures 2015-12-22 23:59:57 +00:00
da9055-regulator.c regulator: da9*: constify regulator_ops structures 2015-12-22 23:59:57 +00:00
da9062-regulator.c regulator: da9*: constify regulator_ops structures 2015-12-22 23:59:57 +00:00
da9063-regulator.c regulator: da9*: constify regulator_ops structures 2015-12-22 23:59:57 +00:00
da9210-regulator.c regulator: da9*: constify regulator_ops structures 2015-12-22 23:59:57 +00:00
da9210-regulator.h
da9211-regulator.c regulator: da9*: constify regulator_ops structures 2015-12-22 23:59:57 +00:00
da9211-regulator.h regulator: da9211: support da9215 2015-07-13 19:11:24 +01:00
db8500-prcmu.c regulator: drop owner assignment from platform_drivers 2014-10-20 16:21:29 +02:00
dbx500-prcmu.c regulator: dbx500: Remove use of seq_puts/seq_printf return value 2015-02-24 17:16:14 +09:00
dbx500-prcmu.h
devres.c regulator: Make bulk API support optional supplies 2015-11-17 18:54:07 +00:00
dummy.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
dummy.h
fan53555.c regulator: fan53555: Export I2C module alias information 2015-07-31 18:15:21 +01:00
fixed-helper.c
fixed.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
gpio-regulator.c regulator: gpio: Fix module autoload for OF platform driver 2015-09-19 07:54:20 -07:00
helpers.c regulator: Fix the function name in documentation 2015-04-19 13:23:07 +01:00
hi6421-regulator.c regulator: drop owner assignment from platform_drivers 2014-10-20 16:21:29 +02:00
internal.h regulator: Allow parsing custom properties when using simplified DT parsing 2015-01-08 20:15:45 +00:00
isl6271a-regulator.c regulator: drivers: Drop owner assignment from i2c_driver 2015-07-14 18:53:01 +01:00
isl9305.c Merge remote-tracking branches 'regulator/topic/mt6311', 'regulator/topic/ocp', 'regulator/topic/owner', 'regulator/topic/pfuze100' and 'regulator/topic/pwm' into regulator-next 2015-08-30 14:39:48 +01:00
Kconfig regulator: Update for v4.5 2016-01-15 12:14:47 -08:00
lm363x-regulator.c regulator: lm363x: Staticise ldo_cont_enable_time 2015-11-30 11:32:52 +00:00
lp872x.c regulator: lp872x: Get rid of duplicate reference to DVS GPIO 2015-12-23 12:12:46 +00:00
lp3971.c regulator: drivers: Drop owner assignment from i2c_driver 2015-07-14 18:53:01 +01:00
lp3972.c regulator: drivers: Drop owner assignment from i2c_driver 2015-07-14 18:53:01 +01:00
lp8755.c regulator: lp8755: Convert to devm_request_threaded_irq 2015-06-02 15:35:17 +01:00
lp8788-buck.c regulator: lp8788: constify regulator_ops structures 2015-12-23 00:01:23 +00:00
lp8788-ldo.c regulator: lp8788: constify regulator_ops structures 2015-12-23 00:01:23 +00:00
ltc3589.c Merge remote-tracking branches 'regulator/topic/mt6311', 'regulator/topic/ocp', 'regulator/topic/owner', 'regulator/topic/pfuze100' and 'regulator/topic/pwm' into regulator-next 2015-08-30 14:39:48 +01:00
Makefile Merge remote-tracking branches 'regulator/topic/pv88090', 'regulator/topic/qcom-smd', 'regulator/topic/tps6105x', 'regulator/topic/tps65086' and 'regulator/topic/tps65218' into regulator-next 2016-01-12 18:26:10 +00:00
max1586.c regulator: drivers: Drop owner assignment from i2c_driver 2015-07-14 18:53:01 +01:00
max8649.c regulator: max8649: Constify struct regmap_config and regulator_ops 2015-01-05 20:10:13 +00:00
max8660.c regulator: drivers: Drop owner assignment from i2c_driver 2015-07-14 18:53:01 +01:00
max8907-regulator.c regulator: drop owner assignment from platform_drivers 2014-10-20 16:21:29 +02:00
max8925-regulator.c regulator: drop owner assignment from platform_drivers 2014-10-20 16:21:29 +02:00
max8952.c Merge remote-tracking branches 'regulator/topic/max77686', 'regulator/topic/max77693', 'regulator/topic/max77802', 'regulator/topic/power-off' and 'regulator/topic/rk808' into regulator-next 2014-12-05 11:14:37 +00:00
max8973-regulator.c Merge remote-tracking branches 'regulator/topic/mt6311', 'regulator/topic/ocp', 'regulator/topic/owner', 'regulator/topic/pfuze100' and 'regulator/topic/pwm' into regulator-next 2015-08-30 14:39:48 +01:00
max8997.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
max8998.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
max14577.c regulator: max14577: Reduce duplication of regulator_desc initializers 2015-04-27 18:57:57 +01:00
max77686.c regulator: max77686: fix gpio_enabled shift wrapping bug 2015-05-20 19:09:51 +01:00
max77693.c regulators: max77693: register driver earlier to avoid deferred probe 2015-08-21 09:07:45 -07:00
max77802.c drivers/regulator: include <module.h> for modular max77802 code 2015-06-16 14:12:26 -04:00
mc13xxx-regulator-core.c regulator: of: Add regulator desc param to of_get_regulator_init_data() 2014-11-26 18:58:14 +00:00
mc13xxx.h regulator: mc13xxx: Remove unused field "hi_bit" 2014-06-09 20:50:35 +01:00
mc13783-regulator.c regulator: drop owner assignment from platform_drivers 2014-10-20 16:21:29 +02:00
mc13892-regulator.c regulator: drop owner assignment from platform_drivers 2014-10-20 16:21:29 +02:00
mt6311-regulator.c regulator: mt6311: Use REGCACHE_RBTREE 2015-12-18 12:14:27 +00:00
mt6311-regulator.h regulator: mt6311: Add support for mt6311 regulator 2015-07-24 12:30:49 +01:00
mt6397-regulator.c regulator: mt6397: Add support for MT6397 regulator 2014-12-24 12:41:05 +00:00
of_regulator.c regulator: Introduce property to flag set-load support 2015-09-17 12:14:12 +01:00
palmas-regulator.c regulator: tps65917/palmas: Add bypass ops for LDOs with bypass capability 2015-12-16 19:22:42 +00:00
pbias-regulator.c Merge remote-tracking branches 'regulator/fix/anatop', 'regulator/fix/gpio', 'regulator/fix/pbias', 'regulator/fix/tpx65218' and 'regulator/fix/vexpress' into regulator-linus 2015-09-21 14:16:09 -07:00
pcap-regulator.c regulator: drop owner assignment from platform_drivers 2014-10-20 16:21:29 +02:00
pcf50633-regulator.c
pfuze100-regulator.c Merge remote-tracking branches 'regulator/topic/mt6311', 'regulator/topic/ocp', 'regulator/topic/owner', 'regulator/topic/pfuze100' and 'regulator/topic/pwm' into regulator-next 2015-08-30 14:39:48 +01:00
pv88060-regulator.c regulator: pv88060: fix error handling in probe 2015-12-01 13:18:15 +00:00
pv88060-regulator.h regulator: pv88060: new regulator driver 2015-11-20 18:06:15 +00:00
pv88090-regulator.c regulator: pv88090: logical vs bitwise AND typo 2015-12-12 22:34:08 +00:00
pv88090-regulator.h regulator: pv88090: new regulator driver 2015-12-08 18:21:06 +00:00
pwm-regulator.c regulator: pwm: implement ->enable(), ->disable() and ->is_enabled methods 2015-09-21 14:11:18 -07:00
qcom_rpm-regulator.c regulator: qcom: Tidy up probe() 2015-04-08 12:22:55 +01:00
qcom_smd-regulator.c regulator: qcom-smd: Add support for PMA8084 2015-12-16 12:29:54 +00:00
qcom_spmi-regulator.c regulator: qcom-spmi: Add vendor specific configuration 2015-07-24 18:29:45 +01:00
rc5t583-regulator.c regulator: drop owner assignment from platform_drivers 2014-10-20 16:21:29 +02:00
rk808-regulator.c regulator: rk808: make better use of the gpiod API 2015-07-21 17:11:30 +01:00
rn5t618-regulator.c regulator: rn5t618: Convert to new style DT parsing 2014-10-20 12:23:59 +01:00
rt5033-regulator.c regulator: rt5033-regulator: Use regulator_nodes/of_match in the descriptor 2014-12-24 12:54:56 +00:00
s2mpa01.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
s2mps11.c mfd: sec-core: Rename MFD and regulator names differently 2015-11-24 11:11:16 +00:00
s5m8767.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
sky81452-regulator.c regulator: sky81452: Modify Device Tree structure 2014-12-02 12:22:39 +00:00
stw481x-vmmc.c regulator: stw481x: Remove unused fields from struct stw481x 2015-03-21 01:05:56 +00:00
ti-abb-regulator.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
tps6105x-regulator.c regulator: tps6105x: Convert to use regmap helper functions 2015-11-18 13:19:47 +00:00
tps6507x-regulator.c regulator: drop owner assignment from platform_drivers 2014-10-20 16:21:29 +02:00
tps6524x-regulator.c spi: Drop owner assignment from spi_drivers 2015-10-28 10:30:17 +09:00
tps6586x-regulator.c regulator: tps6586x: silence pointer-to-int-cast 2015-07-23 15:58:33 +01:00
tps51632-regulator.c regulator: drivers: Drop owner assignment from i2c_driver 2015-07-14 18:53:01 +01:00
tps62360-regulator.c regulator: drivers: Drop owner assignment from i2c_driver 2015-07-14 18:53:01 +01:00
tps65023-regulator.c regulator: tps65023: add device tree support 2015-09-21 10:13:17 -07:00
tps65086-regulator.c regulator: tps65086: Update regulator driver for the TPS65086 PMIC 2015-12-01 19:58:58 +00:00
tps65090-regulator.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
tps65217-regulator.c regulator: tps65217: Use simplified DT parsing 2014-09-10 12:02:48 +01:00
tps65218-regulator.c regulator: tps65218: add support for LS3 current regulator 2015-11-25 12:25:26 +00:00
tps65910-regulator.c regulator: tps65910: Add missing #include <linux/of.h> 2015-03-16 11:41:16 +00:00
tps65912-regulator.c regulator: drop owner assignment from platform_drivers 2014-10-20 16:21:29 +02:00
tps80031-regulator.c regulator: drop owner assignment from platform_drivers 2014-10-20 16:21:29 +02:00
twl-regulator.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
userspace-consumer.c
vexpress.c regulator: vexpress: Fix module autoload for OF platform driver 2015-09-19 07:55:12 -07:00
virtual.c regulator: drop owner assignment from platform_drivers 2014-10-20 16:21:29 +02:00
wm831x-dcdc.c Merge remote-tracking branch 'regulator/topic/wm831x' into regulator-next 2016-01-12 18:26:12 +00:00
wm831x-isink.c regulator: wm8*: constify regulator_ops structures 2015-12-23 00:00:00 +00:00
wm831x-ldo.c Merge remote-tracking branch 'regulator/topic/wm831x' into regulator-next 2016-01-12 18:26:12 +00:00
wm8350-regulator.c regulator: wm8*: constify regulator_ops structures 2015-12-23 00:00:00 +00:00
wm8400-regulator.c regulator: wm8*: constify regulator_ops structures 2015-12-23 00:00:00 +00:00
wm8994-regulator.c regulator: wm8*: constify regulator_ops structures 2015-12-23 00:00:00 +00:00