All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Crofts <crofts@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>,
	"Tzung-Bi Shih" <tzungbi@kernel.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: Fri, 6 Nov 2026 10:22:17 +0100	[thread overview]
Message-ID: <20261106102217.3bd67592@systembl0wer> (raw)
In-Reply-To: <20261106071904.142937-1-sgsatyam@google.com>

On Fri,  6 Nov 2026 07:19:04 +0000
Satyam Gupta <sgsatyam@google.com> 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>
> ---
> Changes in v3:
> - Pass dev instead of pdev to devm_add_action_or_reset() and drop the
>   unused pdev local variable (Tzung-Bi).
> - Move the note about out-of-tree triggers and how the issue was found
>   below '---' (Tzung-Bi).
> 

No, don't send a new version of a patch as a reply to the
previous version, it may break tooling like b4 for example.

-- 
Joshua Crofts

  reply	other threads:[~2026-11-06  9:22 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 [this message]
2026-11-06 17:41         ` Satyam Gupta
2026-11-09  1:42       ` Tzung-Bi Shih

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=20261106102217.3bd67592@systembl0wer \
    --to=crofts@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 \
    --cc=tzungbi@kernel.org \
    /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.