<feed xmlns='http://www.w3.org/2005/Atom'>
<title>laptop-kernel/drivers/base/regmap, branch master</title>
<subtitle>Linux kernel tree for laptop</subtitle>
<id>https://git.zx2c4.com/laptop-kernel/atom/drivers/base/regmap?h=master</id>
<link rel='self' href='https://git.zx2c4.com/laptop-kernel/atom/drivers/base/regmap?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/'/>
<updated>2026-10-12T23:11:44Z</updated>
<entry>
<title>regmap: Fix cache lifecycle locking and teardown</title>
<updated>2026-10-12T23:11:44Z</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2026-10-12T23:11:44Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=d5a821f66047c2effd06147b84775f9b2ce0f4aa'/>
<id>urn:sha1:d5a821f66047c2effd06147b84775f9b2ce0f4aa</id>
<content type='text'>
Michael Reeves &lt;michael.reeves077@gmail.com&gt; says:

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.

Link: https://patch.msgid.link/20261006-regcache-lifecycle-submit-v3-0-37bdd82fd47c@gmail.com
</content>
</entry>
<entry>
<title>regmap: Drop map lock during cache init and exit</title>
<updated>2026-10-12T23:11:44Z</updated>
<author>
<name>Michael Reeves</name>
<email>michael.reeves077@gmail.com</email>
</author>
<published>2026-10-06T07:03:16Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=abff0a48b110fe52d43999b4cb7c793a510a6bf1'/>
<id>urn:sha1:abff0a48b110fe52d43999b4cb7c793a510a6bf1</id>
<content type='text'>
On systems with CONFIG_PROVE_RAW_LOCK_NESTING enabled, Apple GPIO probe
triggers an "Invalid wait context" lockdep warning.

The driver uses a regmap with a raw spinlock and REGCACHE_FLAT. During
regcache_init(), regcache_flat_init() allocates memory while holding the
raw spinlock. The memory allocator can acquire a non-raw spinlock, which
causes an invalid raw-to-non-raw lock nesting error. The abbreviated call
chain is:

  apple_gpio_pinctrl_probe
    regcache_init
      regcache_flat_init
        __kmalloc_noprof
          __pcs_replace_empty_main
            refill_objects
              _raw_spin_lock_irqsave

Cache allocation occurs before the regmap is published, cache destruction
occurs after users have stopped accessing it, and regmap_reinit_cache()
requires callers to prevent concurrent access. Remove the outer map lock
from cache initialization and destruction. Keep it for cache population
and normal register access.

The Maple cache still uses its internal spinlock during teardown. That
lock can also be acquired from hard IRQ context during register access.
Add Maple-state irqsave helpers and use them during teardown to preserve
the lock's IRQ-safe lockdep state.

Fixes: fd4ebc07b4df ("regmap: Hold the regmap lock when allocating and freeing the cache")
Suggested-by: Mark Brown &lt;broonie@kernel.org&gt;
Suggested-by: Liam R. Howlett &lt;liam@infradead.org&gt;
Signed-off-by: Michael Reeves &lt;michael.reeves077@gmail.com&gt;
Reviewed-by: Peng Fan &lt;peng.fan@nxp.com&gt;
Link: https://patch.msgid.link/20261006-regcache-lifecycle-submit-v3-2-37bdd82fd47c@gmail.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap: Remove debugfs before cache teardown</title>
<updated>2026-10-12T23:11:43Z</updated>
<author>
<name>Michael Reeves</name>
<email>michael.reeves077@gmail.com</email>
</author>
<published>2026-10-06T07:03:15Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=834035934cef9e60169de682f4dc9feafd49e51a'/>
<id>urn:sha1:834035934cef9e60169de682f4dc9feafd49e51a</id>
<content type='text'>
regmap_exit() and regmap_reinit_cache() destroy the register cache before
removing debugfs. A concurrent debugfs cache operation can therefore
access cache state after the backend exit callback starts freeing it.

Remove debugfs before cache teardown, and clear the debugfs pointer after
removal. During cache reinitialization, recreate debugfs only after the
new cache initializes successfully.

Signed-off-by: Michael Reeves &lt;michael.reeves077@gmail.com&gt;
Reviewed-by: Peng Fan &lt;peng.fan@nxp.com&gt;
Link: https://patch.msgid.link/20261006-regcache-lifecycle-submit-v3-1-37bdd82fd47c@gmail.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap: irq: Free the irqdomain we create</title>
<updated>2026-09-01T22:48:33Z</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2026-09-01T21:55:42Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=2e42cade8ff1ff579e77976d9869db4df1feaf74'/>
<id>urn:sha1:2e42cade8ff1ff579e77976d9869db4df1feaf74</id>
<content type='text'>
When domain support was added to regmap-irq it was not possible to
remove domains, this was added later by 8ee99ada293b (irqdomain: Support
removal of IRQ domains.).  We did update the main removal path to free
the domain but forgot the error unwinding case during creation that is
now in regmap_add_irq_chip_fwnode() after some code motion, meaning that
errors during instantiation result in an unused irqchip being left
hanging around.  Add the missing irq_remove_domain() call where the
comment says it should be.

Reported-by: Farhad Alemi &lt;farhad.alemi@berkeley.edu&gt;
Reported-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Link: https://patch.msgid.link/20260901-regmap-irq-deallocate-domain-v1-1-4bfed4aff559@kernel.org
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'regmap-v7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap</title>
<updated>2026-08-19T16:32:57Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-08-19T16:32:57Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=259c4f8e775cf25069c30e806b037b154147720d'/>
<id>urn:sha1:259c4f8e775cf25069c30e806b037b154147720d</id>
<content type='text'>
Pull regmap updates from Mark Brown:
 "This is a relatively busy release, though it's mostly cleanup work. We
  did add some new hooks for regmap-irq to support some driver work,
  that should also come in as part of a shared branch with the relevant
  driver work in the GPIO subsystem"

* tag 'regmap-v7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
  regmap: clean up kernel-doc comments
  regcache: Validate cache_only state in regcache_sync_region()
  regcache: Warn if regcache_sync() is called in cache_only mode
  regcache: Mark cache dirty if selector register rewrite fails
  regcache: Preserve cache synchronization errors in regcache_sync()
  regmap: maple: Workaround for another false-positive compiler warning
  regcache: Make -&gt;exit() callback return void
</content>
</entry>
<entry>
<title>Merge tag 'v7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into gpio/for-next</title>
<updated>2026-08-18T12:21:04Z</updated>
<author>
<name>Bartosz Golaszewski</name>
<email>bartosz.golaszewski@oss.qualcomm.com</email>
</author>
<published>2026-08-18T12:21:04Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=146cc263e457ff6055fe7829e4f4f4b0b5d5dd86'/>
<id>urn:sha1:146cc263e457ff6055fe7829e4f4f4b0b5d5dd86</id>
<content type='text'>
Linux 7.2
</content>
</entry>
<entry>
<title>regmap: sdw-mbq: don't call an unset readable_reg callback</title>
<updated>2026-08-12T17:08:48Z</updated>
<author>
<name>Andrey Golovko</name>
<email>andrey.golovko@gmail.com</email>
</author>
<published>2026-08-11T19:14:35Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=00268f9452d2a0d660aa9c1bb0ca07a994af6a4f'/>
<id>urn:sha1:00268f9452d2a0d660aa9c1bb0ca07a994af6a4f</id>
<content type='text'>
regmap_sdw_mbq_poll_busy() decides whether to poll the Function Busy bit
by calling ctx-&gt;readable_reg(), which is a straight copy of
config-&gt;readable_reg. That callback is optional: regmap_readable() treats
a NULL -&gt;readable_reg as "every register is readable", and drivers rely on
that. es9356 and tac5xx2-sdw both build an MBQ regmap without one.

Since commit ca1b11b36d82 ("regmap: sdw-mbq: Allow defers on undeferrable
controls") the poll runs on every -ENODATA, not only for Controls the
driver marked deferrable, so any of those devices answering
COMMAND_IGNORED takes the kernel through a NULL function pointer.

Treat a missing callback the way the rest of regmap does and poll.

Fixes: 5bc493bf0c37 ("regmap: sdw-mbq: Add support for SDCA deferred controls")
Signed-off-by: Andrey Golovko &lt;andrey.golovko@gmail.com&gt;
Reviewed-by: Charles Keepax &lt;ckeepax@opensource.cirrus.com&gt;
Link: https://patch.msgid.link/20260811184500.5312-1-andrey.golovko@gmail.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap: sdw-mbq: Fix swap of timeout and retry times</title>
<updated>2026-08-11T15:37:59Z</updated>
<author>
<name>Charles Keepax</name>
<email>ckeepax@opensource.cirrus.com</email>
</author>
<published>2026-08-11T13:18:16Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=ae7fd6ff4c6713270d2efe6db87a4a58ccb7cc61'/>
<id>urn:sha1:ae7fd6ff4c6713270d2efe6db87a4a58ccb7cc61</id>
<content type='text'>
When polling Function Busy using read_poll_timeout() the total timeout
and retry delay arguments are swapped. This leads to only a single retry
being processed, it seems the existing users typically do succeed before
the first retry.

Swap the arguments over to ensure the correct polling time.

Reported-by: Ville Saarinen &lt;wiza@saarinenkoti.fi&gt;
Link: https://lore.kernel.org/linux-sound/ansTPGgVNoDJlA5r@opensource.cirrus.com/T/#m680731a2f307f1f5176b27ed5aa560ddc94e5d62
Fixes: 5bc493bf0c37 ("regmap: sdw-mbq: Add support for SDCA deferred controls")
Signed-off-by: Charles Keepax &lt;ckeepax@opensource.cirrus.com&gt;
Link: https://patch.msgid.link/20260811131816.332082-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regcache: Sort the local copy of an unsorted reg_defaults array</title>
<updated>2026-08-06T12:01:39Z</updated>
<author>
<name>Peter Ujfalusi</name>
<email>peter.ujfalusi@linux.intel.com</email>
</author>
<published>2026-08-05T13:22:50Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=4b05ccb17f92268384d483221a577fccfc291c7a'/>
<id>urn:sha1:4b05ccb17f92268384d483221a577fccfc291c7a</id>
<content type='text'>
regcache_lookup_reg() bsearch()es the reg_defaults array, which requires
it to be sorted by ascending register address.  Entries following a
descending step are never found, so regcache_reg_needs_sync() reports
that they need a sync and they are written to the device on every
regcache_sync() even when they were never touched.

Detect the misordering while reg_defaults is validated against the
register stride and sort the local copy.  The check needs no new loop
and sort() only runs for the affected drivers, which are also warned
about.

Note that sort() is not stable, so for arrays with duplicated register
addresses it remains unspecified which entry is found.

Signed-off-by: Peter Ujfalusi &lt;peter.ujfalusi@linux.intel.com&gt;
Reviewed-by: Charles Keepax &lt;ckeepax@opensource.cirrus.com&gt;
Tested-by: Charles Keepax &lt;ckeepax@opensource.cirrus.com&gt;
Link: https://patch.msgid.link/20260805132250.2637-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regcache: Use a consistent sort for defaults table</title>
<updated>2026-08-06T11:59:47Z</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2026-08-05T17:51:00Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=9ed3d974a26644ad57b3d4d067e279188b2038b6'/>
<id>urn:sha1:9ed3d974a26644ad57b3d4d067e279188b2038b6</id>
<content type='text'>
When we look up registers in the defaults table we use a binary search,
and we have a regcache_sort_defaults() API to help drivers that constuct
their defaults tables on the fly.  Unfortunately the lookup and the sort
don't use the same comparison function, and to make matters worse the
comparison function used during lookups is written for signed register
numbers rather than the unsigned ones we actually have so can produce
suprising results when some of the addresses have the top bit set.

Standardise on the more explicitly coded function to ensure consistent
results.

Reviewed-by: Peter Ujfalusi &lt;peter.ujfalusi@linux.intel.com&gt;
Reviewed-by: Charles Keepax &lt;ckeepax@opensource.cirrus.com&gt;
Tested-by: Charles Keepax &lt;ckeepax@opensource.cirrus.com&gt;
Link: https://patch.msgid.link/20260805-regmap-regcache-sort-v1-1-162186aad8b9@kernel.org
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
</feed>
