Skip to content

Commit 7269c25

Browse files
jiaqingz-intelgregkh
authored andcommitted
Revert "8250: add support for ASIX devices with a FIFO bug"
commit a82d62f upstream. 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 20f7c4d commit 7269c25

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
@@ -90,7 +90,6 @@ struct serial8250_config {
9090
#define UART_BUG_TXEN BIT(1) /* UART has buggy TX IIR status */
9191
#define UART_BUG_NOMSR BIT(2) /* UART has buggy MSR status bits (Au1x00) */
9292
#define UART_BUG_THRE BIT(3) /* UART has buggy THRE reassertion */
93-
#define UART_BUG_PARITY BIT(4) /* UART mishandles parity if FIFO enabled */
9493
#define UART_BUG_TXRACE BIT(5) /* UART Tx fails to set remote DR */
9594

9695

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

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

1255-
static int pci_asix_setup(struct serial_private *priv,
1256-
const struct pciserial_board *board,
1257-
struct uart_8250_port *port, int idx)
1258-
{
1259-
port->bugs |= UART_BUG_PARITY;
1260-
return pci_default_setup(priv, board, port, idx);
1261-
}
1262-
12631255
/* Quatech devices have their own extra interface features */
12641256

12651257
struct quatech_feature {
@@ -2082,7 +2074,6 @@ pci_moxa_setup(struct serial_private *priv,
20822074
#define PCI_DEVICE_ID_WCH_CH355_4S 0x7173
20832075
#define PCI_VENDOR_ID_AGESTAR 0x5372
20842076
#define PCI_DEVICE_ID_AGESTAR_9375 0x6872
2085-
#define PCI_VENDOR_ID_ASIX 0x9710
20862077
#define PCI_DEVICE_ID_BROADCOM_TRUMANAGE 0x160a
20872078
#define PCI_DEVICE_ID_AMCC_ADDIDATA_APCI7800 0x818e
20882079

@@ -2892,16 +2883,6 @@ static struct pci_serial_quirk pci_serial_quirks[] = {
28922883
.exit = pci_wch_ch38x_exit,
28932884
.setup = pci_wch_ch38x_setup,
28942885
},
2895-
/*
2896-
* ASIX devices with FIFO bug
2897-
*/
2898-
{
2899-
.vendor = PCI_VENDOR_ID_ASIX,
2900-
.device = PCI_ANY_ID,
2901-
.subvendor = PCI_ANY_ID,
2902-
.subdevice = PCI_ANY_ID,
2903-
.setup = pci_asix_setup,
2904-
},
29052886
/*
29062887
* Broadcom TruManage (NetXtreme)
29072888
*/

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

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

26212621
if (c_cflag & CSTOPB)
26222622
cval |= UART_LCR_STOP;
2623-
if (c_cflag & PARENB) {
2623+
if (c_cflag & PARENB)
26242624
cval |= UART_LCR_PARITY;
2625-
if (up->bugs & UART_BUG_PARITY)
2626-
up->fifo_bug = true;
2627-
}
26282625
if (!(c_cflag & PARODD))
26292626
cval |= UART_LCR_EPAR;
26302627
#ifdef CMSPAR
@@ -2787,8 +2784,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
27872784
up->lcr = cval; /* Save computed LCR */
27882785

27892786
if (up->capabilities & UART_CAP_FIFO && port->fifosize > 1) {
2790-
/* NOTE: If fifo_bug is not set, a user can set RX_trigger. */
2791-
if ((baud < 2400 && !up->dma) || up->fifo_bug) {
2787+
if (baud < 2400 && !up->dma) {
27922788
up->fcr &= ~UART_FCR_TRIGGER_MASK;
27932789
up->fcr |= UART_FCR_TRIGGER_1;
27942790
}
@@ -3124,8 +3120,7 @@ static int do_set_rxtrig(struct tty_port *port, unsigned char bytes)
31243120
struct uart_8250_port *up = up_to_u8250p(uport);
31253121
int rxtrig;
31263122

3127-
if (!(up->capabilities & UART_CAP_FIFO) || uport->fifosize <= 1 ||
3128-
up->fifo_bug)
3123+
if (!(up->capabilities & UART_CAP_FIFO) || uport->fifosize <= 1)
31293124
return -EINVAL;
31303125

31313126
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
@@ -98,7 +98,6 @@ struct uart_8250_port {
9898
struct list_head list; /* ports on this IRQ */
9999
u32 capabilities; /* port capabilities */
100100
unsigned short bugs; /* port bugs */
101-
bool fifo_bug; /* min RX trigger if enabled */
102101
unsigned int tx_loadsz; /* transmit fifo load size */
103102
unsigned char acr;
104103
unsigned char fcr;

0 commit comments

Comments
 (0)