All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tzung-Bi Shih <tzungbi@kernel.org>
To: Satyam Gupta <sgsatyam@google.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Andy Shevchenko" <andriy.shevchenko@intel.com>,
	"Benson Leung" <bleung@chromium.org>,
	"Guenter Roeck" <groeck@chromium.org>,
	"Enric Balletbo i Serra" <eballetbo@kernel.org>,
	linux-iio@vger.kernel.org, chrome-platform@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] iio: cros_ec: Use platform sensor_num to unregister FIFO callback
Date: Mon, 9 Nov 2026 01:42:25 +0000	[thread overview]
Message-ID: <avElARDvNGQWodN8@google.com> (raw)
In-Reply-To: <20261106071904.142937-1-sgsatyam@google.com>

On Fri, Nov 06, 2026 at 07:19:04AM +0000, Satyam Gupta wrote:
> cros_ec_sensors_core_register() registers the FIFO callback for the
> sensor number found in the platform data. The matching cleanup action,
> cros_ec_sensors_core_clean(), reads the number back from
> st->param.info.sensor_num instead.
> 
> st->param is the EC host command buffer. Drivers fill it in under
> cmd_lock before each command, while the cleanup action reads it without
> that lock. It is also set only for physical sensors. If the field holds
> another value when the device is unbound, the cleanup clears the wrong
> slot and leaves the callback in place, still pointing to the iio_dev
> that is about to be freed.
> 
> Use the platform data in the cleanup action too, and pass the struct
> device pointer directly to devm_add_action_or_reset(), so it always
> unregisters the slot that cros_ec_sensors_core_register() registered.
> 
> Fixes: aa984f1ba4a4 ("iio: cros_ec: Register to cros_ec_sensorhub when EC supports FIFO")
> Signed-off-by: Satyam Gupta <sgsatyam@google.com>

Other than the fact that it wasn't sent independently, the patch itself
looks good to me.

Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>

      parent reply	other threads:[~2026-11-09  1:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05  7:31 [PATCH] iio: cros_ec: Use platform sensor_num to unregister FIFO callback Satyam Gupta
2026-11-05 10:00 ` Andy Shevchenko
2026-11-05 13:20 ` [PATCH v2] " Satyam Gupta
2026-11-06  3:10   ` Tzung-Bi Shih
2026-11-06  7:19     ` [PATCH v3] " Satyam Gupta
2026-11-06  9:22       ` Joshua Crofts
2026-11-06 17:41         ` Satyam Gupta
2026-11-09  1:42       ` Tzung-Bi Shih [this message]

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=avElARDvNGQWodN8@google.com \
    --to=tzungbi@kernel.org \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=bleung@chromium.org \
    --cc=chrome-platform@lists.linux.dev \
    --cc=dlechner@baylibre.com \
    --cc=eballetbo@kernel.org \
    --cc=groeck@chromium.org \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=sgsatyam@google.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.