]> git.itanic.dy.fi Git - linux-stable/commit
serial: 8250: Move Alpha-specific quirk out of the core
authorLukas Wunner <lukas@wunner.de>
Tue, 28 Dec 2021 17:22:00 +0000 (18:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Dec 2021 12:23:44 +0000 (13:23 +0100)
commitb4a29b94804c4774f22555651296b838df6ec0e4
tree941ce02678fe2d72628c8bd9d4428b1ce100f985
parentd3b3404df318504ec084213ab1065b73f49b0f1d
serial: 8250: Move Alpha-specific quirk out of the core

struct uart_8250_port contains mcr_mask and mcr_force members whose
sole purpose is to work around an Alpha-specific quirk.  This code
doesn't belong in the core where it is executed by everyone else,
so move it to a proper ->set_mctrl callback which is used on the
affected Alpha machine only.

The quirk was introduced in January 1995:
https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/diff/drivers/char/serial.c?h=1.1.83

The members in struct uart_8250_port were added in 2002:
https://git.kernel.org/history/history/c/4524aad27854

The quirk applies to non-PCI Alphas and arch/alpha/Kconfig specifies
"select FORCE_PCI if !ALPHA_JENSEN".  So apparently the only affected
machine is the EISA-based Jensen that Linus was working on back then:
https://lore.kernel.org/all/CAHk-=wj1JWZ3sCrGz16nxEj7=0O+srMg6Ah3iPTDXSPKEws_SA@mail.gmail.com/

Up until now the quirk is not applied unless CONFIG_PCI is disabled.
If users forget to do that or run a generic Alpha kernel, the serial
ports aren't usable on Jensen.  Avoid by confining the quirk to
CONFIG_ALPHA_JENSEN instead of !CONFIG_PCI.  On generic Alpha kernels,
auto-detect at runtime whether the quirk needs to be applied.

Cc: Russell King <rmk+kernel@armlinux.org.uk>
Cc: Ulrich Teichert <krypton@ulrich-teichert.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Link: https://lore.kernel.org/r/b83d069cb516549b8a5420e097bb6bdd806f36fc.1640695609.git.lukas@wunner.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250.h
drivers/tty/serial/8250/8250_alpha.c [new file with mode: 0644]
drivers/tty/serial/8250/8250_core.c
drivers/tty/serial/8250/8250_port.c
drivers/tty/serial/8250/Makefile
drivers/tty/serial/sunsu.c
include/linux/serial_8250.h