Re: [PATCH] USB: serial: Fix read regression in 2.6.31

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

 



On Tue, 22 Sep 2009, Alan Cox wrote:

> > This makes it hard to use for USB drivers. The need to hold a mutex
> > was the precise reason the sierra driver got the opened flag protected
> > with a spinlock.
> 
> The problem is that it isn't a meaningful question to ask in many ways
> because you can get an IRQ while opening while closing, or indeed if a
> CPU is stalled by something a close and reopen on one CPU while the other
> handles the IRQ event.

While different CPUs can have different views of the various tty 
states, and while there can be more than one open file reference or 
(possibly) tty in existence at a time, nevertheless the hardware is 
unique and can be in only one state at a given time.

> The same in many ways is true of ASYNCB_INITIALIZED - a valid answer to
> the mid IRQ question of "are we open at the moment" is "yes, no, yes, no,
> yes, no" - so there has to be serialization or it has to be handled in a
> more logical place.

The real problem here is that the hardware is actually a four-state
system: off, initializing, running, shutting down.  Hence a one-bit
flag isn't sufficient to represent all the possible states.

Alan Stern

--
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