Re: [BUG] 4.11.0-rc3 xterm hung in D state on exit, wchan is tty_release_struct

From: Rob Herring
Date: Thu Mar 23 2017 - 12:58:10 EST


On Thu, Mar 23, 2017 at 08:46:03AM -0500, Rob Herring wrote:
> On Thu, Mar 23, 2017 at 12:30:18AM -0700, lkml@xxxxxxxxxxx wrote:
> > On Wed, Mar 22, 2017 at 11:44:18PM -0700, lkml@xxxxxxxxxxx wrote:
> > > On Wed, Mar 22, 2017 at 07:08:46PM -0700, lkml@xxxxxxxxxxx wrote:
> > > > Hello list,
> > > >
> > > > After approximately one day day of running 4.11.0-rc3 with 7e54d9d reverted to
> > > > enable regular use, this happened upon destroying an xterm:
> > > >

[...]

> > >
> > > Added Rob Herring, author of c3485ee to CC list.
> > >
> >
> > I suspect this part was a mistake:
> >
> > - tty = READ_ONCE(port->itty);
> > - if (tty == NULL)
> > - return;
> >
> > Note release_tty() tty->port->itty is assigned NULL before calling
> > tty_buffer_cancel_work():
>
> The READ_ONCE should still handle that.
>
> Anyway, the changes were purely to try to remove the need for a ldisc in
> the serdev case and avoid referencing it. In fact we still have an
> ldisc, it's just not used. So we can restore the original ordering.
>
> Can you try this patch:
>

Please try this one instead. It passes the tty struct around instead of
the ldisc.

8<---------------------------------------------------------------------