linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wander Costa <wcosta@redhat.com>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Wander Lairson Costa <wander@redhat.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	open list <linux-kernel@vger.kernel.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	"open list:SERIAL DRIVERS" <linux-serial@vger.kernel.org>
Subject: Re: Regression with 5021d709b31b ("tty: serial: Use fifo in 8250 console driver")
Date: Fri, 28 Jan 2022 09:30:50 -0300	[thread overview]
Message-ID: <CAAq0SUnNtS8b3419egw-WVH8ic+MxH8oQELm1K0s4iqt8pYKnQ@mail.gmail.com> (raw)
In-Reply-To: <YfMpk7DM9zA7NfmI@debian>

On Thu, Jan 27, 2022 at 8:24 PM Sudip Mukherjee
<sudipm.mukherjee@gmail.com> wrote:
>
> Hi Wander,
>
> Not sure if this has been reported before but since last few weeks I am
> seeing a problem with the rpi4 serial port on my test setup. The initial
> boot message will be completely garbled as you can see at:
> https://lava.qa.codethink.co.uk/scheduler/job/543#L380.
> The last good boot was https://lava.qa.codethink.co.uk/scheduler/job/540#L390.
>
> The bisect log:
>
> # bad: [455e73a07f6e288b0061dfcf4fcf54fa9fe06458] Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux
> # good: [7e7b69654724c72bd3219b71f58937845dca0b2b] Merge tag 'dma-mapping-5.17' of git://git.infradead.org/users/hch/dma-mapping
> git bisect start '455e73a07f6e288b0061dfcf4fcf54fa9fe06458' '7e7b69654724c72bd3219b71f58937845dca0b2b'
> # bad: [342465f5337f7bd5b8bd3b6f939ac12b620cbb43] Merge tag 'tty-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
> git bisect bad 342465f5337f7bd5b8bd3b6f939ac12b620cbb43
> # good: [6dc69d3d0d18d587ab9d809fe060ba4417cf0279] Merge tag 'driver-core-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
> git bisect good 6dc69d3d0d18d587ab9d809fe060ba4417cf0279
> # good: [e269f7acdc53623769da31135f60afeb3a65eaff] staging: r8188eu: remove the private ioctl "wps_assoc_req_ie"
> git bisect good e269f7acdc53623769da31135f60afeb3a65eaff
> # bad: [ad234e2bac274a43c9fa540bde8cd9f0c627b71f] tty: serial: meson: Drop the legacy compatible strings and clock code
> git bisect bad ad234e2bac274a43c9fa540bde8cd9f0c627b71f
> # good: [c66453ce8af8bac78a72ba4e21fd9a86720127d7] tty: fix kernel-doc in n_tty.c
> git bisect good c66453ce8af8bac78a72ba4e21fd9a86720127d7
> # good: [0882b473b084df31288003b3bee974aabac9dcf9] tty: serial: samsung: Enable console as module
> git bisect good 0882b473b084df31288003b3bee974aabac9dcf9
> # bad: [b4a29b94804c4774f22555651296b838df6ec0e4] serial: 8250: Move Alpha-specific quirk out of the core
> git bisect bad b4a29b94804c4774f22555651296b838df6ec0e4
> # good: [e822b4973f49015e1c6f63b91c8641ed9bfaf229] tty/ldsem: Fix syntax errors in comments
> git bisect good e822b4973f49015e1c6f63b91c8641ed9bfaf229
> # good: [fb09d0ac07725b442b32dbf53f0ab0bea54804e9] tty: Fix the keyboard led light display problem
> git bisect good fb09d0ac07725b442b32dbf53f0ab0bea54804e9
> # bad: [5021d709b31b8a14317998a33cbc78be0de9ab30] tty: serial: Use fifo in 8250 console driver
> git bisect bad 5021d709b31b8a14317998a33cbc78be0de9ab30
> # good: [adbfddc757aec1ed54ccb35c4a7ca9170df827e0] docs/driver-api: Replace a comma in the n_gsm.rst with a double colon
> git bisect good adbfddc757aec1ed54ccb35c4a7ca9170df827e0
> # first bad commit: [5021d709b31b8a14317998a33cbc78be0de9ab30] tty: serial: Use fifo in 8250 console driver
>
> And, indeed reverting 5021d709b31b ("tty: serial: Use fifo in 8250 console
> driver") on top of 23a46422c561 ("Merge tag 'net-5.17-rc2' of
> git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net") fixes the problem
> for me.
>
> This is seen on every boot and I will be happy to test any patch.
>

Hi Sudip,

Thanks for the report. As Greg said, the patch has been reverted. In
the meantime, could you please apply this patch and report if the
problem still happens:

diff --git a/drivers/tty/serial/8250/8250_port.c
b/drivers/tty/serial/8250/8250_port.c
index 2abb3de11a48..d3a93e5d55f7 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -3343,7 +3343,7 @@ static void serial8250_console_fifo_write(struct
uart_8250_port *up,
 {
        int i;
        const char *end = s + count;
-       unsigned int fifosize = up->port.fifosize;
+       unsigned int fifosize = up->tx_loadsz;
        bool cr_sent = false;

        while (s != end) {
@@ -3409,8 +3409,8 @@ void serial8250_console_write(struct
uart_8250_port *up, const char *s,
        }

        use_fifo = (up->capabilities & UART_CAP_FIFO) &&
-               port->fifosize > 1 &&
-               (serial_port_in(port, UART_FCR) & UART_FCR_ENABLE_FIFO) &&
+               up->tx_loadsz > 1 &&
+               (up->fcr & UART_FCR_ENABLE_FIFO) &&
                /*
                 * After we put a data in the fifo, the controller will send
                 * it regardless of the CTS state. Therefore, only use fifo


>
> --
> Regards
> Sudip
>


  parent reply	other threads:[~2022-01-28 12:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27 23:24 Sudip Mukherjee
2022-01-28  4:59 ` Thorsten Leemhuis
2022-01-28  7:15 ` Greg Kroah-Hartman
2022-01-28 12:30 ` Wander Costa [this message]
2022-01-31 12:58   ` Sudip Mukherjee
2022-01-31 13:22     ` Wander Costa

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=CAAq0SUnNtS8b3419egw-WVH8ic+MxH8oQELm1K0s4iqt8pYKnQ@mail.gmail.com \
    --to=wcosta@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=sudipm.mukherjee@gmail.com \
    --cc=torvalds@linux-foundation.org \
    --cc=wander@redhat.com \
    --subject='Re: Regression with 5021d709b31b ("tty: serial: Use fifo in 8250 console driver")' \
    /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

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