Re: 2.6.31-rc5 regression: Oops when USB Serial disconnected while in use

Alan Stern
2009-08-21T14:02:53Z

On Thu, 20 Aug 2009, Alan Cox wrote:

> So the tty layer always went that way so that the awkward cases around an
> opening failing with a hangup just go away. For the normal drivers which
> basically do
>
> open:
> tty layer open work
> open hardware and set ASYNCB_INITIALIZED
> block for carrier
>
> close:
> if (!hung_up) {
> if initialized
> shutdown()
> }
>
> the USB layer works really hard to be completely different (in part
> because the old code simply didn't implement open semantics properly or
> hangup correctly - hence things like mgetty fail on them).
>
> The later patches I was working on were trying to get USB serial to the
> point where the model was that drv->open/drv->close were the hardware
> init/shutdown and did indeed get called in nice matching open/close pairs
> and not re-entered or called unserialized.

That is indeed the best approach. How much is still needed to make it
work?

> Nice spot on the ASYNC v ASYNCB bug Alan btw

Hah! Crashing with a big oops was a pretty strong hint that something
was wrong. The tricky part was grovelling through the disassembly
listing and figuring out why the offsets were so huge. :-)

Alan Stern