Re: [PATCH] Add Qualcomm Gobi 2000/3000 driver.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 14, 2011 at 10:58:08PM +0100, Alan Cox wrote:
> > Does a per-device lock on the entire device (and an accompanying flattening of
> > 'struct qmidev' into 'struct qcusbnet', and replacement of qmidev's
> > clients_lock with a device lock) seem like a good solution to the concurrency
> > problems here?
> 
> I wonder if refcounting it would be better but I've not sat and
> considered how well that fits this specific problem, merely thinking from
> general experience.
> 
> Greg may also have some thoughts there as he's done far more USB than
> most people.

Refcounting is usually the best thing to do.  USB devices and network
ones have it built in, so you usually can get away with using those
references to also control the lifetime of your device.

But moving those structures together is a great first start, just use a
single lock to protect your data accesses and you should be fine.

Hope this helps,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux