Linux Input/HID development
 help / color / mirror / Atom feed
From: "Pandruvada, Srinivas" <srinivas.pandruvada@intel.com>
To: "dlechner@baylibre.com" <dlechner@baylibre.com>,
	"archana.patni@linux.intel.com" <archana.patni@linux.intel.com>,
	"hongyan.song@intel.com" <hongyan.song@intel.com>,
	"nuno.sa@analog.com" <nuno.sa@analog.com>,
	"jic23@kernel.org" <jic23@kernel.org>,
	"jikos@kernel.org" <jikos@kernel.org>,
	"andy@kernel.org" <andy@kernel.org>,
	"sanjayembeddedse@gmail.com" <sanjayembeddedse@gmail.com>
Cc: "linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Subject: Re: [PATCH v2 0/8] HID: iio: Avoid race between callback setup and device exposure
Date: Mon, 22 Jun 2026 15:35:55 +0000	[thread overview]
Message-ID: <48a500f5c124b00c3ef33047d59eb18df04567d4.camel@intel.com> (raw)
In-Reply-To: <20260622-5-june-hid-iio-race-fixes-v2-0-1cfabcd1881e@gmail.com>

On Mon, 2026-06-22 at 10:59 +0530, Sanjay Chitroda wrote:
> Hi all,
> 
> This series avoid a race condition in HID IIO drivers related to the
> ordering between callback registration and device exposure.
> 
> Currently, several HID IIO drivers register the IIO device (making it
> visible to userspace and other kernel consumers) before all required
> callbacks and resources are fully initialized, or rely on devm-based
> cleanup in a way that does not guarantee correct teardown ordering.
> This creates a window where the device can be accessed while it is
> not fully initialized or is being torn down, potentially leading to
> sample drop or stale/no data.
> 
> To handle this, the series ensures that:
>   - All required callbacks and resources are set up before the device
>     is registered with the IIO core
>   - Resource cleanup is performed explicitly where ordering matters
> 
> PS: This is prepratory series to convert all HID IIO driver to devm.
> 
> Testing:
>   - Compiled with W=1 for each patch in series
> 
> ---
> Changes in v2:
> - Drop fixes tag and rectify commit message with reference to that
> - Link to v1:
> https://patch.msgid.link/20260606-5-june-hid-iio-race-fixes-v1-0-27a848c5758f@gmail.com
> 

> To: Jiri Kosina <jikos@kernel.org>
> To: Jonathan Cameron <jic23@kernel.org>
> To: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> To: David Lechner <dlechner@baylibre.com>
> To: Nuno Sá <nuno.sa@analog.com>
> To: Andy Shevchenko <andy@kernel.org>
> Cc: linux-input@vger.kernel.org
> Cc: linux-iio@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org

Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

> ---
> Sanjay Chitroda (8):
>       iio: orientation: hid-sensor-rotation: Avoid race between
> callback setup and device exposure
>       iio: orientation: hid-sensor-incl-3d: Avoid race between
> callback setup and device exposure
>       iio: gyro: hid-sensor-gyro-3d: Avoid race between callback
> setup and device exposure
>       iio: pressure: hid-sensor-press: Avoid race between callback
> setup and device exposure
>       iio: light: hid-sensor-prox: Avoid race between callback setup
> and device exposure
>       iio: light: hid-sensor-als: Avoid race between callback setup
> and device exposure
>       iio: magnetometer: hid-sensor-magn-3d: Avoid race between
> callback setup and device exposure
>       iio: accel: hid-sensor-accel-3d: Avoid race between callback
> setup and device exposure
> 
>  drivers/iio/accel/hid-sensor-accel-3d.c       | 20 ++++++++++-------
> ---
>  drivers/iio/gyro/hid-sensor-gyro-3d.c         | 20 ++++++++++-------
> ---
>  drivers/iio/light/hid-sensor-als.c            | 20 ++++++++++-------
> ---
>  drivers/iio/light/hid-sensor-prox.c           | 20 ++++++++++-------
> ---
>  drivers/iio/magnetometer/hid-sensor-magn-3d.c | 20 ++++++++++-------
> ---
>  drivers/iio/orientation/hid-sensor-incl-3d.c  | 20 ++++++++++-------
> ---
>  drivers/iio/orientation/hid-sensor-rotation.c | 20 ++++++++++-------
> ---
>  drivers/iio/pressure/hid-sensor-press.c       | 20 ++++++++++-------
> ---
>  8 files changed, 80 insertions(+), 80 deletions(-)
> ---
> base-commit: cc746297b23e89bd5df9f91f3a0ca209e8991763
> change-id: 20260605-5-june-hid-iio-race-fixes-f8b981f82b80
> 
> Best regards,
> --  
> Sanjay Chitroda <sanjayembeddedse@gmail.com>


      parent reply	other threads:[~2026-06-22 15:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-22  5:29 [PATCH v2 0/8] HID: iio: Avoid race between callback setup and device exposure Sanjay Chitroda
2026-06-22  5:29 ` [PATCH v2 1/8] iio: orientation: hid-sensor-rotation: " Sanjay Chitroda
2026-06-22  5:42   ` sashiko-bot
2026-06-22  5:29 ` [PATCH v2 2/8] iio: orientation: hid-sensor-incl-3d: " Sanjay Chitroda
2026-06-22  5:46   ` sashiko-bot
2026-06-22  5:29 ` [PATCH v2 3/8] iio: gyro: hid-sensor-gyro-3d: " Sanjay Chitroda
2026-06-22  5:45   ` sashiko-bot
2026-06-22  5:30 ` [PATCH v2 4/8] iio: pressure: hid-sensor-press: " Sanjay Chitroda
2026-06-22  5:44   ` sashiko-bot
2026-06-22  5:30 ` [PATCH v2 5/8] iio: light: hid-sensor-prox: " Sanjay Chitroda
2026-06-22  5:42   ` sashiko-bot
2026-06-22  5:30 ` [PATCH v2 6/8] iio: light: hid-sensor-als: " Sanjay Chitroda
2026-06-22  5:45   ` sashiko-bot
2026-06-22  5:30 ` [PATCH v2 7/8] iio: magnetometer: hid-sensor-magn-3d: " Sanjay Chitroda
2026-06-22  5:50   ` sashiko-bot
2026-06-22  5:30 ` [PATCH v2 8/8] iio: accel: hid-sensor-accel-3d: " Sanjay Chitroda
2026-06-22  6:03   ` sashiko-bot
2026-06-22 15:35 ` Pandruvada, Srinivas [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=48a500f5c124b00c3ef33047d59eb18df04567d4.camel@intel.com \
    --to=srinivas.pandruvada@intel.com \
    --cc=andy@kernel.org \
    --cc=archana.patni@linux.intel.com \
    --cc=dlechner@baylibre.com \
    --cc=hongyan.song@intel.com \
    --cc=jic23@kernel.org \
    --cc=jikos@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=sanjayembeddedse@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