mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shashank Mohan Jain <jain.sm@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: "David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Mark Brown" <broonie@kernel.org>,
	"bui duc phuc" <phucduc.bui@gmail.com>,
	"Frank Li" <Frank.Li@nxp.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 0/2] iio: magnetometer: fix the register restore on resume in mmc35240 and mmc5633
Date: Sun, 11 Oct 2026 10:49:22 +0530	[thread overview]
Message-ID: <20261011051924.60456-1-jain.sm@gmail.com> (raw)

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 regcache commit, because that is where the
behaviour changed: the drivers have used this order since their resume
callbacks were added, and it worked until v7.2. Please tell me if you
would rather have the driver commits there.

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.

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


             reply	other threads:[~2026-10-11  5:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-11  5:19 Shashank Mohan Jain [this message]
2026-10-11  5:19 ` [PATCH 1/2] iio: magnetometer: mmc35240: leave cache-only mode before the cache sync Shashank Mohan Jain
2026-10-11  5:19 ` [PATCH 2/2] iio: magnetometer: mmc5633: " Shashank Mohan Jain

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=20261011051924.60456-1-jain.sm@gmail.com \
    --to=jain.sm@gmail.com \
    --cc=Frank.Li@nxp.com \
    --cc=andy@kernel.org \
    --cc=broonie@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=phucduc.bui@gmail.com \
    /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®