mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Dmitry Rokosov <DDRokosov@sberdevices.ru>
Cc: "robh+dt@kernel.org" <robh+dt@kernel.org>,
	"lars@metafoo.de" <lars@metafoo.de>,
	"andy.shevchenko@gmail.com" <andy.shevchenko@gmail.com>,
	"lorenzo.bianconi83@gmail.com" <lorenzo.bianconi83@gmail.com>,
	"srinivas.pandruvada@linux.intel.com" 
	<srinivas.pandruvada@linux.intel.com>,
	"teodora.baluta@intel.com" <teodora.baluta@intel.com>,
	"narcisaanamaria12@gmail.com" <narcisaanamaria12@gmail.com>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	kernel <kernel@sberdevices.ru>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 0/5] iio: treewide: rearrange iio trig get/register
Date: Sat, 28 May 2022 18:10:04 +0100	[thread overview]
Message-ID: <20220528181004.286e696d@jic23-huawei> (raw)
In-Reply-To: <20220524181150.9240-1-ddrokosov@sberdevices.ru>

On Tue, 24 May 2022 18:14:37 +0000
Dmitry Rokosov <DDRokosov@sberdevices.ru> wrote:

> The following patchset resolves problems with iio_trigger_get() and
> iio_trigger_register() call order in the different IIO drivers.
> 
> IIO trigger interface function iio_trigger_get() should be called after
> iio_trigger_register() (or its devm analogue) strictly, because of
> iio_trigger_get() acquires module refcnt based on the trigger->owner
> pointer, which is initialized inside iio_trigger_register() to
> THIS_MODULE.
> If this call order is wrong, the next iio_trigger_put() (from sysfs
> callback or "delete module" path) will dereference "default" module
> refcnt, which is incorrect behaviour.

Hi Dmitry,

Series applied to the fixes-togreg branch of iio.git and marked for stable.

Do you think it's also worth adding a runtime warning in iio_trigger_get()
on !trig->owner so that we catch any cases of this introduced in the future?

Thanks,

Jonathan

> 
> Changes v1->v2:
>     - provide tag Fixes: for all patches
> 
> Dmitry Rokosov (5):
>   iio:accel:bma180: rearrange iio trigger get and register
>   iio:accel:kxcjk-1013: rearrange iio trigger get and register
>   iio:accel:mxc4005: rearrange iio trigger get and register
>   iio:chemical:ccs811: rearrange iio trigger get and register
>   iio:humidity:hts221: rearrange iio trigger get and register
> 
>  drivers/iio/accel/bma180.c           | 3 ++-
>  drivers/iio/accel/kxcjk-1013.c       | 4 ++--
>  drivers/iio/accel/mxc4005.c          | 4 ++--
>  drivers/iio/chemical/ccs811.c        | 4 ++--
>  drivers/iio/humidity/hts221_buffer.c | 5 ++++-
>  5 files changed, 12 insertions(+), 8 deletions(-)
> 


  parent reply	other threads:[~2022-05-28 17:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-24 18:14 Dmitry Rokosov
2022-05-24 18:14 ` [PATCH v2 1/5] iio:accel:bma180: rearrange iio trigger get and register Dmitry Rokosov
2022-05-24 19:53   ` Andy Shevchenko
2022-05-24 18:14 ` [PATCH v2 2/5] iio:accel:kxcjk-1013: " Dmitry Rokosov
2022-05-24 19:49   ` Andy Shevchenko
2022-05-24 18:14 ` [PATCH v2 3/5] iio:accel:mxc4005: " Dmitry Rokosov
2022-05-24 19:50   ` Andy Shevchenko
2022-05-24 18:14 ` [PATCH v2 4/5] iio:chemical:ccs811: " Dmitry Rokosov
2022-05-24 19:51   ` Andy Shevchenko
2022-05-24 18:14 ` [PATCH v2 5/5] iio:humidity:hts221: " Dmitry Rokosov
2022-05-24 19:52   ` Andy Shevchenko
2022-05-28 17:10 ` Jonathan Cameron [this message]
2022-05-30 15:29   ` [PATCH v2 0/5] iio: treewide: rearrange iio trig get/register Dmitry Rokosov
2022-05-31 18:20   ` Dmitry Rokosov

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=20220528181004.286e696d@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=DDRokosov@sberdevices.ru \
    --cc=andy.shevchenko@gmail.com \
    --cc=kernel@sberdevices.ru \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo.bianconi83@gmail.com \
    --cc=narcisaanamaria12@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=srinivas.pandruvada@linux.intel.com \
    --cc=teodora.baluta@intel.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

all inboxes | Powered by JetHome®