Skip to contentSkip to conversation

regmap: fix wrong backport

PATCH In review Tzung-Bi Shih 3 participants 4 messages Jan 15, 2025 – Jan 21, 2025 Stable branch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regmap: fix wrong backport

48dc44f3c1af ("regmap: detach regmap from dev on regmap_exit") wrongly backported upstream commit 3061e170381a.

It should patch regmap_exit() instead of regmap_reinit_cache().

Fixes 48dc44f3c1af ("regmap: detach regmap from dev on regmap_exit")
---
 drivers/base/regmap/regmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/regmap/regmap.c +1 -1
index 8748cea3bc38..f0e314abcafc 100644
@@ -1513,7 +1513,6 @@ int regmap_reinit_cache(struct regmap *map, const struct regmap_config *config)
 {
 	int ret;
 
-	regmap_detach_dev(map->dev, map);
 	regcache_exit(map);
 	regmap_debugfs_exit(map);
 
@@ -1548,6 +1547,7 @@ void regmap_exit(struct regmap *map)
 {
 	struct regmap_async *async;
 
+	regmap_detach_dev(map->dev, map);
 	regcache_exit(map);
 	regmap_debugfs_exit(map);
 	regmap_range_exit(map);
Signature · 1 line
2.48.0.rc2.279.g1de40edade-goog
maintainer
#1 lore raw

[ Sasha's backport helper bot ]

Hi,

No upstream commit was identified. Using temporary commit for testing.

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.1.y        |  Success    |  Success   |
maintainer
#2 lore raw
In reply to Tzung-Bi Shih
Quoted 10 lines · Tzung-Bi Shih

48dc44f3c1af ("regmap: detach regmap from dev on regmap_exit") wrongly backported upstream commit 3061e170381a.

It should patch regmap_exit() instead of regmap_reinit_cache().

Fixes 48dc44f3c1af ("regmap: detach regmap from dev on regmap_exit")
---
 drivers/base/regmap/regmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

How about submitting a revert of the mistake and then the original commit properly backported as a patch series of 2 commits? That way it makes it more obvious what is happening here.

thanks,

greg k-h

maintainer
#3 lore raw
Quoted 12 lines · Greg KH
Quoted 10 lines · Tzung-Bi Shih

48dc44f3c1af ("regmap: detach regmap from dev on regmap_exit") wrongly backported upstream commit 3061e170381a.

It should patch regmap_exit() instead of regmap_reinit_cache().

Fixes 48dc44f3c1af ("regmap: detach regmap from dev on regmap_exit")
---
 drivers/base/regmap/regmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 3 lines

How about submitting a revert of the mistake and then the original commit properly backported as a patch series of 2 commits? That way it makes it more obvious what is happening here.

I've done the revert now, a fixed up backport would be appreciated now.

thanks

greg k-h