All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/5] iio: treewide: rearrange iio trig get/register
@ 2022-05-23 16:41 Dmitry Rokosov
  2022-05-23 16:41 ` [PATCH v1 1/5] iio:accel:bma180: rearrange iio trigger get and register Dmitry Rokosov
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Dmitry Rokosov @ 2022-05-23 16:41 UTC (permalink / raw)
  To: robh+dt, jic23, lars, andy.shevchenko, lorenzo.bianconi83,
	linus.walleij, stephan, hdegoede, antoniu.miclaus, sean,
	linmq006, gwendal, yangyingliang
  Cc: linux-iio, kernel, linux-kernel, Dmitry Rokosov

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
callbacks or rmmod) will derefence "default" module refcnt, which is
completely incorrect.

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(-)

-- 
2.36.0

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-05-23 19:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-23 16:41 [PATCH v1 0/5] iio: treewide: rearrange iio trig get/register Dmitry Rokosov
2022-05-23 16:41 ` [PATCH v1 1/5] iio:accel:bma180: rearrange iio trigger get and register Dmitry Rokosov
2022-05-23 16:41 ` [PATCH v1 2/5] iio:accel:kxcjk-1013: " Dmitry Rokosov
2022-05-23 16:41 ` [PATCH v1 3/5] iio:accel:mxc4005: " Dmitry Rokosov
2022-05-23 16:41 ` [PATCH v1 4/5] iio:chemical:ccs811: " Dmitry Rokosov
2022-05-23 17:40 ` [PATCH v1 0/5] iio: treewide: rearrange iio trig get/register Andy Shevchenko
2022-05-23 19:06   ` Dmitry Rokosov
2022-05-23 18:36 ` [PATCH v1 5/5] iio:humidity:hts221: rearrange iio trigger get and register Dmitry Rokosov

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.