[linux-dvb] virtual bus locking

Manu Abraham abraham.manu at gmail.com
Wed Oct 24 22:25:36 CEST 2007


Hi,

I ran into a racy situation while handling multiple virtual adapters, the solution was 
simple to use a mutex_lock on the physical bus interface.

What i have is 3 virtual transaction interfaces, all of them using the same physical bus.
Now transactions are all fine except that there are cases when transactions get 
interleaved, the device thus will be in an undefined state.
(This is the reason for me to implement a bus lock in this circumstance)

Now, while looking at it, i found that i can't get a pointer back to the device state 
struct back from struct usb_device (at least looks like that to me)

http://jusst.de/hg/af901x/file/4d69cf364d21/linux/drivers/media/dvb/af9xxx/af9015_biu.c
int af9015_biu_xfer(struct usb_device *udev, struct af9015_biu_msg *msgs, int num)

A quick thought was to initialize it static, but then the other two transactions happen 
to be elsewhere in

http://jusst.de/hg/af901x/file/4d69cf364d21/linux/drivers/media/dvb/af9xxx/af9015_i2c.c
int af9015_virt_0_xfer(struct i2c_adapter *i2c, struct i2c_msg *msgs, int num)
int af9015_virt_1_xfer(struct i2c_adapter *i2c, struct i2c_msg *msgs, int num)

Someone can provide some "pointers" or better ideas before i start pulling out hair ? :)

Thanks,
Manu



More information about the linux-dvb mailing list