<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/base/regmap, branch v6.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.7</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2023-12-04T12:36:55Z</updated>
<entry>
<title>regmap: fix bogus error on regcache_sync success</title>
<updated>2023-12-04T12:36:55Z</updated>
<author>
<name>Matthias Reichl</name>
<email>hias@horus.com</email>
</author>
<published>2023-12-03T22:22:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fea88064445a59584460f7f67d102b6e5fc1ca1d'/>
<id>urn:sha1:fea88064445a59584460f7f67d102b6e5fc1ca1d</id>
<content type='text'>
Since commit 0ec7731655de ("regmap: Ensure range selector registers
are updated after cache sync") opening pcm512x based soundcards fail
with EINVAL and dmesg shows sync cache and pm_runtime_get errors:

[  228.794676] pcm512x 1-004c: Failed to sync cache: -22
[  228.794740] pcm512x 1-004c: ASoC: error at snd_soc_pcm_component_pm_runtime_get on pcm512x.1-004c: -22

This is caused by the cache check result leaking out into the
regcache_sync return value.

Fix this by making the check local-only, as the comment above the
regcache_read call states a non-zero return value means there's
nothing to do so the return value should not be altered.

Fixes: 0ec7731655de ("regmap: Ensure range selector registers are updated after cache sync")
Cc: stable@vger.kernel.org
Signed-off-by: Matthias Reichl &lt;hias@horus.com&gt;
Link: https://lore.kernel.org/r/20231203222216.96547-1-hias@horus.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'regmap-fix-v6.7-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap</title>
<updated>2023-11-08T00:56:10Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2023-11-08T00:56:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=eaec7c9892bd565ffc7dcd32515b157011ca2323'/>
<id>urn:sha1:eaec7c9892bd565ffc7dcd32515b157011ca2323</id>
<content type='text'>
Pull regmap fix from Mark Brown:
 "One fix here, for an interaction between noinc registers and caches.

  If a device uses noinc registers (which is rare) then we could corrupt
  registers after the noinc register in the cache"

* tag 'regmap-fix-v6.7-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
  regmap: prevent noinc writes from clobbering cache
</content>
</entry>
<entry>
<title>regmap: prevent noinc writes from clobbering cache</title>
<updated>2023-11-01T20:22:55Z</updated>
<author>
<name>Ben Wolsieffer</name>
<email>ben.wolsieffer@hefring.com</email>
</author>
<published>2023-11-01T14:29:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=984a4afdc87a1fc226fd657b1cd8255c13d3fc1a'/>
<id>urn:sha1:984a4afdc87a1fc226fd657b1cd8255c13d3fc1a</id>
<content type='text'>
Currently, noinc writes are cached as if they were standard incrementing
writes, overwriting unrelated register values in the cache. Instead, we
want to cache the last value written to the register, as is done in the
accelerated noinc handler (regmap_noinc_readwrite).

Fixes: cdf6b11daa77 ("regmap: Add regmap_noinc_write API")
Signed-off-by: Ben Wolsieffer &lt;ben.wolsieffer@hefring.com&gt;
Link: https://lore.kernel.org/r/20231101142926.2722603-2-ben.wolsieffer@hefring.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap: Merge up fix for window/paging issue</title>
<updated>2023-10-30T13:05:15Z</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2023-10-30T13:05:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6bbebcc11a69aef269eb2a33212f76992a4cfb1a'/>
<id>urn:sha1:6bbebcc11a69aef269eb2a33212f76992a4cfb1a</id>
<content type='text'>
This was too late and could potentially impact too many drivers for me
to be comfortable sending it before the merge window.
</content>
</entry>
<entry>
<title>regmap: Ensure range selector registers are updated after cache sync</title>
<updated>2023-10-26T15:54:05Z</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2023-10-26T15:49:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0ec7731655de196bc1e4af99e495b38778109d22'/>
<id>urn:sha1:0ec7731655de196bc1e4af99e495b38778109d22</id>
<content type='text'>
When we sync the register cache we do so with the cache bypassed in order
to avoid overhead from writing the synced values back into the cache. If
the regmap has ranges and the selector register for those ranges is in a
register which is cached this has the unfortunate side effect of meaning
that the physical and cached copies of the selector register can be out of
sync after a cache sync. The cache will have whatever the selector was when
the sync started and the hardware will have the selector for the register
that was synced last.

Fix this by rewriting all cached selector registers after every sync,
ensuring that the hardware and cache have the same content. This will
result in extra writes that wouldn't otherwise be needed but is simple
so hopefully robust. We don't read from the hardware since not all
devices have physical read support.

Given that nobody noticed this until now it is likely that we are rarely if
ever hitting this case.

Reported-by: Hector Martin &lt;marcan@marcan.st&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Link: https://lore.kernel.org/r/20231026-regmap-fix-selector-sync-v1-1-633ded82770d@kernel.org
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap: kunit: Add test for cache sync interaction with ranges</title>
<updated>2023-10-26T13:00:42Z</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2023-10-23T17:19:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6a2e332c2cbddd17d7dcb8f334953593f1324c8e'/>
<id>urn:sha1:6a2e332c2cbddd17d7dcb8f334953593f1324c8e</id>
<content type='text'>
Hector Martin reports that since when doing a cache sync we enable cache
bypass if the selector register for a range is cached then we might leave
the physical selector register pointing to a different value to that which
we have in the cache. If we then try to write to the page that our cache
tells us is selected we will not update the selector register and write to
the wrong page. Add a test case covering this.

Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Link: https://lore.kernel.org/r/20231023-regmap-test-window-cache-v1-2-d8a71f441968@kernel.org
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap: kunit: Fix marking of the range window as volatile</title>
<updated>2023-10-26T13:00:42Z</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2023-10-23T17:19:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fabe32cc1eca7857837abcb56b242bc4845b7067'/>
<id>urn:sha1:fabe32cc1eca7857837abcb56b242bc4845b7067</id>
<content type='text'>
For some reason the regmap used for testing ranges was not including the
end of the range of paged registers as volatile since it found the end by
counting from the selector register rather than the base of the window.

Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Link: https://lore.kernel.org/r/20231023-regmap-test-window-cache-v1-1-d8a71f441968@kernel.org
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap: fix NULL deref on lookup</title>
<updated>2023-10-09T12:13:53Z</updated>
<author>
<name>Johan Hovold</name>
<email>johan+linaro@kernel.org</email>
</author>
<published>2023-10-06T08:21:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c6df843348d6b71ea986266c12831cb60c2cf325'/>
<id>urn:sha1:c6df843348d6b71ea986266c12831cb60c2cf325</id>
<content type='text'>
Not all regmaps have a name so make sure to check for that to avoid
dereferencing a NULL pointer when dev_get_regmap() is used to lookup a
named regmap.

Fixes: e84861fec32d ("regmap: dev_get_regmap_match(): fix string comparison")
Cc: stable@vger.kernel.org      # 5.8
Cc: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Signed-off-by: Johan Hovold &lt;johan+linaro@kernel.org&gt;
Link: https://lore.kernel.org/r/20231006082104.16707-1-johan+linaro@kernel.org
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap: rbtree: Fix wrong register marked as in-cache when creating new node</title>
<updated>2023-09-22T15:54:00Z</updated>
<author>
<name>Richard Fitzgerald</name>
<email>rf@opensource.cirrus.com</email>
</author>
<published>2023-09-22T15:37:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7a795ac8d49e2433e1b97caf5e99129daf8e1b08'/>
<id>urn:sha1:7a795ac8d49e2433e1b97caf5e99129daf8e1b08</id>
<content type='text'>
When regcache_rbtree_write() creates a new rbtree_node it was passing the
wrong bit number to regcache_rbtree_set_register(). The bit number is the
offset __in number of registers__, but in the case of creating a new block
regcache_rbtree_write() was not dividing by the address stride to get the
number of registers.

Fix this by dividing by map-&gt;reg_stride.
Compare with regcache_rbtree_read() where the bit is checked.

This bug meant that the wrong register was marked as present. The register
that was written to the cache could not be read from the cache because it
was not marked as cached. But a nearby register could be marked as having
a cached value even if it was never written to the cache.

Signed-off-by: Richard Fitzgerald &lt;rf@opensource.cirrus.com&gt;
Fixes: 3f4ff561bc88 ("regmap: rbtree: Make cache_present bitmap per node")
Link: https://lore.kernel.org/r/20230922153711.28103-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap: debugfs: Fix a erroneous check after snprintf()</title>
<updated>2023-09-11T00:30:07Z</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2023-09-04T20:04:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d3601857e14de6369f00ae19564f1d817d175d19'/>
<id>urn:sha1:d3601857e14de6369f00ae19564f1d817d175d19</id>
<content type='text'>
This error handling looks really strange.
Check if the string has been truncated instead.

Fixes: f0c2319f9f19 ("regmap: Expose the driver name in debugfs")
Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Link: https://lore.kernel.org/r/8595de2462c490561f70020a6d11f4d6b652b468.1693857825.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
</feed>
