Skip to content

regulator: fix deadlock vs memory reclaim

Michał Mirosław lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 4 repliesIn review
  2. v17 patches 7 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7regulator: push allocation in regulator_init_coupling() outside of lockdrivers/regulator/core.c+3 -20 replies
2/7regulator: push allocation in regulator_ena_gpio_request() out of lockdrivers/regulator/core.c+14 -51 reply
3/7regulator: push allocations in create_regulator() outside of lockdrivers/regulator/core.c+28 -250 replies
4/7regulator: push allocation in set_consumer_device_supply() out of lockdrivers/regulator/core.c+26 -200 replies
5/7regulator: plug of_node leak in regulator_register()'s error pathdrivers/regulator/core.c+4 -93 replies
6/7regulator: cleanup regulator_ena_gpio_free()drivers/regulator/core.c+12 -120 replies
7/7regulator: remove superfluous lock in regulator_resolve_coupling()drivers/regulator/core.c+0 -40 replies

Reviews trailers per patch

3 of 7 patches have a Reviewed-by or Acked-by.

PatchDmitry OsipenkoVladimir Zapolskiy
1/7R-b
2/7
3/7
4/7
5/7A-b R-b
6/7
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/7] regulator: fix deadlock vs memory reclaim

For systems that have eg. eMMC storage using voltage regulator, memory reclaim path might call back into regulator subsystem. This means we have to make sure no allocations happen with a regulator or regulator list locked.

After this series I see no more lockdep complaints on my test system, but please review and test further.

First four patches move allocations out of locked regions, next three came as a drive-by cleanups.

---
v2: fix bug in patch #4 spotted by kernel test robot
reworded commit #7 description

Michał Mirosław (7):
regulator: push allocation in regulator_init_coupling() outside of
lock
regulator: push allocation in regulator_ena_gpio_request() out of lock
regulator: push allocations in create_regulator() outside of lock
regulator: push allocation in set_consumer_device_supply() out of lock
regulator: plug of_node leak in regulator_register()'s error path
regulator: cleanup regulator_ena_gpio_free()
regulator: remove superfluous lock in regulator_resolve_coupling()

 drivers/regulator/core.c | 164 +++++++++++++++++++++------------------
 1 file changed, 87 insertions(+), 77 deletions(-)
Signature · 1 line
2.20.1