Skip to content

regmap: Fix cache lifecycle locking and teardown

Michael Reeves asahi b4-sent driver-core linux-mm lkml 3 versions – In review

Get series with b4
b4 am [email protected] change-id 20260925-regcache-lifecycle-submit-74f366be0fbc

Versions newest first

  1. v3 Latest2 patches 3 repliesIn review
  2. v22 patches 2 repliesSuperseded
  3. v11 patch 2 repliesSuperseded

Changes in v3 from the cover letter

- Link to v2: https://lore.kernel.org/r/[email protected]
- Add Maple-state irqsave and irqrestore helpers.
- Use the helpers for cache teardown and document why IRQ safety is needed.
- Rebase onto the latest upstream tree.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2regmap: Remove debugfs before cache teardowndrivers/base/regmap/regmap-debugfs.c drivers/base/regmap/regmap.c+10 -61 reply
2/2regmap: Drop map lock during cache init and exitdrivers/base/regmap/regcache-maple.c drivers/base/regmap/regcache.c include/linux/maple_tree.h+11 -81 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchPeng Fan
1/2R-b
2/2R-b

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

Read the v3 thread

Cover letter [PATCH v3 0/2] regmap: Fix cache lifecycle locking and teardown

Fix an "Invalid wait context" lockdep warning during Apple GPIO probe and correct debugfs ordering during cache teardown.

Tested on Apple M3 MacBook Air (T8122):

- All 4 GPIO controllers probe successfully with lockdep enabled.
- The "Invalid wait context" warning no longer occurs.
- The regmap KUnit suite passes and lockdep remains enabled.

---
Changes in v3:
- Link to v2: https://lore.kernel.org/r/[email protected]
- Add Maple-state irqsave and irqrestore helpers.
- Use the helpers for cache teardown and document why IRQ safety is needed.
- Rebase onto the latest upstream tree.

Changes in v2:
- Link to v1: https://lore.kernel.org/r/[email protected]
- Make Maple cache teardown IRQ-safe.
- Fix debugfs ordering during cache teardown and reinitialization.
- Rebase onto the latest upstream tree.

---
Michael Reeves (2):
regmap: Remove debugfs before cache teardown
regmap: Drop map lock during cache init and exit

 drivers/base/regmap/regcache-maple.c |  9 +++++++--
 drivers/base/regmap/regcache.c       |  6 ------
 drivers/base/regmap/regmap-debugfs.c |  1 +
 drivers/base/regmap/regmap.c         | 15 +++++++++------
 include/linux/maple_tree.h           |  4 ++++
 5 files changed, 21 insertions(+), 14 deletions(-)

---
base-commit: 2c3418fffa9d037b2038a6db48be63f9e2291806
change-id: 20260925-regcache-lifecycle-submit-74f366be0fbc

Best regards,

Signature · 1 line
Michael Reeves <[email protected]>