Skip to content

Commit a82d62f

Browse files
jiaqingz-intelgregkh
authored andcommitted
Revert "8250: add support for ASIX devices with a FIFO bug"
This reverts commit eb26dfe. Commit eb26dfe ("8250: add support for ASIX devices with a FIFO bug") merged on Jul 13, 2012 adds a quirk for PCI_VENDOR_ID_ASIX (0x9710). But that ID is the same as PCI_VENDOR_ID_NETMOS defined in 1f8b061050c7 ("[PATCH] Netmos parallel/serial/combo support") merged on Mar 28, 2005. In pci_serial_quirks array, the NetMos entry always takes precedence over the ASIX entry even since it was initially merged, code in that commit is always unreachable. In my tests, adding the FIFO workaround to pci_netmos_init() makes no difference, and the vendor driver also does not have such workaround. Given that the code was never used for over a decade, it's safe to revert it. Also, the real PCI_VENDOR_ID_ASIX should be 0x125b, which is used on their newer AX99100 PCIe serial controllers released on 2016. The FIFO workaround should not be intended for these newer controllers, and it was never implemented in vendor driver. Fixes: eb26dfe ("8250: add support for ASIX devices with a FIFO bug") Cc: stable <[email protected]> Signed-off-by: Jiaqing Zhao <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 27a8268 commit a82d62f

File tree

4 files changed

+3
-29
lines changed

4 files changed

+3
-29
lines changed

drivers/tty/serial/8250/8250.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ struct serial8250_config {
9191
#define UART_BUG_TXEN BIT(1) /* UART has buggy TX IIR status */
9292
#define UART_BUG_NOMSR BIT(2) /* UART has buggy MSR status bits (Au1x00) */
9393
#define UART_BUG_THRE BIT(3) /* UART has buggy THRE reassertion */
94-
#define UART_BUG_PARITY BIT(4) /* UART mishandles parity if FIFO enabled */
9594
#define UART_BUG_TXRACE BIT(5) /* UART Tx fails to set remote DR */
9695

9796

drivers/tty/serial/8250/8250_pci.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,14 +1232,6 @@ static int pci_oxsemi_tornado_setup(struct serial_private *priv,
12321232
return pci_default_setup(priv, board, up, idx);
12331233
}
12341234

1235-
static int pci_asix_setup(struct serial_private *priv,
1236-
const struct pciserial_board *board,
1237-
struct uart_8250_port *port, int idx)
1238-
{
1239-
port->bugs |= UART_BUG_PARITY;
1240-
return pci_default_setup(priv, board, port, idx);
1241-
}
1242-
12431235
#define QPCR_TEST_FOR1 0x3F
12441236
#define QPCR_TEST_GET1 0x00
12451237
#define QPCR_TEST_FOR2 0x40
@@ -1955,7 +1947,6 @@ pci_moxa_setup(struct serial_private *priv,
19551947
#define PCI_DEVICE_ID_WCH_CH355_4S 0x7173
19561948
#define PCI_VENDOR_ID_AGESTAR 0x5372
19571949
#define PCI_DEVICE_ID_AGESTAR_9375 0x6872
1958-
#define PCI_VENDOR_ID_ASIX 0x9710
19591950
#define PCI_DEVICE_ID_BROADCOM_TRUMANAGE 0x160a
19601951
#define PCI_DEVICE_ID_AMCC_ADDIDATA_APCI7800 0x818e
19611952

@@ -2600,16 +2591,6 @@ static struct pci_serial_quirk pci_serial_quirks[] = {
26002591
.exit = pci_wch_ch38x_exit,
26012592
.setup = pci_wch_ch38x_setup,
26022593
},
2603-
/*
2604-
* ASIX devices with FIFO bug
2605-
*/
2606-
{
2607-
.vendor = PCI_VENDOR_ID_ASIX,
2608-
.device = PCI_ANY_ID,
2609-
.subvendor = PCI_ANY_ID,
2610-
.subdevice = PCI_ANY_ID,
2611-
.setup = pci_asix_setup,
2612-
},
26132594
/*
26142595
* Broadcom TruManage (NetXtreme)
26152596
*/

drivers/tty/serial/8250/8250_port.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2632,11 +2632,8 @@ static unsigned char serial8250_compute_lcr(struct uart_8250_port *up,
26322632

26332633
if (c_cflag & CSTOPB)
26342634
cval |= UART_LCR_STOP;
2635-
if (c_cflag & PARENB) {
2635+
if (c_cflag & PARENB)
26362636
cval |= UART_LCR_PARITY;
2637-
if (up->bugs & UART_BUG_PARITY)
2638-
up->fifo_bug = true;
2639-
}
26402637
if (!(c_cflag & PARODD))
26412638
cval |= UART_LCR_EPAR;
26422639
if (c_cflag & CMSPAR)
@@ -2799,8 +2796,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
27992796
up->lcr = cval; /* Save computed LCR */
28002797

28012798
if (up->capabilities & UART_CAP_FIFO && port->fifosize > 1) {
2802-
/* NOTE: If fifo_bug is not set, a user can set RX_trigger. */
2803-
if ((baud < 2400 && !up->dma) || up->fifo_bug) {
2799+
if (baud < 2400 && !up->dma) {
28042800
up->fcr &= ~UART_FCR_TRIGGER_MASK;
28052801
up->fcr |= UART_FCR_TRIGGER_1;
28062802
}
@@ -3131,8 +3127,7 @@ static int do_set_rxtrig(struct tty_port *port, unsigned char bytes)
31313127
struct uart_8250_port *up = up_to_u8250p(uport);
31323128
int rxtrig;
31333129

3134-
if (!(up->capabilities & UART_CAP_FIFO) || uport->fifosize <= 1 ||
3135-
up->fifo_bug)
3130+
if (!(up->capabilities & UART_CAP_FIFO) || uport->fifosize <= 1)
31363131
return -EINVAL;
31373132

31383133
rxtrig = bytes_to_fcr_rxtrig(up, bytes);

include/linux/serial_8250.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ struct uart_8250_port {
127127
struct list_head list; /* ports on this IRQ */
128128
u32 capabilities; /* port capabilities */
129129
u16 bugs; /* port bugs */
130-
bool fifo_bug; /* min RX trigger if enabled */
131130
unsigned int tx_loadsz; /* transmit fifo load size */
132131
unsigned char acr;
133132
unsigned char fcr;

0 commit comments

Comments
 (0)