Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-24 Thread Wolfram Sang
On Fri, Sep 16, 2016 at 06:02:41PM +0200, Bartosz Golaszewski wrote: > If an I2C GPIO multiplexer is driven by a GPIO provided by an expander > when there's a second expander using the same device driver on one of > the I2C bus segments, lockdep prints a deadlock warning when trying to > set the

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-24 Thread Wolfram Sang
On Fri, Sep 16, 2016 at 06:02:41PM +0200, Bartosz Golaszewski wrote: > If an I2C GPIO multiplexer is driven by a GPIO provided by an expander > when there's a second expander using the same device driver on one of > the I2C bus segments, lockdep prints a deadlock warning when trying to > set the

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-21 Thread Peter Rosin
On 2016-09-20 17:33, Thomas Gleixner wrote: > On Tue, 20 Sep 2016, Peter Rosin wrote: >> On 2016-09-19 11:03, Peter Zijlstra wrote: >>> >>> Use the -RT kernel and all locks will end up as rt_mutex. Avoiding >>> inversion on one specific lock, while there are then a gazillion other >>> than can

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-21 Thread Peter Rosin
On 2016-09-20 17:33, Thomas Gleixner wrote: > On Tue, 20 Sep 2016, Peter Rosin wrote: >> On 2016-09-19 11:03, Peter Zijlstra wrote: >>> >>> Use the -RT kernel and all locks will end up as rt_mutex. Avoiding >>> inversion on one specific lock, while there are then a gazillion other >>> than can

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-20 Thread Thomas Gleixner
On Tue, 20 Sep 2016, Peter Rosin wrote: > On 2016-09-19 11:03, Peter Zijlstra wrote: > > > > Use the -RT kernel and all locks will end up as rt_mutex. Avoiding > > inversion on one specific lock, while there are then a gazillion other > > than can equally create inversion doesn't make sense to me.

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-20 Thread Thomas Gleixner
On Tue, 20 Sep 2016, Peter Rosin wrote: > On 2016-09-19 11:03, Peter Zijlstra wrote: > > > > Use the -RT kernel and all locks will end up as rt_mutex. Avoiding > > inversion on one specific lock, while there are then a gazillion other > > than can equally create inversion doesn't make sense to me.

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-20 Thread Bartosz Golaszewski
2016-09-20 13:30 GMT+02:00 Geert Uytterhoeven : > On Tue, Sep 20, 2016 at 12:48 PM, Peter Rosin wrote: >> On 2016-09-20 12:07, Bartosz Golaszewski wrote: >>> I feel like it's just wrong to set an arbitrary limit on the number of >>> i2c branches - and this

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-20 Thread Bartosz Golaszewski
2016-09-20 13:30 GMT+02:00 Geert Uytterhoeven : > On Tue, Sep 20, 2016 at 12:48 PM, Peter Rosin wrote: >> On 2016-09-20 12:07, Bartosz Golaszewski wrote: >>> I feel like it's just wrong to set an arbitrary limit on the number of >>> i2c branches - and this is what the result of this approach

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-20 Thread Geert Uytterhoeven
On Tue, Sep 20, 2016 at 12:48 PM, Peter Rosin wrote: > On 2016-09-20 12:07, Bartosz Golaszewski wrote: >> I feel like it's just wrong to set an arbitrary limit on the number of >> i2c branches - and this is what the result of this approach would be. > > What arbitrary limit would

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-20 Thread Geert Uytterhoeven
On Tue, Sep 20, 2016 at 12:48 PM, Peter Rosin wrote: > On 2016-09-20 12:07, Bartosz Golaszewski wrote: >> I feel like it's just wrong to set an arbitrary limit on the number of >> i2c branches - and this is what the result of this approach would be. > > What arbitrary limit would that be? The

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-20 Thread Peter Rosin
On 2016-09-20 12:07, Bartosz Golaszewski wrote: > 2016-09-20 10:48 GMT+02:00 Peter Rosin : >> >> One pretty simple problematic case is: >> >> .---. .. >> | | ||-- i2c2 >> | |-- i2c0 --|mux0| .. >> | l | ||-- i2c3

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-20 Thread Peter Rosin
On 2016-09-20 12:07, Bartosz Golaszewski wrote: > 2016-09-20 10:48 GMT+02:00 Peter Rosin : >> >> One pretty simple problematic case is: >> >> .---. .. >> | | ||-- i2c2 >> | |-- i2c0 --|mux0| .. >> | l | ||-- i2c3 --|gpio| >> | i |

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-20 Thread Peter Zijlstra
On Tue, Sep 20, 2016 at 12:07:39PM +0200, Bartosz Golaszewski wrote: > 2016-09-20 10:48 GMT+02:00 Peter Rosin : > > > > One pretty simple problematic case is: > > > > .---. .. > > | | ||-- i2c2 > > | |-- i2c0 --|mux0| .. > > | l |

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-20 Thread Peter Zijlstra
On Tue, Sep 20, 2016 at 12:07:39PM +0200, Bartosz Golaszewski wrote: > 2016-09-20 10:48 GMT+02:00 Peter Rosin : > > > > One pretty simple problematic case is: > > > > .---. .. > > | | ||-- i2c2 > > | |-- i2c0 --|mux0| .. > > | l | |

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-20 Thread Bartosz Golaszewski
2016-09-20 10:48 GMT+02:00 Peter Rosin : > > One pretty simple problematic case is: > > .---. .. > | | ||-- i2c2 > | |-- i2c0 --|mux0| .. > | l | ||-- i2c3 --|gpio| > | i | '' '' > | n |

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-20 Thread Bartosz Golaszewski
2016-09-20 10:48 GMT+02:00 Peter Rosin : > > One pretty simple problematic case is: > > .---. .. > | | ||-- i2c2 > | |-- i2c0 --|mux0| .. > | l | ||-- i2c3 --|gpio| > | i | '' '' > | n |

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-20 Thread Peter Rosin
On 2016-09-19 11:03, Peter Zijlstra wrote: > On Mon, Sep 19, 2016 at 10:48:44AM +0200, Peter Rosin wrote: >> On 2016-09-19 10:14, Peter Zijlstra wrote: >>> On Mon, Sep 19, 2016 at 10:01:49AM +0200, Peter Rosin wrote: Or, do what the i2c-mux code is doing and use an rt_mutex instead of an

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-20 Thread Peter Rosin
On 2016-09-19 11:03, Peter Zijlstra wrote: > On Mon, Sep 19, 2016 at 10:48:44AM +0200, Peter Rosin wrote: >> On 2016-09-19 10:14, Peter Zijlstra wrote: >>> On Mon, Sep 19, 2016 at 10:01:49AM +0200, Peter Rosin wrote: Or, do what the i2c-mux code is doing and use an rt_mutex instead of an

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-19 Thread Peter Rosin
On 2016-09-18 21:45, Bartosz Golaszewski wrote: > 2016-09-18 21:43 GMT+02:00 Bartosz Golaszewski : >> 2016-09-18 10:52 GMT+02:00 Peter Rosin : >>> On 2016-09-16 19:58, Wolfram Sang wrote: Same here. And if it prevents us from false positive

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-19 Thread Peter Rosin
On 2016-09-18 21:45, Bartosz Golaszewski wrote: > 2016-09-18 21:43 GMT+02:00 Bartosz Golaszewski : >> 2016-09-18 10:52 GMT+02:00 Peter Rosin : >>> On 2016-09-16 19:58, Wolfram Sang wrote: Same here. And if it prevents us from false positive lockdep reports, I am all for fixing it.

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-19 Thread Peter Zijlstra
On Mon, Sep 19, 2016 at 10:48:44AM +0200, Peter Rosin wrote: > On 2016-09-19 10:14, Peter Zijlstra wrote: > > On Mon, Sep 19, 2016 at 10:01:49AM +0200, Peter Rosin wrote: > >> Or, do what the i2c-mux code is doing and use an rt_mutex instead > >> of an ordinary mutex. That way you are very sure to

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-19 Thread Peter Zijlstra
On Mon, Sep 19, 2016 at 10:48:44AM +0200, Peter Rosin wrote: > On 2016-09-19 10:14, Peter Zijlstra wrote: > > On Mon, Sep 19, 2016 at 10:01:49AM +0200, Peter Rosin wrote: > >> Or, do what the i2c-mux code is doing and use an rt_mutex instead > >> of an ordinary mutex. That way you are very sure to

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-19 Thread Peter Rosin
On 2016-09-19 10:14, Peter Zijlstra wrote: > On Mon, Sep 19, 2016 at 10:01:49AM +0200, Peter Rosin wrote: >> Or, do what the i2c-mux code is doing and use an rt_mutex instead >> of an ordinary mutex. That way you are very sure to not get any >> lockdep splat ... at all. Ok, sorry, that was not a

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-19 Thread Peter Rosin
On 2016-09-19 10:14, Peter Zijlstra wrote: > On Mon, Sep 19, 2016 at 10:01:49AM +0200, Peter Rosin wrote: >> Or, do what the i2c-mux code is doing and use an rt_mutex instead >> of an ordinary mutex. That way you are very sure to not get any >> lockdep splat ... at all. Ok, sorry, that was not a

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-19 Thread Peter Zijlstra
On Mon, Sep 19, 2016 at 10:01:49AM +0200, Peter Rosin wrote: > Or, do what the i2c-mux code is doing and use an rt_mutex instead > of an ordinary mutex. That way you are very sure to not get any > lockdep splat ... at all. Ok, sorry, that was not a serious > suggestion, but it would be a tad bit

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-19 Thread Peter Zijlstra
On Mon, Sep 19, 2016 at 10:01:49AM +0200, Peter Rosin wrote: > Or, do what the i2c-mux code is doing and use an rt_mutex instead > of an ordinary mutex. That way you are very sure to not get any > lockdep splat ... at all. Ok, sorry, that was not a serious > suggestion, but it would be a tad bit

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-18 Thread Bartosz Golaszewski
2016-09-18 21:43 GMT+02:00 Bartosz Golaszewski : > 2016-09-18 10:52 GMT+02:00 Peter Rosin : >> On 2016-09-16 19:58, Wolfram Sang wrote: >>> >>> Same here. And if it prevents us from false positive lockdep reports, I >>> am all for fixing it. >> >> Except

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-18 Thread Bartosz Golaszewski
2016-09-18 21:43 GMT+02:00 Bartosz Golaszewski : > 2016-09-18 10:52 GMT+02:00 Peter Rosin : >> On 2016-09-16 19:58, Wolfram Sang wrote: >>> >>> Same here. And if it prevents us from false positive lockdep reports, I >>> am all for fixing it. >> >> Except it doesn't, when I think some more about

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-18 Thread Bartosz Golaszewski
2016-09-18 10:52 GMT+02:00 Peter Rosin : > On 2016-09-16 19:58, Wolfram Sang wrote: >> >> Same here. And if it prevents us from false positive lockdep reports, I >> am all for fixing it. > > Except it doesn't, when I think some more about it... > > If you have two gpio-expanders

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-18 Thread Bartosz Golaszewski
2016-09-18 10:52 GMT+02:00 Peter Rosin : > On 2016-09-16 19:58, Wolfram Sang wrote: >> >> Same here. And if it prevents us from false positive lockdep reports, I >> am all for fixing it. > > Except it doesn't, when I think some more about it... > > If you have two gpio-expanders on the same depth

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-18 Thread Peter Rosin
On 2016-09-16 19:58, Wolfram Sang wrote: > >>> Looks good from my POV, but will wait for Peter to comment. >>> >>> If accepted, I'd think this should go via my I2C tree and I would like >>> to ask Linus to ack patch 4. D'accord, everyone? >> >> Since it is not clear if "Peter" is me or PeterZ (I

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-18 Thread Peter Rosin
On 2016-09-16 19:58, Wolfram Sang wrote: > >>> Looks good from my POV, but will wait for Peter to comment. >>> >>> If accepted, I'd think this should go via my I2C tree and I would like >>> to ask Linus to ack patch 4. D'accord, everyone? >> >> Since it is not clear if "Peter" is me or PeterZ (I

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-17 Thread Bartosz Golaszewski
2016-09-17 12:18 GMT+02:00 Wolfram Sang : > On Sat, Sep 17, 2016 at 03:19:52AM +0200, Peter Zijlstra wrote: >> On Fri, Sep 16, 2016 at 06:02:41PM +0200, Bartosz Golaszewski wrote: >> > If an I2C GPIO multiplexer is driven by a GPIO provided by an expander >> > when there's a

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-17 Thread Bartosz Golaszewski
2016-09-17 12:18 GMT+02:00 Wolfram Sang : > On Sat, Sep 17, 2016 at 03:19:52AM +0200, Peter Zijlstra wrote: >> On Fri, Sep 16, 2016 at 06:02:41PM +0200, Bartosz Golaszewski wrote: >> > If an I2C GPIO multiplexer is driven by a GPIO provided by an expander >> > when there's a second expander using

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-17 Thread Wolfram Sang
On Sat, Sep 17, 2016 at 03:19:52AM +0200, Peter Zijlstra wrote: > On Fri, Sep 16, 2016 at 06:02:41PM +0200, Bartosz Golaszewski wrote: > > If an I2C GPIO multiplexer is driven by a GPIO provided by an expander > > when there's a second expander using the same device driver on one of > > the I2C

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-17 Thread Wolfram Sang
On Sat, Sep 17, 2016 at 03:19:52AM +0200, Peter Zijlstra wrote: > On Fri, Sep 16, 2016 at 06:02:41PM +0200, Bartosz Golaszewski wrote: > > If an I2C GPIO multiplexer is driven by a GPIO provided by an expander > > when there's a second expander using the same device driver on one of > > the I2C

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-16 Thread Peter Zijlstra
On Fri, Sep 16, 2016 at 06:02:41PM +0200, Bartosz Golaszewski wrote: > If an I2C GPIO multiplexer is driven by a GPIO provided by an expander > when there's a second expander using the same device driver on one of > the I2C bus segments, lockdep prints a deadlock warning when trying to > set the

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-16 Thread Peter Zijlstra
On Fri, Sep 16, 2016 at 06:02:41PM +0200, Bartosz Golaszewski wrote: > If an I2C GPIO multiplexer is driven by a GPIO provided by an expander > when there's a second expander using the same device driver on one of > the I2C bus segments, lockdep prints a deadlock warning when trying to > set the

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-16 Thread Peter Rosin
On 2016-09-16 19:26, Wolfram Sang wrote: > On Fri, Sep 16, 2016 at 06:02:41PM +0200, Bartosz Golaszewski wrote: >> If an I2C GPIO multiplexer is driven by a GPIO provided by an expander >> when there's a second expander using the same device driver on one of >> the I2C bus segments, lockdep prints

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-16 Thread Peter Rosin
On 2016-09-16 19:26, Wolfram Sang wrote: > On Fri, Sep 16, 2016 at 06:02:41PM +0200, Bartosz Golaszewski wrote: >> If an I2C GPIO multiplexer is driven by a GPIO provided by an expander >> when there's a second expander using the same device driver on one of >> the I2C bus segments, lockdep prints

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-16 Thread Wolfram Sang
> > Looks good from my POV, but will wait for Peter to comment. > > > > If accepted, I'd think this should go via my I2C tree and I would like > > to ask Linus to ack patch 4. D'accord, everyone? > > Since it is not clear if "Peter" is me or PeterZ (I suspect PeterZ...), Nope, I meant you :) I

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-16 Thread Wolfram Sang
> > Looks good from my POV, but will wait for Peter to comment. > > > > If accepted, I'd think this should go via my I2C tree and I would like > > to ask Linus to ack patch 4. D'accord, everyone? > > Since it is not clear if "Peter" is me or PeterZ (I suspect PeterZ...), Nope, I meant you :) I

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-16 Thread Wolfram Sang
On Fri, Sep 16, 2016 at 06:02:41PM +0200, Bartosz Golaszewski wrote: > If an I2C GPIO multiplexer is driven by a GPIO provided by an expander > when there's a second expander using the same device driver on one of > the I2C bus segments, lockdep prints a deadlock warning when trying to > set the

Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-16 Thread Wolfram Sang
On Fri, Sep 16, 2016 at 06:02:41PM +0200, Bartosz Golaszewski wrote: > If an I2C GPIO multiplexer is driven by a GPIO provided by an expander > when there's a second expander using the same device driver on one of > the I2C bus segments, lockdep prints a deadlock warning when trying to > set the

[PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-16 Thread Bartosz Golaszewski
If an I2C GPIO multiplexer is driven by a GPIO provided by an expander when there's a second expander using the same device driver on one of the I2C bus segments, lockdep prints a deadlock warning when trying to set the direction or the value of the GPIOs provided by the second expander. This

[PATCH v2 0/4] gpio: fix an incorrect lockdep warning

2016-09-16 Thread Bartosz Golaszewski
If an I2C GPIO multiplexer is driven by a GPIO provided by an expander when there's a second expander using the same device driver on one of the I2C bus segments, lockdep prints a deadlock warning when trying to set the direction or the value of the GPIOs provided by the second expander. This