Skip to content

Commit f4f9c1a

Browse files
committed
Merge tag 'tty-3.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty and serial fixes from Greg KH: "Here are some tty and serial fixes for 3.4-rc2. Most important here is the pl011 fix, which has been reported by about 100 different people, which means more people use it than I expected :) There are also some 8250 driver reverts due to some problems reported by them. And other minor fixes as well. Signed-off-by: Greg Kroah-Hartman <[email protected]>" * tag 'tty-3.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: pch_uart: Add Kontron COMe-mTT10 uart clock quirk pch_uart: Fix MSI setting issue serial/8250_pci: add a "force background timer" flag and use it for the "kt" serial port Revert "serial/8250_pci: setup-quirk workaround for the kt serial controller" Revert "serial/8250_pci: init-quirk msi support for kt serial controller" tty/serial/omap: console can only be built-in serial: samsung: fix omission initialize ulcon in reset port fn() printk(): add KERN_CONT where needed in hpet and vt code tty/serial: atmel_serial: fix RS485 half-duplex problem tty: serial: altera_uart: Check for NULL platform_data in probe. isdn/gigaset: use gig_dbg() for debugging output omap-serial: Fix the error handling in the omap_serial probe serial: PL011: move interrupt clearing
2 parents 3dbc35a + 11bbd5b commit f4f9c1a

File tree

13 files changed

+52
-57
lines changed

13 files changed

+52
-57
lines changed

drivers/char/hpet.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -906,8 +906,8 @@ int hpet_alloc(struct hpet_data *hdp)
906906
hpetp->hp_which, hdp->hd_phys_address,
907907
hpetp->hp_ntimer > 1 ? "s" : "");
908908
for (i = 0; i < hpetp->hp_ntimer; i++)
909-
printk("%s %d", i > 0 ? "," : "", hdp->hd_irq[i]);
910-
printk("\n");
909+
printk(KERN_CONT "%s %d", i > 0 ? "," : "", hdp->hd_irq[i]);
910+
printk(KERN_CONT "\n");
911911

912912
temp = hpetp->hp_tick_freq;
913913
remainder = do_div(temp, 1000000);

drivers/isdn/gigaset/interface.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ static void if_close(struct tty_struct *tty, struct file *filp)
176176
struct cardstate *cs = tty->driver_data;
177177

178178
if (!cs) { /* happens if we didn't find cs in open */
179-
printk(KERN_DEBUG "%s: no cardstate\n", __func__);
179+
gig_dbg(DEBUG_IF, "%s: no cardstate", __func__);
180180
return;
181181
}
182182

drivers/tty/serial/8250/8250.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,13 +1572,11 @@ static irqreturn_t serial8250_interrupt(int irq, void *dev_id)
15721572
do {
15731573
struct uart_8250_port *up;
15741574
struct uart_port *port;
1575-
bool skip;
15761575

15771576
up = list_entry(l, struct uart_8250_port, list);
15781577
port = &up->port;
1579-
skip = pass_counter && up->port.flags & UPF_IIR_ONCE;
15801578

1581-
if (!skip && port->handle_irq(port)) {
1579+
if (port->handle_irq(port)) {
15821580
handled = 1;
15831581
end = NULL;
15841582
} else if (end == NULL)
@@ -2037,10 +2035,12 @@ static int serial8250_startup(struct uart_port *port)
20372035
spin_unlock_irqrestore(&port->lock, flags);
20382036

20392037
/*
2040-
* If the interrupt is not reasserted, setup a timer to
2041-
* kick the UART on a regular basis.
2038+
* If the interrupt is not reasserted, or we otherwise
2039+
* don't trust the iir, setup a timer to kick the UART
2040+
* on a regular basis.
20422041
*/
2043-
if (!(iir1 & UART_IIR_NO_INT) && (iir & UART_IIR_NO_INT)) {
2042+
if ((!(iir1 & UART_IIR_NO_INT) && (iir & UART_IIR_NO_INT)) ||
2043+
up->port.flags & UPF_BUG_THRE) {
20442044
up->bugs |= UART_BUG_THRE;
20452045
pr_debug("ttyS%d - using backup timer\n",
20462046
serial_index(port));

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

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ static int kt_serial_setup(struct serial_private *priv,
10961096
const struct pciserial_board *board,
10971097
struct uart_port *port, int idx)
10981098
{
1099-
port->flags |= UPF_IIR_ONCE;
1099+
port->flags |= UPF_BUG_THRE;
11001100
return skip_tx_en_setup(priv, board, port, idx);
11011101
}
11021102

@@ -1118,18 +1118,6 @@ pci_xr17c154_setup(struct serial_private *priv,
11181118
return pci_default_setup(priv, board, port, idx);
11191119
}
11201120

1121-
static int try_enable_msi(struct pci_dev *dev)
1122-
{
1123-
/* use msi if available, but fallback to legacy otherwise */
1124-
pci_enable_msi(dev);
1125-
return 0;
1126-
}
1127-
1128-
static void disable_msi(struct pci_dev *dev)
1129-
{
1130-
pci_disable_msi(dev);
1131-
}
1132-
11331121
#define PCI_VENDOR_ID_SBSMODULARIO 0x124B
11341122
#define PCI_SUBVENDOR_ID_SBSMODULARIO 0x124B
11351123
#define PCI_DEVICE_ID_OCTPRO 0x0001
@@ -1249,9 +1237,7 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
12491237
.device = PCI_DEVICE_ID_INTEL_PATSBURG_KT,
12501238
.subvendor = PCI_ANY_ID,
12511239
.subdevice = PCI_ANY_ID,
1252-
.init = try_enable_msi,
12531240
.setup = kt_serial_setup,
1254-
.exit = disable_msi,
12551241
},
12561242
/*
12571243
* ITE

drivers/tty/serial/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ config SERIAL_OMAP
10411041

10421042
config SERIAL_OMAP_CONSOLE
10431043
bool "Console on OMAP serial port"
1044-
depends on SERIAL_OMAP
1044+
depends on SERIAL_OMAP=y
10451045
select SERIAL_CORE_CONSOLE
10461046
help
10471047
Select this option if you would like to use omap serial port as

drivers/tty/serial/altera_uart.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,15 +556,15 @@ static int __devinit altera_uart_probe(struct platform_device *pdev)
556556
res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
557557
if (res_mem)
558558
port->mapbase = res_mem->start;
559-
else if (platp->mapbase)
559+
else if (platp)
560560
port->mapbase = platp->mapbase;
561561
else
562562
return -EINVAL;
563563

564564
res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
565565
if (res_irq)
566566
port->irq = res_irq->start;
567-
else if (platp->irq)
567+
else if (platp)
568568
port->irq = platp->irq;
569569

570570
/* Check platform data first so we can override device node data */

drivers/tty/serial/amba-pl011.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,10 +1946,6 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
19461946
goto unmap;
19471947
}
19481948

1949-
/* Ensure interrupts from this UART are masked and cleared */
1950-
writew(0, uap->port.membase + UART011_IMSC);
1951-
writew(0xffff, uap->port.membase + UART011_ICR);
1952-
19531949
uap->vendor = vendor;
19541950
uap->lcrh_rx = vendor->lcrh_rx;
19551951
uap->lcrh_tx = vendor->lcrh_tx;
@@ -1967,6 +1963,10 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
19671963
uap->port.line = i;
19681964
pl011_dma_probe(uap);
19691965

1966+
/* Ensure interrupts from this UART are masked and cleared */
1967+
writew(0, uap->port.membase + UART011_IMSC);
1968+
writew(0xffff, uap->port.membase + UART011_ICR);
1969+
19701970
snprintf(uap->type, sizeof(uap->type), "PL011 rev%u", amba_rev(dev));
19711971

19721972
amba_ports[i] = uap;

drivers/tty/serial/atmel_serial.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,8 @@ static void atmel_start_rx(struct uart_port *port)
389389
{
390390
UART_PUT_CR(port, ATMEL_US_RSTSTA); /* reset status and receiver */
391391

392+
UART_PUT_CR(port, ATMEL_US_RXEN);
393+
392394
if (atmel_use_dma_rx(port)) {
393395
/* enable PDC controller */
394396
UART_PUT_IER(port, ATMEL_US_ENDRX | ATMEL_US_TIMEOUT |
@@ -404,6 +406,8 @@ static void atmel_start_rx(struct uart_port *port)
404406
*/
405407
static void atmel_stop_rx(struct uart_port *port)
406408
{
409+
UART_PUT_CR(port, ATMEL_US_RXDIS);
410+
407411
if (atmel_use_dma_rx(port)) {
408412
/* disable PDC receive */
409413
UART_PUT_PTCR(port, ATMEL_PDC_RXTDIS);

drivers/tty/serial/omap-serial.c

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,29 +1381,24 @@ static int serial_omap_probe(struct platform_device *pdev)
13811381
return -ENODEV;
13821382
}
13831383

1384-
if (!request_mem_region(mem->start, resource_size(mem),
1384+
if (!devm_request_mem_region(&pdev->dev, mem->start, resource_size(mem),
13851385
pdev->dev.driver->name)) {
13861386
dev_err(&pdev->dev, "memory region already claimed\n");
13871387
return -EBUSY;
13881388
}
13891389

13901390
dma_rx = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
1391-
if (!dma_rx) {
1392-
ret = -EINVAL;
1393-
goto err;
1394-
}
1391+
if (!dma_rx)
1392+
return -ENXIO;
13951393

13961394
dma_tx = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
1397-
if (!dma_tx) {
1398-
ret = -EINVAL;
1399-
goto err;
1400-
}
1395+
if (!dma_tx)
1396+
return -ENXIO;
1397+
1398+
up = devm_kzalloc(&pdev->dev, sizeof(*up), GFP_KERNEL);
1399+
if (!up)
1400+
return -ENOMEM;
14011401

1402-
up = kzalloc(sizeof(*up), GFP_KERNEL);
1403-
if (up == NULL) {
1404-
ret = -ENOMEM;
1405-
goto do_release_region;
1406-
}
14071402
up->pdev = pdev;
14081403
up->port.dev = &pdev->dev;
14091404
up->port.type = PORT_OMAP;
@@ -1423,16 +1418,17 @@ static int serial_omap_probe(struct platform_device *pdev)
14231418
dev_err(&pdev->dev, "failed to get alias/pdev id, errno %d\n",
14241419
up->port.line);
14251420
ret = -ENODEV;
1426-
goto err;
1421+
goto err_port_line;
14271422
}
14281423

14291424
sprintf(up->name, "OMAP UART%d", up->port.line);
14301425
up->port.mapbase = mem->start;
1431-
up->port.membase = ioremap(mem->start, resource_size(mem));
1426+
up->port.membase = devm_ioremap(&pdev->dev, mem->start,
1427+
resource_size(mem));
14321428
if (!up->port.membase) {
14331429
dev_err(&pdev->dev, "can't ioremap UART\n");
14341430
ret = -ENOMEM;
1435-
goto err;
1431+
goto err_ioremap;
14361432
}
14371433

14381434
up->port.flags = omap_up_info->flags;
@@ -1478,16 +1474,19 @@ static int serial_omap_probe(struct platform_device *pdev)
14781474

14791475
ret = uart_add_one_port(&serial_omap_reg, &up->port);
14801476
if (ret != 0)
1481-
goto do_release_region;
1477+
goto err_add_port;
14821478

14831479
pm_runtime_put(&pdev->dev);
14841480
platform_set_drvdata(pdev, up);
14851481
return 0;
1486-
err:
1482+
1483+
err_add_port:
1484+
pm_runtime_put(&pdev->dev);
1485+
pm_runtime_disable(&pdev->dev);
1486+
err_ioremap:
1487+
err_port_line:
14871488
dev_err(&pdev->dev, "[UART%d]: failure [%s]: %d\n",
14881489
pdev->id, __func__, ret);
1489-
do_release_region:
1490-
release_mem_region(mem->start, resource_size(mem));
14911490
return ret;
14921491
}
14931492

@@ -1499,8 +1498,6 @@ static int serial_omap_remove(struct platform_device *dev)
14991498
pm_runtime_disable(&up->pdev->dev);
15001499
uart_remove_one_port(&serial_omap_reg, &up->port);
15011500
pm_qos_remove_request(&up->pm_qos_request);
1502-
1503-
kfree(up);
15041501
}
15051502

15061503
platform_set_drvdata(dev, NULL);

drivers/tty/serial/pch_uart.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ enum {
210210
#define CMITC_UARTCLK 192000000 /* 192.0000 MHz */
211211
#define FRI2_64_UARTCLK 64000000 /* 64.0000 MHz */
212212
#define FRI2_48_UARTCLK 48000000 /* 48.0000 MHz */
213+
#define NTC1_UARTCLK 64000000 /* 64.0000 MHz */
213214

214215
struct pch_uart_buffer {
215216
unsigned char *buf;
@@ -384,6 +385,12 @@ static int pch_uart_get_uartclk(void)
384385
if (cmp && strstr(cmp, "Fish River Island II"))
385386
return FRI2_48_UARTCLK;
386387

388+
/* Kontron COMe-mTT10 (nanoETXexpress-TT) */
389+
cmp = dmi_get_system_info(DMI_BOARD_NAME);
390+
if (cmp && (strstr(cmp, "COMe-mTT") ||
391+
strstr(cmp, "nanoETXexpress-TT")))
392+
return NTC1_UARTCLK;
393+
387394
return DEFAULT_UARTCLK;
388395
}
389396

@@ -1651,6 +1658,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
16511658
}
16521659

16531660
pci_enable_msi(pdev);
1661+
pci_set_master(pdev);
16541662

16551663
iobase = pci_resource_start(pdev, 0);
16561664
mapbase = pci_resource_start(pdev, 1);

drivers/tty/serial/samsung.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,7 @@ static void s3c24xx_serial_resetport(struct uart_port *port,
982982

983983
ucon &= ucon_mask;
984984
wr_regl(port, S3C2410_UCON, ucon | cfg->ucon);
985+
wr_regl(port, S3C2410_ULCON, cfg->ulcon);
985986

986987
/* reset both fifos */
987988
wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH);

drivers/tty/vt/vt.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2932,11 +2932,10 @@ static int __init con_init(void)
29322932
gotoxy(vc, vc->vc_x, vc->vc_y);
29332933
csi_J(vc, 0);
29342934
update_screen(vc);
2935-
pr_info("Console: %s %s %dx%d",
2935+
pr_info("Console: %s %s %dx%d\n",
29362936
vc->vc_can_do_color ? "colour" : "mono",
29372937
display_desc, vc->vc_cols, vc->vc_rows);
29382938
printable = 1;
2939-
printk("\n");
29402939

29412940
console_unlock();
29422941

include/linux/serial_core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ struct uart_port {
357357
#define UPF_CONS_FLOW ((__force upf_t) (1 << 23))
358358
#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24))
359359
#define UPF_EXAR_EFR ((__force upf_t) (1 << 25))
360-
#define UPF_IIR_ONCE ((__force upf_t) (1 << 26))
360+
#define UPF_BUG_THRE ((__force upf_t) (1 << 26))
361361
/* The exact UART type is known and should not be probed. */
362362
#define UPF_FIXED_TYPE ((__force upf_t) (1 << 27))
363363
#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28))

0 commit comments

Comments
 (0)