From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Mikko Rapeli <mikko.rapeli@linaro.org>,
linux-serial@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Tony Lindgren <tony@atomide.com>
Cc: openembedded-core <openembedded-core@lists.openembedded.org>,
Bruce Ashfield <bruce.ashfield@gmail.com>,
Randy MacLeod <randy.macleod@windriver.com>,
Paul Gortmaker <paul.gortmaker@windriver.com>
Subject: Re: Kernel 6.5 ttyS1 hang with qemu (was Re: [OE-core] Summary of the remaining 6.5 kernel serial issue (and 6.5 summary)
Date: Sun, 15 Oct 2023 13:29:48 +0100 [thread overview]
Message-ID: <b208c9c6b72be4ef0f2aadb7bed103280bff60a0.camel@linuxfoundation.org> (raw)
In-Reply-To: <178DF50519C11C84.8679@lists.openembedded.org>
On Sat, 2023-10-14 at 12:13 +0100, Richard Purdie via
lists.openembedded.org wrote:
> On Sat, 2023-10-14 at 10:41 +0100, Richard Purdie wrote:
> > Brief summary:
> >
> > We're seeing an issue on x86_64 with 6.5.X where data appears to be
> > left in the transmission buffer and not sent to the port on the second
> > serial port (ttyS1) until we trigger it with intervention.
> >
> > Paul Gortmaker did some painful bisection over a few days down to:
> >
> > serial: core: Start managing serial controllers to enable runtime PM
> > https://lore.kernel.org/linux-serial/1431f5b4-fb39-483b-9314-ed2b7c118c11@gmail.com/T/#t
>
> Having poked around a bit and knowing nothing about any of this, should
> this bit of new code added in the above commit to __uart_start() in
> serial_core.c:
>
> /*
> * Start TX if enabled, and kick runtime PM. If the device is not
> * enabled, serial_port_runtime_resume() calls start_tx()
> again
> * after enabling the device.
> */
> if (pm_runtime_active(&port_dev->dev))
> port->ops->start_tx(port);
>
>
> actually be something like:
>
>
> if (pm_runtime_active(&port_dev->dev) || !pm_runtime_enabled(&port_dev->dev))
> port->ops->start_tx(port);
>
>
> since there are uarts that don't enable runtime PM?
>
> I notice that 16550A I'm using doesn't set UART_CAP_RPM and since we
> have data left in the xmit buffer (I managed to confirm that), it is as
> if during init, there is a race between the serial probing and the
> getty putting data in the buffer? If it weren't statrted, that would
> explain things...
The above change didn't work but what does appear to be making a
difference is making this code call start_tx unconditionally which is
what it did prior to the patch. That does cause a "wake" when there
might not be any data but the code handles that gracefully.
I therefore suspect this is the place the issue is, the question is
what the right conditions for calling start_tx are?
I'll keep going with testing of that as the intermittent nature does
make this hard to know if any change helps or not.
Cheers,
Richard
next prev parent reply other threads:[~2023-10-15 12:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <178BF2895FF685E6.5378@lists.openembedded.org>
[not found] ` <a2ad67a0575548b6d5d8d187e597dcd72ae07f64.camel@linuxfoundation.org>
2023-10-09 10:05 ` Kernel 6.5 ttyS1 hang with qemu (was Re: [OE-core] Summary of the remaining 6.5 kernel serial issue (and 6.5 summary) Mikko Rapeli
2023-10-14 9:41 ` Richard Purdie
2023-10-14 11:13 ` Richard Purdie
[not found] ` <178DF50519C11C84.8679@lists.openembedded.org>
2023-10-15 12:29 ` Richard Purdie [this message]
2023-10-15 15:31 ` Greg Kroah-Hartman
2023-10-15 21:30 ` Richard Purdie
2023-10-16 6:35 ` Tony Lindgren
2023-10-16 7:16 ` Mikko Rapeli
2023-10-16 7:23 ` Tony Lindgren
2023-10-16 8:09 ` Mikko Rapeli
2023-10-16 8:10 ` Richard Purdie
2023-10-17 6:56 ` Tony Lindgren
2023-10-17 22:14 ` Richard Purdie
2023-10-18 5:28 ` Tony Lindgren
2023-10-19 12:44 ` Richard Purdie
[not found] <ZSlfF+2cEHb8nUwO@windriver.com>
[not found] ` <178C6861D9B097E8.24994@lists.openembedded.org>
2023-10-16 5:59 ` Mikko Rapeli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b208c9c6b72be4ef0f2aadb7bed103280bff60a0.camel@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=bruce.ashfield@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-serial@vger.kernel.org \
--cc=mikko.rapeli@linaro.org \
--cc=openembedded-core@lists.openembedded.org \
--cc=paul.gortmaker@windriver.com \
--cc=randy.macleod@windriver.com \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).