From: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
To: Vladimir Zapolskiy
<vladimir_zapolskiy-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>
Cc: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v2 3/4] i2c: core: add and export of_get_i2c_adapter_by_node() interface
Date: Thu, 6 Aug 2015 02:50:24 +0200 [thread overview]
Message-ID: <20150806005024.GC1743@katana> (raw)
In-Reply-To: <1438007451-8553-4-git-send-email-vladimir_zapolskiy-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1588 bytes --]
On Mon, Jul 27, 2015 at 05:30:50PM +0300, Vladimir Zapolskiy wrote:
> of_find_i2c_adapter_by_node() call requires quite often missing
> put_device(), and i2c_put_adapter() releases a device locked by
> i2c_get_adapter() only. In general module_put(adapter->owner) and
> put_device(dev) are not interchangeable.
>
> This is a common error reproduction scenario as a result of the
> misusage described above (for clearness this is run on iMX6 platform
> with HDMI and I2C bus drivers compiled as kernel modules):
>
> root@mx6q:~# lsmod | grep i2c
> i2c_imx 10213 0
> root@mx6q:~# lsmod | grep dw_hdmi_imx
> dw_hdmi_imx 3631 0
> dw_hdmi 11846 1 dw_hdmi_imx
> imxdrm 8674 3 dw_hdmi_imx,imx_ipuv3_crtc,imx_ldb
> drm_kms_helper 113765 5 dw_hdmi,imxdrm,imx_ipuv3_crtc,imx_ldb
> root@mx6q:~# rmmod dw_hdmi_imx
> root@mx6q:~# lsmod | grep i2c
> i2c_imx 10213 -1
>
> ^^^^^
>
> root@mx6q:~# rmmod i2c_imx
> rmmod: ERROR: Module i2c_imx is in use
>
> To fix existing users of these interfaces and to avoid any further
> confusion and misusage in future, add one more interface
> of_get_i2c_adapter_by_node(), it is similar to i2c_get_adapter() in
> sense that an I2C bus device driver found and locked by user can be
> correctly unlocked by i2c_put_adapter().
>
> Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>
Applied to for-next, thanks!
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-08-06 0:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-27 14:30 [PATCH v2 0/4] i2c: fix i2c adapter device driver user counter Vladimir Zapolskiy
[not found] ` <1438007451-8553-1-git-send-email-vladimir_zapolskiy-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>
2015-07-27 14:30 ` [PATCH v2 1/4] i2c: core: fix leaked device refcount on of_find_i2c_* error path Vladimir Zapolskiy
[not found] ` <1438007451-8553-2-git-send-email-vladimir_zapolskiy-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>
2015-08-01 10:09 ` Wolfram Sang
2015-07-27 14:30 ` [PATCH v2 2/4] i2c: core: manage i2c bus device refcount in i2c_[get|put]_adapter Vladimir Zapolskiy
[not found] ` <1438007451-8553-3-git-send-email-vladimir_zapolskiy-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>
2015-08-06 0:50 ` Wolfram Sang
2015-07-27 14:30 ` [PATCH v2 3/4] i2c: core: add and export of_get_i2c_adapter_by_node() interface Vladimir Zapolskiy
[not found] ` <1438007451-8553-4-git-send-email-vladimir_zapolskiy-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>
2015-08-06 0:50 ` Wolfram Sang [this message]
2015-07-27 14:30 ` [PATCH v2 4/4] i2c: arb-gpio-challenge: use of_get_i2c_adapter_by_node interface Vladimir Zapolskiy
[not found] ` <1438007451-8553-5-git-send-email-vladimir_zapolskiy-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>
2015-08-06 0:51 ` Wolfram Sang
2015-08-06 10:18 ` Vladimir Zapolskiy
2015-08-01 10:09 ` [PATCH v2 0/4] i2c: fix i2c adapter device driver user counter Wolfram Sang
2015-08-01 23:37 ` Vladimir Zapolskiy
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=20150806005024.GC1743@katana \
--to=wsa-z923lk4zbo2bacvfa/9k2g@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=vladimir_zapolskiy-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.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;
as well as URLs for NNTP newsgroup(s).