Re: recursive locking problem

2011-09-14 Thread Daniel Glöckner
On Wed, Sep 14, 2011 at 04:03:58AM +0300, Antti Palosaari wrote: On 09/09/2011 02:46 PM, Daniel Glöckner wrote: On Thu, Sep 08, 2011 at 07:34:32PM +0300, Antti Palosaari wrote: I am working with AF9015 I2C-adapter lock. I need lock I2C-bus since there is two tuners having same I2C address on

Re: recursive locking problem

2011-09-14 Thread Antti Palosaari
On 09/14/2011 09:19 AM, Daniel Glöckner wrote: On Wed, Sep 14, 2011 at 04:03:58AM +0300, Antti Palosaari wrote: On 09/09/2011 02:46 PM, Daniel Glöckner wrote: On Thu, Sep 08, 2011 at 07:34:32PM +0300, Antti Palosaari wrote: I am working with AF9015 I2C-adapter lock. I need lock I2C-bus since

Re: recursive locking problem

2011-09-14 Thread Daniel Glöckner
On Wed, Sep 14, 2011 at 01:45:47PM +0300, Antti Palosaari wrote: Interesting idea, but it didn't worked. It deadlocks. I think it locks since I2C-mux is controlled by I2C switch in same I2C bus, not GPIO or some other HW. Take a look at drivers/i2c/muxes/pca954x.c. You need to use

Re: recursive locking problem

2011-09-13 Thread Antti Palosaari
On 09/09/2011 01:45 PM, David Waring wrote: On 08/09/11 17:34, Antti Palosaari wrote: [snip] Is there any lock can do recursive locking but unlock frees all locks? Like that: gate_open +gate_open +gate_close == lock is free AFAIK mutex can do only simple lock() + unlock(). Semaphore can do

Re: recursive locking problem

2011-09-13 Thread Steve Kerrison
At the risk of sounding silly, why do we rely on i2c gating so much? The whole point of i2c is that you can sit a bunch of devices on the same pair of wires and talk to one at a time. Why not just open up the gates and be done with it, except for situations where the i2c chain foolishly has two

Re: recursive locking problem

2011-09-13 Thread Steven Toth
Can any one shed some light on this? I appreciate it's not a linux or indeed linux-media specific issue as the hardware itself is designed this way. i2c gates exist to isolate the downstream components from any spurious RF noise generated by noisy components on the i2c bus. You don't want to

Re: recursive locking problem

2011-09-13 Thread Devin Heitmueller
On Tue, Sep 13, 2011 at 5:34 PM, Steve Kerrison st...@stevekerrison.com wrote: At the risk of sounding silly, why do we rely on i2c gating so much? The whole point of i2c is that you can sit a bunch of devices on the same pair of wires and talk to one at a time. Steve, There are essentially

Re: recursive locking problem

2011-09-13 Thread Devin Heitmueller
On Tue, Sep 13, 2011 at 5:58 PM, Steven Toth st...@kernellabs.com wrote: Can any one shed some light on this? I appreciate it's not a linux or indeed linux-media specific issue as the hardware itself is designed this way. i2c gates exist to isolate the downstream components from any spurious

Re: recursive locking problem

2011-09-13 Thread Steven Toth
I would take Steven Toth's explanation as more authoritative than mine any day of the week.  It's possible that I may have been misinformed regarding the rationale for why the gate is required. In general, complete bus isolation lowers noise levels, whether through RF coupling or needless

Re: recursive locking problem

2011-09-13 Thread Antti Palosaari
On 09/09/2011 02:46 PM, Daniel Glöckner wrote: On Thu, Sep 08, 2011 at 07:34:32PM +0300, Antti Palosaari wrote: I am working with AF9015 I2C-adapter lock. I need lock I2C-bus since there is two tuners having same I2C address on same bus, demod I2C gate is used to select correct tuner. Would

Re: recursive locking problem

2011-09-09 Thread Hans Petter Selasky
On Thursday 08 September 2011 18:34:32 Antti Palosaari wrote: lock() + lock() + unlock() == free. Hi, As far as I can see the Linux kernel's mutex API doesn't have support for checking if a mutex is owned. I guess you would have to do something like: while (mutex_owned(xxx))

Re: recursive locking problem

2011-09-09 Thread Daniel Glöckner
On Thu, Sep 08, 2011 at 07:34:32PM +0300, Antti Palosaari wrote: I am working with AF9015 I2C-adapter lock. I need lock I2C-bus since there is two tuners having same I2C address on same bus, demod I2C gate is used to select correct tuner. Would it be possible to use the i2c-mux framework to

recursive locking problem

2011-09-08 Thread Antti Palosaari
I am working with AF9015 I2C-adapter lock. I need lock I2C-bus since there is two tuners having same I2C address on same bus, demod I2C gate is used to select correct tuner. I am trapping demod .i2c_gate_ctrl() calls and locking bus according to that. Is there any lock can do recursive