public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: ShiHao <i.shihao.999@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: dlechner@baylibre.com, andy@kernel.org,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	i.shihao.999@gmail.com
Subject: Re: [PATCH] iio: accel: bma180: use devm_iio_triggered_buffer_setup()
Date: Sat, 28 Mar 2026 16:49:05 +0530	[thread overview]
Message-ID: <ace5KY5ov0nwXqH7@fedora> (raw)
In-Reply-To: <20260321130018.5ef955d1@jic23-huawei>

On Sat, Mar 21, 2026 at 01:00:18PM +0000, Jonathan Cameron wrote:
 
> This also changes the ordering so that the remove() path no longer
> does things in the reverse order of probe()
> 
> Whilst that might not introduce bugs in this case, it makes reasoning
> about race conditions much harder so I won't take code that does this.
> 
> The basic 'rule' for devm usage is that there must be only one transition
> in the probe() from using it to not using it. You should never go back
> to using it after that transition.  That way the handling in remove()
> and the unwinding of the devm_* happen in reverse order of probe()
> and all is easy to reason about
> 
> So to make any devm_ related changes in this driver requires a
> more comprehensive approach.  Note that even if the change here didn't
> suffer this ordering problem I'd be pushing back because of the partial
> nature of applying devm in this driver.  + a complete solution would
> not run into the ordering issue.

Thanks for you review. I will make sure to remember it.

Best regards
Shihao

      reply	other threads:[~2026-03-28 11:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-21 11:48 [PATCH] iio: accel: bma180: use devm_iio_triggered_buffer_setup() Shi Hao
2026-03-21 13:00 ` Jonathan Cameron
2026-03-28 11:19   ` ShiHao [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=ace5KY5ov0nwXqH7@fedora \
    --to=i.shihao.999@gmail.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox