mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] iio: magnetometer: fix the register restore on resume in mmc35240 and mmc5633
@ 2026-10-12  5:00 Shashank Mohan Jain
  2026-10-12  5:00 ` [PATCH v2 1/2] iio: magnetometer: mmc35240: leave cache-only mode before the cache sync Shashank Mohan Jain
  2026-10-12  5:00 ` [PATCH v2 2/2] iio: magnetometer: mmc5633: " Shashank Mohan Jain
  0 siblings, 2 replies; 3+ messages in thread
From: Shashank Mohan Jain @ 2026-10-12  5:00 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: David Lechner, Nuno Sá,
	Andy Shevchenko, Mark Brown, bui duc phuc, Frank Li, linux-iio,
	linux-kernel

The resume callbacks of mmc35240 and mmc5633 call
regcache_sync_region() before they take the regmap out of cache-only
mode. Since v7.3-rc1 regmap refuses a sync in cache-only mode with a
WARN and -EINVAL (86fc3483a4d6 and afc8e3ee8307), so both drivers now
warn on every resume and no longer restore their control registers.

The kernel-doc added by 86fc3483a4d6 says that the caller has to
disable cache-only mode before the sync, so the two patches change the
order in the drivers.

The Fixes tags name the commit that added each resume callback
(553a776b7908 for mmc35240, 6e5f6bf2e3f0 for mmc5633), as suggested by
Bui Duc Phuc in review of v1: the wrong order predates the regcache
change (86fc3483a4d6 / afc8e3ee8307), which only turned it into a WARN
and a failed restore.

I have no hardware for either chip. The patches were tested in qemu
with the drivers bound to an i2c-stub device and a suspend/resume
cycle through /sys/power/pm_test; the details are in the changelogs.
A scan of drivers/ and sound/ for other resume paths which sync before
leaving cache-only mode in the same function found only these two.

Based on mainline (a5ebb76233b7, v7.3-rc6+); the patches also apply
to next-20261009.

Changes since v1:
 - repoint the Fixes tags to the commits that added the resume
   callbacks (553a776b7908, 6e5f6bf2e3f0), per Bui Duc Phuc's review;
   the code change is unchanged.
 - note in each changelog that the ordering predates the regcache
   change that exposed it.

Shashank Mohan Jain (2):
  iio: magnetometer: mmc35240: leave cache-only mode before the cache
    sync
  iio: magnetometer: mmc5633: leave cache-only mode before the cache
    sync

 drivers/iio/magnetometer/mmc35240.c | 3 +--
 drivers/iio/magnetometer/mmc5633.c  | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)


base-commit: a5ebb76233b79db01e82e061173cb73c6d2b5c6b
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-12  5:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-12  5:00 [PATCH v2 0/2] iio: magnetometer: fix the register restore on resume in mmc35240 and mmc5633 Shashank Mohan Jain
2026-10-12  5:00 ` [PATCH v2 1/2] iio: magnetometer: mmc35240: leave cache-only mode before the cache sync Shashank Mohan Jain
2026-10-12  5:00 ` [PATCH v2 2/2] iio: magnetometer: mmc5633: " Shashank Mohan Jain

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®