Skip to content

Commit 495fb8d

Browse files
committed
Merge tag 'tty-7.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial driver fixes from Greg KH: "Here are some small serial driver fixes for 7.1-rc6. Included in here are: - mips serial driver fixes to resolve some long-standing issues with how they interacted with the console. That's the "majority" of the changes in this merge request - sh-sci driver regression fix - 8250 driver regression fixes - other small serial driver fixes for reported problems. All of these have been in linux-next for over a week with no reported issues" * tag 'tty-7.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: serial: dz: Enable modular build serial: zs: Convert to use a platform device serial: dz: Convert to use a platform device serial: zs: Switch to using channel reset serial: zs: Fix bootconsole handover lockup serial: dz: Fix bootconsole handover lockup serial: dz: Fix bootconsole message clobbering at chip reset serial: 8250_dw: dispatch SysRq character in dw8250_handle_irq() serial: 8250: dispatch SysRq character in serial8250_handle_irq() serial: core: introduce guard(uart_port_lock_check_sysrq_irqsave) tty: serial: samsung: Remove redundant port lock acquisition in rx helpers serial: altera_jtaguart: handle uart_add_one_port() failures serial: qcom_geni: fix kfifo underflow when flush precedes DMA completion IRQ serial: fsl_lpuart: fix rx buffer and DMA map leaks in start_rx_dma tty: add missing tty_driver include to tty_port.h serial: qcom-geni: fix UART_RX_PAR_EN bit position serial: sh-sci: fix memory region release in error path tty: serial: pch_uart: add check for dma_alloc_coherent() serial: zs: Fix swapped RI/DSR modem line transition counting
2 parents 2544785 + e4240d8 commit 495fb8d

15 files changed

Lines changed: 345 additions & 254 deletions

File tree

arch/mips/dec/platform.c

Lines changed: 108 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
#include <linux/mc146818rtc.h>
1111
#include <linux/platform_device.h>
1212

13+
#include <asm/bootinfo.h>
14+
15+
#include <asm/dec/interrupts.h>
16+
#include <asm/dec/ioasic_addrs.h>
17+
#include <asm/dec/kn01.h>
18+
#include <asm/dec/kn02.h>
19+
#include <asm/dec/system.h>
20+
1321
static struct resource dec_rtc_resources[] = {
1422
{
1523
.name = "rtc",
@@ -30,11 +38,110 @@ static struct platform_device dec_rtc_device = {
3038
.num_resources = ARRAY_SIZE(dec_rtc_resources),
3139
};
3240

41+
static struct resource dec_dz_resources[] = {
42+
{ .name = "dz", .flags = IORESOURCE_MEM, },
43+
{ .name = "dz", .flags = IORESOURCE_IRQ, },
44+
};
45+
46+
static struct platform_device dec_dz_device = {
47+
.name = "dz",
48+
.id = PLATFORM_DEVID_NONE,
49+
.resource = dec_dz_resources,
50+
.num_resources = ARRAY_SIZE(dec_dz_resources),
51+
};
52+
53+
static struct platform_device *dec_dz_devices[] __initdata = {
54+
&dec_dz_device,
55+
};
56+
57+
static struct resource dec_zs_resources[][2] = {
58+
{
59+
{ .name = "scc0", .flags = IORESOURCE_MEM, },
60+
{ .name = "scc0", .flags = IORESOURCE_IRQ, },
61+
},
62+
{
63+
{ .name = "scc1", .flags = IORESOURCE_MEM, },
64+
{ .name = "scc1", .flags = IORESOURCE_IRQ, },
65+
},
66+
};
67+
68+
static struct platform_device dec_zs_device[] = {
69+
{
70+
.name = "zs",
71+
.id = 0,
72+
.resource = dec_zs_resources[0],
73+
.num_resources = ARRAY_SIZE(dec_zs_resources[0]),
74+
},
75+
{
76+
.name = "zs",
77+
.id = 1,
78+
.resource = dec_zs_resources[1],
79+
.num_resources = ARRAY_SIZE(dec_zs_resources[1]),
80+
},
81+
};
82+
3383
static int __init dec_add_devices(void)
3484
{
85+
struct platform_device *dec_zs_devices[ARRAY_SIZE(dec_zs_device)];
86+
int ret1, ret2, ret3;
87+
int num_dz, num_zs;
88+
int irq, i;
89+
3590
dec_rtc_resources[0].start = RTC_PORT(0);
3691
dec_rtc_resources[0].end = RTC_PORT(0) + dec_kn_slot_size - 1;
37-
return platform_device_register(&dec_rtc_device);
92+
93+
i = 0;
94+
irq = dec_interrupt[DEC_IRQ_DZ11];
95+
if (IS_ENABLED(CONFIG_32BIT) && irq >= 0) {
96+
resource_size_t base;
97+
98+
switch (mips_machtype) {
99+
case MACH_DS23100:
100+
case MACH_DS5100:
101+
base = dec_kn_slot_base + KN01_DZ11;
102+
break;
103+
default:
104+
base = dec_kn_slot_base + KN02_DZ11;
105+
break;
106+
}
107+
dec_dz_device.resource[0].start = base;
108+
dec_dz_device.resource[0].end = base + dec_kn_slot_size - 1;
109+
dec_dz_device.resource[1].start = irq;
110+
dec_dz_device.resource[1].end = irq;
111+
i++;
112+
}
113+
num_dz = i;
114+
115+
i = 0;
116+
irq = dec_interrupt[DEC_IRQ_SCC0];
117+
if (irq >= 0) {
118+
resource_size_t base = dec_kn_slot_base + IOASIC_SCC0;
119+
120+
dec_zs_device[i].resource[0].start = base;
121+
dec_zs_device[i].resource[0].end = base + dec_kn_slot_size - 1;
122+
dec_zs_device[i].resource[1].start = irq;
123+
dec_zs_device[i].resource[1].end = irq;
124+
dec_zs_devices[i] = &dec_zs_device[i];
125+
i++;
126+
}
127+
irq = dec_interrupt[DEC_IRQ_SCC1];
128+
if (irq >= 0) {
129+
resource_size_t base = dec_kn_slot_base + IOASIC_SCC1;
130+
131+
dec_zs_device[i].resource[0].start = base;
132+
dec_zs_device[i].resource[0].end = base + dec_kn_slot_size - 1;
133+
dec_zs_device[i].resource[1].start = irq;
134+
dec_zs_device[i].resource[1].end = irq;
135+
dec_zs_devices[i] = &dec_zs_device[i];
136+
i++;
137+
}
138+
num_zs = i;
139+
140+
ret1 = platform_device_register(&dec_rtc_device);
141+
ret2 = IS_ENABLED(CONFIG_32BIT) ?
142+
platform_add_devices(dec_dz_devices, num_dz) : 0;
143+
ret3 = platform_add_devices(dec_zs_devices, num_zs);
144+
return ret1 ? ret1 : ret2 ? ret2 : ret3;
38145
}
39146

40147
device_initcall(dec_add_devices);

drivers/tty/serial/8250/8250_dw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ static int dw8250_handle_irq(struct uart_port *p)
427427
unsigned int quirks = d->pdata->quirks;
428428
unsigned int status;
429429

430-
guard(uart_port_lock_irqsave)(p);
430+
guard(uart_port_lock_check_sysrq_irqsave)(p);
431431

432432
switch (FIELD_GET(DW_UART_IIR_IID, iir)) {
433433
case UART_IIR_NO_INT:

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,7 +1784,10 @@ static bool handle_rx_dma(struct uart_8250_port *up, unsigned int iir)
17841784
}
17851785

17861786
/*
1787-
* Context: port's lock must be held by the caller.
1787+
* Context: port's lock must be held by the caller. The caller must
1788+
* release it via guard(uart_port_lock_check_sysrq_irqsave) or
1789+
* uart_unlock_and_check_sysrq_irqrestore(), which captures SysRq
1790+
* character on unlock.
17881791
*/
17891792
void serial8250_handle_irq_locked(struct uart_port *port, unsigned int iir)
17901793
{
@@ -1837,7 +1840,7 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir)
18371840
if (iir & UART_IIR_NO_INT)
18381841
return 0;
18391842

1840-
guard(uart_port_lock_irqsave)(port);
1843+
guard(uart_port_lock_check_sysrq_irqsave)(port);
18411844
serial8250_handle_irq_locked(port, iir);
18421845

18431846
return 1;

drivers/tty/serial/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ config SERIAL_MAX310X
334334
Say Y here if you want to support this ICs.
335335

336336
config SERIAL_DZ
337-
bool "DECstation DZ serial driver"
337+
tristate "DECstation DZ serial driver"
338338
depends on MACH_DECSTATION && 32BIT
339339
select SERIAL_CORE
340340
default y

drivers/tty/serial/altera_jtaguart.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ static int altera_jtaguart_probe(struct platform_device *pdev)
379379
struct resource *res_mem;
380380
int i = pdev->id;
381381
int irq;
382+
int ret;
382383

383384
/* -1 emphasizes that the platform must have one port, no .N suffix */
384385
if (i == -1)
@@ -418,7 +419,11 @@ static int altera_jtaguart_probe(struct platform_device *pdev)
418419
port->flags = UPF_BOOT_AUTOCONF;
419420
port->dev = &pdev->dev;
420421

421-
uart_add_one_port(&altera_jtaguart_driver, port);
422+
ret = uart_add_one_port(&altera_jtaguart_driver, port);
423+
if (ret) {
424+
iounmap(port->membase);
425+
return ret;
426+
}
422427

423428
return 0;
424429
}

0 commit comments

Comments
 (0)