Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1385183

Re: [PATCH v2 2/2] i2c: exynos5: Fix possible ABBA deadlock by keeping I2C clock prepared

From Wolfram Sang <wsa@the-dreams.de>
Newsgroups linux.kernel
Subject Re: [PATCH v2 2/2] i2c: exynos5: Fix possible ABBA deadlock by keeping I2C clock prepared
Date 2016-04-22 15:40 +0200
Message-ID <rqJtp-2Ga-31@gated-at.bofh.it> (permalink)
References <roJxw-4hm-1@gated-at.bofh.it> <roJxw-4hm-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Sat, Apr 16, 2016 at 09:14:53PM -0400, Javier Martinez Canillas wrote:
> The exynos5 I2C controller driver always prepares and enables a clock
> before using it and then disables unprepares it when the clock is not
> used anymore.
> 
> But this can cause a possible ABBA deadlock in some scenarios since a
> driver that uses regmap to access its I2C registers, will first grab
> the regmap lock and then the I2C xfer function will grab the prepare
> lock when preparing the I2C clock. But since the clock driver also
> uses regmap for I2C accesses, preparing a clock will first grab the
> prepare lock and then the regmap lock when using the regmap API.
> 
> An example of this happens on the Exynos5422 Odroid XU4 board where a
> s2mps11 PMIC is used and both the s2mps11 regulators and clk drivers
> share the same I2C regmap.
> 
> The possible deadlock is reported by the kernel lockdep:
> 
>   Possible unsafe locking scenario:
> 
>         CPU0                    CPU1

Squashed both patches into one for easier backporting, added stable and
applied to for-current, thanks!

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 1/2] i2c: exynos5: Check clk_prepare_enable() return value Javier Martinez Canillas <javier@osg.samsung.com> - 2016-04-17 03:20 +0200
  [PATCH v2 2/2] i2c: exynos5: Fix possible ABBA deadlock by keeping I2C clock prepared Javier Martinez Canillas <javier@osg.samsung.com> - 2016-04-17 03:20 +0200
    Re: [PATCH v2 2/2] i2c: exynos5: Fix possible ABBA deadlock by  keeping I2C clock prepared Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-04-17 15:40 +0200
    Re: [PATCH v2 2/2] i2c: exynos5: Fix possible ABBA deadlock by  keeping I2C clock prepared Wolfram Sang <wsa@the-dreams.de> - 2016-04-22 15:40 +0200
  Re: [PATCH v2 1/2] i2c: exynos5: Check clk_prepare_enable() return  value Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-04-17 15:40 +0200

csiph-web