Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Dec 2011 16:19:14 +0100
From:      Attilio Rao <attilio@freebsd.org>
To:        Andriy Gapon <avg@freebsd.org>
Cc:        freebsd-usb@freebsd.org
Subject:   Re: ukbd locking update
Message-ID:  <CAJ-FndDv_HLxzMZ7Ye8g9Y8R-nhHbC94kNV9=DJ3thx%2B-r41uQ@mail.gmail.com>
In-Reply-To: <4EF0A2B6.8050206@FreeBSD.org>
References:  <4EF088C8.8090906@FreeBSD.org> <CAJ-FndC%2BU2XkxEA=k-_FjOk1mKqhafUUrxA8fo8KAfeN8QfNYg@mail.gmail.com> <4EF0A2B6.8050206@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
2011/12/20 Andriy Gapon <avg@freebsd.org>:
> on 20/12/2011 16:00 Attilio Rao said the following:
>> 2011/12/20 Andriy Gapon <avg@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 thei=
r 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. =C2=A0That's done either by the general newbus code or via
>>> usbd_enum_lock() when the operations are executed in the USB explore th=
read.
>>
>> 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. =C2=A0I think that that should be sufficiently
> self-documenting and self-protecting too.

Yes, that looks good.

Attilio


--=20
Peace can only be achieved by understanding - A. Einstein



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-FndDv_HLxzMZ7Ye8g9Y8R-nhHbC94kNV9=DJ3thx%2B-r41uQ>