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

2016-04-18 Thread Javier Martinez Canillas
[adding clk maintainers/list to cc] On 04/18/2016 09:29 AM, Javier Martinez Canillas wrote: > Hello Marek, > > On 04/18/2016 03:50 AM, Marek Szyprowski wrote: >> Hello, >> >> On 2016-04-16 00:04, Javier Martinez Canillas wrote: >>> The exynos5 I2C controller driver always prepares and enables a

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

2016-04-18 Thread Javier Martinez Canillas
[adding clk maintainers/list to cc] On 04/18/2016 09:29 AM, Javier Martinez Canillas wrote: > Hello Marek, > > On 04/18/2016 03:50 AM, Marek Szyprowski wrote: >> Hello, >> >> On 2016-04-16 00:04, Javier Martinez Canillas wrote: >>> The exynos5 I2C controller driver always prepares and enables a

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

2016-04-18 Thread Javier Martinez Canillas
Hello Marek, On 04/18/2016 03:50 AM, Marek Szyprowski wrote: > Hello, > > On 2016-04-16 00:04, 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. >> >>

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

2016-04-18 Thread Javier Martinez Canillas
Hello Marek, On 04/18/2016 03:50 AM, Marek Szyprowski wrote: > Hello, > > On 2016-04-16 00:04, 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. >> >>

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

2016-04-18 Thread Marek Szyprowski
Hello, On 2016-04-16 00:04, 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

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

2016-04-18 Thread Marek Szyprowski
Hello, On 2016-04-16 00:04, 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

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

2016-04-17 Thread Krzysztof Kozlowski
On Sat, Apr 16, 2016 at 08:58:49PM -0400, Javier Martinez Canillas wrote: > But regardless of the ABBA deadlock, there are reasons why the clk API is > split into an {,un}prepare and {en,dis}able functions (e.g: non-atomic vs > atomic) and it is a common pattern for drivers to prepare the clock(s)

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

2016-04-17 Thread Krzysztof Kozlowski
On Sat, Apr 16, 2016 at 08:58:49PM -0400, Javier Martinez Canillas wrote: > But regardless of the ABBA deadlock, there are reasons why the clk API is > split into an {,un}prepare and {en,dis}able functions (e.g: non-atomic vs > atomic) and it is a common pattern for drivers to prepare the clock(s)

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

2016-04-16 Thread Javier Martinez Canillas
Hello Krzysztof, Thanks a lot for your feedback. On 04/16/2016 12:11 PM, Krzysztof Kozlowski wrote: > On Fri, Apr 15, 2016 at 06:04:47PM -0400, Javier Martinez Canillas wrote: [snip] >> >> Fix this by only preparing the clock on probe and {en,dis}able in the >> rest of the driver. >> >> This

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

2016-04-16 Thread Javier Martinez Canillas
Hello Krzysztof, Thanks a lot for your feedback. On 04/16/2016 12:11 PM, Krzysztof Kozlowski wrote: > On Fri, Apr 15, 2016 at 06:04:47PM -0400, Javier Martinez Canillas wrote: [snip] >> >> Fix this by only preparing the clock on probe and {en,dis}able in the >> rest of the driver. >> >> This

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

2016-04-16 Thread Javier Martinez Canillas
Hello Anand, On 04/16/2016 08:15 AM, Anand Moon wrote: [snip] >> > > Thanks for fixing this bug. I also tried the same thing on clk, but > missed the return on failed. > > Reviewed-by: Anand Moon > Tested-by: Anand Moon > Thanks a lot for your

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

2016-04-16 Thread Javier Martinez Canillas
Hello Anand, On 04/16/2016 08:15 AM, Anand Moon wrote: [snip] >> > > Thanks for fixing this bug. I also tried the same thing on clk, but > missed the return on failed. > > Reviewed-by: Anand Moon > Tested-by: Anand Moon > Thanks a lot for your testing and review. > Best Regards > -Anand

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

2016-04-16 Thread Krzysztof Kozlowski
On Fri, Apr 15, 2016 at 06:04:47PM -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

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

2016-04-16 Thread Krzysztof Kozlowski
On Fri, Apr 15, 2016 at 06:04:47PM -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

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

2016-04-16 Thread Anand Moon
Hi Javier, On 16 April 2016 at 03:34, 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

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

2016-04-16 Thread Anand Moon
Hi Javier, On 16 April 2016 at 03:34, 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

[PATCH] i2c: exynos5: Fix possible ABBA deadlock by keeping I2C clock prepared

2016-04-15 Thread Javier Martinez Canillas
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

[PATCH] i2c: exynos5: Fix possible ABBA deadlock by keeping I2C clock prepared

2016-04-15 Thread Javier Martinez Canillas
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