* [PATCH] regmap: maple: Clear async flag when doing a maple tree cache sync
@ 2023-07-18 17:13 Charles Keepax
2023-07-18 17:18 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Charles Keepax @ 2023-07-18 17:13 UTC (permalink / raw)
To: broonie; +Cc: gregkh, rafael, linux-kernel
The normal regcache_sync function sets the async flag on the register
map. The maple tree sync code uses a temporary buffer, which is freed
after the register is written, however, as the async flag is set the
buffer might not be used until after it is freed. Fix this by clearing
the async flag in the maple tree sync function.
Fixes: bfa0b38c1483 ("regmap: maple: Implement block sync for the maple tree cache")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
drivers/base/regmap/regcache-maple.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/base/regmap/regcache-maple.c b/drivers/base/regmap/regcache-maple.c
index 283c2e02a2985..a24045a8c18f9 100644
--- a/drivers/base/regmap/regcache-maple.c
+++ b/drivers/base/regmap/regcache-maple.c
@@ -248,6 +248,8 @@ static int regcache_maple_sync(struct regmap *map, unsigned int min,
bool sync_needed = false;
map->cache_bypass = true;
+ /* Maple tree sync uses a temporary buffer, so clear async */
+ map->async = false;
rcu_read_lock();
--
2.30.2
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] regmap: maple: Clear async flag when doing a maple tree cache sync
2023-07-18 17:13 [PATCH] regmap: maple: Clear async flag when doing a maple tree cache sync Charles Keepax
@ 2023-07-18 17:18 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2023-07-18 17:18 UTC (permalink / raw)
To: Charles Keepax; +Cc: gregkh, rafael, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 494 bytes --]
On Tue, Jul 18, 2023 at 06:13:46PM +0100, Charles Keepax wrote:
> The normal regcache_sync function sets the async flag on the register
> map. The maple tree sync code uses a temporary buffer, which is freed
> after the register is written, however, as the async flag is set the
> buffer might not be used until after it is freed. Fix this by clearing
> the async flag in the maple tree sync function.
It would be better to push this down into the rbtree code which is what
really wants this.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-18 17:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-18 17:13 [PATCH] regmap: maple: Clear async flag when doing a maple tree cache sync Charles Keepax
2023-07-18 17:18 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®