Skip to content

Commit 045ecc2

Browse files
committed
Merge tag 'tty-3.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull TTY/serial fixes from Greg Kroah-Hartman: "Here are some tty/serial driver fixes for 3.9. The big thing here is the fix for the huge mess we caused renaming the 8250 driver accidentally in the 3.7 kernel release, without realizing that there were users of the module options that suddenly broke. This is now resolved, and, to top the injury off, we have a backwards- compatible option for those users who got used to the new name since 3.7. Ugh, sorry about that. Other than that, some other minor fixes for issues that have been reported by users." * tag 'tty-3.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: Xilinx: ARM: UART: clear pending irqs before enabling irqs TTY: 8250, deprecated 8250_core.* options TTY: 8250, revert module name change serial: 8250_pci: Add WCH CH352 quirk to avoid Xscale detection tty: atmel_serial_probe(): index of atmel_ports[] fix
2 parents 865752e + 855f6fd commit 045ecc2

File tree

6 files changed

+45
-12
lines changed

6 files changed

+45
-12
lines changed
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3418,6 +3418,7 @@ MODULE_PARM_DESC(probe_rsa, "Probe I/O ports for RSA");
34183418
#endif
34193419
MODULE_ALIAS_CHARDEV_MAJOR(TTY_MAJOR);
34203420

3421+
#ifdef CONFIG_SERIAL_8250_DEPRECATED_OPTIONS
34213422
#ifndef MODULE
34223423
/* This module was renamed to 8250_core in 3.7. Keep the old "8250" name
34233424
* working as well for the module options so we don't break people. We
@@ -3432,7 +3433,7 @@ MODULE_ALIAS_CHARDEV_MAJOR(TTY_MAJOR);
34323433
static void __used s8250_options(void)
34333434
{
34343435
#undef MODULE_PARAM_PREFIX
3435-
#define MODULE_PARAM_PREFIX "8250."
3436+
#define MODULE_PARAM_PREFIX "8250_core."
34363437

34373438
module_param_cb(share_irqs, &param_ops_uint, &share_irqs, 0644);
34383439
module_param_cb(nr_uarts, &param_ops_uint, &nr_uarts, 0644);
@@ -3444,5 +3445,6 @@ static void __used s8250_options(void)
34443445
#endif
34453446
}
34463447
#else
3447-
MODULE_ALIAS("8250");
3448+
MODULE_ALIAS("8250_core");
3449+
#endif
34483450
#endif

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,6 +1554,7 @@ pci_wch_ch353_setup(struct serial_private *priv,
15541554
#define PCI_DEVICE_ID_PLX_CRONYX_OMEGA 0xc001
15551555
#define PCI_DEVICE_ID_INTEL_PATSBURG_KT 0x1d3d
15561556
#define PCI_VENDOR_ID_WCH 0x4348
1557+
#define PCI_DEVICE_ID_WCH_CH352_2S 0x3253
15571558
#define PCI_DEVICE_ID_WCH_CH353_4S 0x3453
15581559
#define PCI_DEVICE_ID_WCH_CH353_2S1PF 0x5046
15591560
#define PCI_DEVICE_ID_WCH_CH353_2S1P 0x7053
@@ -2172,6 +2173,14 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
21722173
.subdevice = PCI_ANY_ID,
21732174
.setup = pci_wch_ch353_setup,
21742175
},
2176+
/* WCH CH352 2S card (16550 clone) */
2177+
{
2178+
.vendor = PCI_VENDOR_ID_WCH,
2179+
.device = PCI_DEVICE_ID_WCH_CH352_2S,
2180+
.subvendor = PCI_ANY_ID,
2181+
.subdevice = PCI_ANY_ID,
2182+
.setup = pci_wch_ch353_setup,
2183+
},
21752184
/*
21762185
* ASIX devices with FIFO bug
21772186
*/
@@ -4870,6 +4879,10 @@ static struct pci_device_id serial_pci_tbl[] = {
48704879
PCI_ANY_ID, PCI_ANY_ID,
48714880
0, 0, pbn_b0_bt_2_115200 },
48724881

4882+
{ PCI_VENDOR_ID_WCH, PCI_DEVICE_ID_WCH_CH352_2S,
4883+
PCI_ANY_ID, PCI_ANY_ID,
4884+
0, 0, pbn_b0_bt_2_115200 },
4885+
48734886
/*
48744887
* Commtech, Inc. Fastcom adapters
48754888
*/

drivers/tty/serial/8250/Kconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,23 @@ config SERIAL_8250
3333
Most people will say Y or M here, so that they can use serial mice,
3434
modems and similar devices connecting to the standard serial ports.
3535

36+
config SERIAL_8250_DEPRECATED_OPTIONS
37+
bool "Support 8250_core.* kernel options (DEPRECATED)"
38+
depends on SERIAL_8250
39+
default y
40+
---help---
41+
In 3.7 we renamed 8250 to 8250_core by mistake, so now we have to
42+
accept kernel parameters in both forms like 8250_core.nr_uarts=4 and
43+
8250.nr_uarts=4. We now renamed the module back to 8250, but if
44+
anybody noticed in 3.7 and changed their userspace we still have to
45+
keep the 8350_core.* options around until they revert the changes
46+
they already did.
47+
48+
If 8250 is built as a module, this adds 8250_core alias instead.
49+
50+
If you did not notice yet and/or you have userspace from pre-3.7, it
51+
is safe (and recommended) to say N here.
52+
3653
config SERIAL_8250_PNP
3754
bool "8250/16550 PNP device support" if EXPERT
3855
depends on SERIAL_8250 && PNP

drivers/tty/serial/8250/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# Makefile for the 8250 serial device drivers.
33
#
44

5-
obj-$(CONFIG_SERIAL_8250) += 8250_core.o
6-
8250_core-y := 8250.o
7-
8250_core-$(CONFIG_SERIAL_8250_PNP) += 8250_pnp.o
8-
8250_core-$(CONFIG_SERIAL_8250_DMA) += 8250_dma.o
5+
obj-$(CONFIG_SERIAL_8250) += 8250.o
6+
8250-y := 8250_core.o
7+
8250-$(CONFIG_SERIAL_8250_PNP) += 8250_pnp.o
8+
8250-$(CONFIG_SERIAL_8250_DMA) += 8250_dma.o
99
obj-$(CONFIG_SERIAL_8250_GSC) += 8250_gsc.o
1010
obj-$(CONFIG_SERIAL_8250_PCI) += 8250_pci.o
1111
obj-$(CONFIG_SERIAL_8250_HP300) += 8250_hp300.o

drivers/tty/serial/atmel_serial.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ struct atmel_uart_port {
158158
};
159159

160160
static struct atmel_uart_port atmel_ports[ATMEL_MAX_UART];
161-
static unsigned long atmel_ports_in_use;
161+
static DECLARE_BITMAP(atmel_ports_in_use, ATMEL_MAX_UART);
162162

163163
#ifdef SUPPORT_SYSRQ
164164
static struct console atmel_console;
@@ -1769,15 +1769,14 @@ static int atmel_serial_probe(struct platform_device *pdev)
17691769
if (ret < 0)
17701770
/* port id not found in platform data nor device-tree aliases:
17711771
* auto-enumerate it */
1772-
ret = find_first_zero_bit(&atmel_ports_in_use,
1773-
sizeof(atmel_ports_in_use));
1772+
ret = find_first_zero_bit(atmel_ports_in_use, ATMEL_MAX_UART);
17741773

1775-
if (ret > ATMEL_MAX_UART) {
1774+
if (ret >= ATMEL_MAX_UART) {
17761775
ret = -ENODEV;
17771776
goto err;
17781777
}
17791778

1780-
if (test_and_set_bit(ret, &atmel_ports_in_use)) {
1779+
if (test_and_set_bit(ret, atmel_ports_in_use)) {
17811780
/* port already in use */
17821781
ret = -EBUSY;
17831782
goto err;
@@ -1857,7 +1856,7 @@ static int atmel_serial_remove(struct platform_device *pdev)
18571856

18581857
/* "port" is allocated statically, so we shouldn't free it */
18591858

1860-
clear_bit(port->line, &atmel_ports_in_use);
1859+
clear_bit(port->line, atmel_ports_in_use);
18611860

18621861
clk_put(atmel_port->clk);
18631862

drivers/tty/serial/xilinx_uartps.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,8 @@ static int xuartps_startup(struct uart_port *port)
578578
/* Receive Timeout register is enabled with value of 10 */
579579
xuartps_writel(10, XUARTPS_RXTOUT_OFFSET);
580580

581+
/* Clear out any pending interrupts before enabling them */
582+
xuartps_writel(xuartps_readl(XUARTPS_ISR_OFFSET), XUARTPS_ISR_OFFSET);
581583

582584
/* Set the Interrupt Registers with desired interrupts */
583585
xuartps_writel(XUARTPS_IXR_TXEMPTY | XUARTPS_IXR_PARITY |

0 commit comments

Comments
 (0)