All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Crofts <crofts@kernel.org>
To: Vineet Thakran <vineet789thakran@gmail.com>,
	Jonathan Cameron <jic23@kernel.org>
Cc: linux-iio@vger.kernel.org, "Kevin Tsai" <ktsai@capellamicro.com>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	stable@vger.kernel.org
Subject: Re: [PATCH 1/3] iio: light: cm3232: unregister the device before powering it down
Date: Fri, 4 Dec 2026 07:59:39 +0100	[thread overview]
Message-ID: <41347cd3-0a85-4342-937c-c6c292199e1b@kernel.org> (raw)
In-Reply-To: <20261203165254.135545-2-vineet789thakran@gmail.com>

On 03-Dec-26 17:52, Vineet Thakran wrote:
> cm3232_remove() shuts the sensor down before calling
> iio_device_unregister(), so the sysfs attributes stay live for a
> window after shutdown. A read of in_illuminance_input in that window
> reads the ALS register of a sensor that is shut down, and a write to
> in_illuminance_integration_time rewrites the command register from the
> cached regs_cmd, which does not have CM3232_CMD_ALS_DISABLE set, and so
> turns the sensor back on after remove has shut it down.
> 
> Unregister the IIO device first. Once iio_device_unregister() returns,
> the sysfs attributes are removed and no IIO callback can run, so the
> sensor stays shut down.
> 
> Fixes: b84894c7f088 ("iio: Added Capella cm3232 ambient light sensor driver.")
> Cc: stable@vger.kernel.org
> Signed-off-by: Vineet Thakran <vineet789thakran@gmail.com>
> ---
Reviewed-by: Joshua Crofts <crofts@kernel.org>

-- 
Kind regards,
Joshua Crofts


  reply	other threads:[~2026-12-04  6:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 16:52 [PATCH 0/3] iio: light: cm3232: fix remove ordering, locking and calibscale validation Vineet Thakran
2026-12-03 16:52 ` [PATCH 1/3] iio: light: cm3232: unregister the device before powering it down Vineet Thakran
2026-12-04  6:59   ` Joshua Crofts [this message]
2026-12-03 16:52 ` [PATCH 2/3] iio: light: cm3232: serialize access to the cached command register Vineet Thakran
2026-12-03 16:52 ` [PATCH 3/3] iio: light: cm3232: reject invalid calibscale values Vineet Thakran
2026-12-04  6:58   ` Joshua Crofts
2026-12-04 16:44   ` Andy Shevchenko

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=41347cd3-0a85-4342-937c-c6c292199e1b@kernel.org \
    --to=crofts@kernel.org \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=ktsai@capellamicro.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=stable@vger.kernel.org \
    --cc=vineet789thakran@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.