mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Mark Brown <broonie@kernel.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] regcache: rbtree: Restore async flag when exiting on error
Date: Mon, 26 Oct 2026 21:43:29 +0000	[thread overview]
Message-ID: <20261026-regcache-rbtree-restore-sync-v1-1-2ef0e9d57ec6@kernel.org> (raw)

rbtree cache syncs run with asynchronous I/O enabled, this is indicated
by setting the async flag on the regmap.  During a normal exit we reset
to synchronous mode but if we exit early due to an error this restore is
missed and the regmap is left in async mode.  Reset the flag on error as
well.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/base/regmap/regcache-rbtree.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/base/regmap/regcache-rbtree.c b/drivers/base/regmap/regcache-rbtree.c
index e2feed6dbecf..26ac2c2a2095 100644
--- a/drivers/base/regmap/regcache-rbtree.c
+++ b/drivers/base/regmap/regcache-rbtree.c
@@ -494,8 +494,10 @@ static int regcache_rbtree_sync(struct regmap *map, unsigned int min,
 		ret = regcache_sync_block(map, rbnode->block,
 					  rbnode->cache_present,
 					  rbnode->base_reg, start, end);
-		if (ret != 0)
+		if (ret != 0) {
+			map->async = false;
 			return ret;
+		}
 	}
 
 	map->async = false;

---
base-commit: 2dee91ee94eec85d09c13c7ca83e3005906d3732
base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git for-7.4
change-id: 20261026-regcache-rbtree-restore-sync-3ae8bf6ccfb7

Best regards,
--  
Mark Brown <broonie@kernel.org>


                 reply	other threads:[~2026-10-26 21:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261026-regcache-rbtree-restore-sync-v1-1-2ef0e9d57ec6@kernel.org \
    --to=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®