ukbd locking update
Attilio Rao
attilio at freebsd.org
Tue Dec 20 15:19:16 UTC 2011
2011/12/20 Andriy Gapon <avg at freebsd.org>:
> on 20/12/2011 16:00 Attilio Rao said the following:
>> 2011/12/20 Andriy Gapon <avg at freebsd.org>:
>>>
>>> I completing a patch that changes some locking in ukbd to account for
>>> SCHEDULER_STOPPED and for other realities of the code.
>>>
>>> As a preview I would like to share couple of observations that had their effect
>>> on the patch.
>>>
>>> 1. Acquiring Giant in device_attach, _detach in similar newbus method
>>> implementations should be redundant because those are already executed with
>>> Giant held. That's done either by the general newbus code or via
>>> usbd_enum_lock() when the operations are executed in the USB explore thread.
>>
>> That's right, however, if you plan to axe those because of the newbus
>> assumption I'd prefer you add a comment for every function you touch
>> saying that it needs to be Giant protected (in order to cope with them
>> once newbus is made MPSAFE).
>
> I put mtx_assert there. I think that that should be sufficiently
> self-documenting and self-protecting too.
Yes, that looks good.
Attilio
--
Peace can only be achieved by understanding - A. Einstein
More information about the freebsd-usb
mailing list