David Kahn wrote:
>
>
> James Carlson wrote:
>
>> The problem is indicated above.  open(9E) is almost always "active" on
>> a serial port, because there are threads there snoozing away, waiting
>> for someone to assert DCD.
>
> If that's the case, it's impossible to do this safely without
> locks. There's no way for the driver to guard against both
> threads being active at the same time.
>
> I believe that the framework must guarantee that there will
> only be a single thread active in the driver at a time for
> this to work they way they want it to work. In that case,
> if quiesce(9e) is active, even if DCD is asserted, that thread
> won't become active at the same time that the driver is in
> quiesce(9e) and there won't be two threads competing over
> the registers/resources of the device.

All this is moot, IMO.  The framework should be fully and completely 
single threaded at the time quiesce() is called, IMO.  There are no 
compelling reasons why locking, multiple threads, or any thing much 
beyond ddi_putXX, ddi_getXX are required.  All the driver should be 
doing is shutting down or resetting the device to initial power on 
state. We should be well past the point where anything that might have 
been happening in other threads is interesting.

    -- Garrett
>
> -David


Reply via email to