All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] drm: fix i2c adapter device driver user counter
@ 2015-09-22 21:46 Vladimir Zapolskiy
  2015-09-22 21:48 ` [PATCH v2 1/3] drm: dw_hdmi: use of_get_i2c_adapter_by_node interface Vladimir Zapolskiy
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Vladimir Zapolskiy @ 2015-09-22 21:46 UTC (permalink / raw)
  To: David Airlie, Russell King, Philipp Zabel, Andy Yan,
	Thierry Reding, Terje Bergström
  Cc: dri-devel

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.

Below is a common error reproduction scenario as a result of the
misusage described above (this is run on iMX6 platform with
HDMI and I2C bus drivers compiled as kernel modules for clearness):

    root@mx6q:~# lsmod | grep i2c
    i2c_imx                15348  0
    root@mx6q:~# lsmod | grep dw_hdmi_imx
    dw_hdmi_imx             3567  0
    dw_hdmi                15850  1 dw_hdmi_imx
    imxdrm                  8610  3 dw_hdmi_imx,imx_ipuv3_crtc,imx_ldb
    root@mx6q:~# rmmod dw_hdmi_imx
    root@mx6q:~# lsmod | grep i2c
    i2c_imx                15348  -1

                                 ^^^^^

    root@mx6q:~# rmmod i2c_imx
    rmmod: ERROR: Module i2c_imx is in use

To fix existing users of these interfaces use of_get_i2c_adapter_by_node()
interface, which is similar to i2c_get_adapter() in sense that an I2C bus
device driver found and locked by a user can be correctly unlocked by
i2c_put_adapter() call.

Changes from v1 to v2:
- none, this series is a straightforward bugfix, v1 was a blend of
  I2C core changes, bugfixes and improvements

The change is based on dri/drm-next.

Vladimir Zapolskiy (3):
  drm: dw_hdmi: use of_get_i2c_adapter_by_node interface
  drm: tilcdc: use of_get_i2c_adapter_by_node interface
  drm: tegra: use of_get_i2c_adapter_by_node interface

 drivers/gpu/drm/bridge/dw_hdmi.c       | 14 +++++++++-----
 drivers/gpu/drm/tegra/output.c         | 23 ++++++++++++-----------
 drivers/gpu/drm/tilcdc/tilcdc_tfp410.c |  6 ++----
 3 files changed, 23 insertions(+), 20 deletions(-)

-- 
2.5.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2015-11-30 14:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-22 21:46 [PATCH v2 0/3] drm: fix i2c adapter device driver user counter Vladimir Zapolskiy
2015-09-22 21:48 ` [PATCH v2 1/3] drm: dw_hdmi: use of_get_i2c_adapter_by_node interface Vladimir Zapolskiy
2015-10-12 13:14   ` Vladimir Zapolskiy
2015-09-22 21:48 ` [PATCH v2 2/3] drm: tilcdc: " Vladimir Zapolskiy
2015-09-22 21:48 ` [PATCH v2 3/3] drm: tegra: " Vladimir Zapolskiy
2015-10-12 13:15 ` [PATCH v2 0/3] drm: fix i2c adapter device driver user counter Vladimir Zapolskiy
2015-11-02 15:10   ` Vladimir Zapolskiy
2015-11-30 14:19     ` Vladimir Zapolskiy

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.