Re: [PATCH v2 3/5] usb: cdc-wdm: adding usb_cdc_wdm_register subdriver support

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

 



Oliver Neukum <oliver@xxxxxxxxxx> writes:
> Am Donnerstag, 2. Februar 2012, 09:48:06 schrieb Bjørn Mork:
>> Hmm, looking at the code, and realizing that the reason we're taking
>> wlock here only is that the driver used to take the combined read/write
>> lock, I don't think it's necessary at all. desc->count is only modified
>> by wdm_open() and wdm_release(), both holding the global wdm_mutex at
>> the time. The only place desc->count is tested without holding the
>> wdm_mutex lock is in recover_from_urb_loss() which is called from
>> wdm_resume() and wdm_post_reset().  I don't think that is a problem
>> though, as both require holding the device lock which will protect them
>> from competing against each other.
>> 
>> So in short: I don't think the wlock offers any extra protection in
>> wdm_open and wdm_release and I would like to just drop it if you too
>> think that's OK.
>
> What is to guard pre/post_reset against open() ?

Currently nothing, I guess.  The patch adding WDM_RESETTING should have
included a test for that flag in open().

Will fix that and resend unless you have other suggestions.


Bjørn
--
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