2009-03-24 14:01:43

by Alan

[permalink] [raw]
Subject: [PATCH 00/30] Serial and tty for 2.6.30

This is mostly consolidation work and in part reflects the fact I've been
between jobs relaxing. There are quite a few niggling little bug fixes here
that will probably become candidates for 2.6.29.foo

Alan


---

Alan Cox (2):
ucc: Fix leaky error path
isicom: isicom kref leak fix

Alexander Beregalov (1):
mux: fix build problem

Breno Leitao (3):
icom: remove unused variables
jsm: define init function as __devinit
jsm: Fix the return variable and removing the unused retval.

Clark Williams (1):
disallow SERIAL_8250_PNP with SERIAL_8250_CONSOLE

Danny Kukawka (1):
8250_pnp.c: add another Wacom tablet

Graf Yang (2):
blackfin: Subtract ANOMALY_05000230 on quot
Use barrier instead of cpu_relax for early blackfin boot

Jiri Slaby (3):
mxser: remove tty_port_tty_get from mxser_check_modem_status
tty: moxa, fix refcounting in moxa_poll_port
PCI: quirks, don't mark one netmos as class other

Kay Sievers (1):
vcs: hook sysfs devices into object lifetime instead of "binding"

Matthew Garrett (1):
serial: Update PNP IDs

Michael Hennerich (1):
blackfin: BF538/9 serial uart support

Mike Frysinger (2):
blackfin: Use unsigned long for flags with irq functions
blackfin: Explain why we cannot cpu_relax() in early serial code

Roel Kluin (1):
rio: addition has higher precedence than ?:

Scott James Remnant (5):
riscom8: Auto-load riscom8 module when device opened.
usb: Auto-load cdc_acm module when device opened.
specialix: Auto-load specialix module when device opened.
cyclades: Auto-load cyclades module when device opened.
applicom: Auto-load applicom module when device opened.

Shawn Bohrer (1):
8250_pci: add support for National Instruments 843x RS232 devices

Sonic Zhang (2):
Fix DMA rx ring buffer handling
blackfin: Fix tty compile error in PIO mode

Sukadev Bhattiprolu (1):
devpts: must release s_umount on error

Xiaotian Feng (1):
cpm_uart: fix non-console port startup bug


drivers/char/applicom.c | 1
drivers/char/cyclades.c | 2
drivers/char/isicom.c | 1
drivers/char/moxa.c | 9 -
drivers/char/mxser.c | 1
drivers/char/rio/rio_linux.c | 2
drivers/char/riscom8.c | 2
drivers/char/specialix.c | 1
drivers/char/vc_screen.c | 16 +
drivers/char/vt.c | 5
drivers/pci/quirks.c | 6
drivers/serial/8250_pci.c | 411 +++++++++++++++++++++++++++++++
drivers/serial/8250_pnp.c | 7 -
drivers/serial/Kconfig | 4
drivers/serial/bfin_5xx.c | 22 +-
drivers/serial/cpm_uart/cpm_uart_core.c | 14 +
drivers/serial/icom.c | 14 -
drivers/serial/jsm/jsm_driver.c | 9 -
drivers/serial/jsm/jsm_tty.c | 4
drivers/serial/ucc_uart.c | 1
drivers/usb/class/cdc-acm.c | 2
fs/devpts/inode.c | 2
include/linux/console.h | 4
include/linux/pci_ids.h | 26 ++
include/linux/serial_core.h | 2
25 files changed, 516 insertions(+), 52 deletions(-)

--


2009-03-24 14:02:28

by Alan

[permalink] [raw]
Subject: [PATCH 02/30] 8250_pnp.c: add another Wacom tablet

From: Danny Kukawka <[email protected]>

Add another serial Wacom tablet with pnp_id: WACF009.

Signed-off-by: Danny Kukawka <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
--
8250_pnp.c | 1 +
1 file changed, 1 insertion(+)
---

drivers/serial/8250_pnp.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)


diff --git a/drivers/serial/8250_pnp.c b/drivers/serial/8250_pnp.c
index bbcfc26..6db9f13 100644
--- a/drivers/serial/8250_pnp.c
+++ b/drivers/serial/8250_pnp.c
@@ -333,6 +333,7 @@ static const struct pnp_device_id pnp_dev_table[] = {
{ "WACF006", 0 },
{ "WACF007", 0 },
{ "WACF008", 0 },
+ { "WACF009", 0 },
/* Compaq touchscreen */
{ "FPI2002", 0 },
/* Fujitsu Stylistic touchscreens */

2009-03-24 14:01:57

by Alan

[permalink] [raw]
Subject: [PATCH 01/30] disallow SERIAL_8250_PNP with SERIAL_8250_CONSOLE

From: Clark Williams <[email protected]>

There are known (but hard to fix issues) with using SERIAL_8250_PNP with
SERIAL_8250_CONSOLE. This patch just sidesteps that by not allowing PNP
when CONSOLE is selected.

Signed-off-by: Clark Williams <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

drivers/serial/Kconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 7d7f576..451b64f 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -91,7 +91,7 @@ config SERIAL_8250_PCI

config SERIAL_8250_PNP
tristate "8250/16550 PNP device support" if EMBEDDED
- depends on SERIAL_8250 && PNP
+ depends on SERIAL_8250 && PNP && ! SERIAL_8250_CONSOLE
default SERIAL_8250
help
This builds standard PNP serial support. You may be able to

2009-03-24 14:02:44

by Alan

[permalink] [raw]
Subject: [PATCH 03/30] serial: Update PNP IDs

From: Matthew Garrett <[email protected]>

Add new Wacom device IDs to the 8250_pnp serial driver, to support
autoconfig on some newer tablet PCs. Also add a comment to clarify that
the FUJ02E6 device is a custom protocol, not a Wacom tablet.

Signed-off-by: Matthew Garrett <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

drivers/serial/8250_pnp.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)


diff --git a/drivers/serial/8250_pnp.c b/drivers/serial/8250_pnp.c
index 6db9f13..d71dfe3 100644
--- a/drivers/serial/8250_pnp.c
+++ b/drivers/serial/8250_pnp.c
@@ -334,6 +334,9 @@ static const struct pnp_device_id pnp_dev_table[] = {
{ "WACF007", 0 },
{ "WACF008", 0 },
{ "WACF009", 0 },
+ { "WACF00A", 0 },
+ { "WACF00B", 0 },
+ { "WACF00C", 0 },
/* Compaq touchscreen */
{ "FPI2002", 0 },
/* Fujitsu Stylistic touchscreens */
@@ -347,8 +350,9 @@ static const struct pnp_device_id pnp_dev_table[] = {
{ "FUJ02B8", 0 },
{ "FUJ02B9", 0 },
{ "FUJ02BC", 0 },
- /* Fujitsu Wacom Tablet PC devices */
+ /* Fujitsu Wacom Tablet PC device */
{ "FUJ02E5", 0 },
+ /* Fujitsu P-series tablet PC device */
{ "FUJ02E6", 0 },
/*
* LG C1 EXPRESS DUAL (C1-PB11A3) touch screen (actually a FUJ02E6 in

2009-03-24 14:03:13

by Alan

[permalink] [raw]
Subject: [PATCH 04/30] jsm: Fix the return variable and removing the unused retval.

From: Breno Leitao <[email protected]>

As it was, the retval was never returned, so its assignments were silly.
Just consolidate everything to rc, and remove the unused retval variable.

Signed-off-by: Breno Leitao <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

drivers/serial/jsm/jsm_driver.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)


diff --git a/drivers/serial/jsm/jsm_driver.c b/drivers/serial/jsm/jsm_driver.c
index ac79cbe..e8da2f9 100644
--- a/drivers/serial/jsm/jsm_driver.c
+++ b/drivers/serial/jsm/jsm_driver.c
@@ -57,7 +57,6 @@ static int jsm_probe_one(struct pci_dev *pdev, const struct pci_device_id *ent)
int rc = 0;
struct jsm_board *brd;
static int adapter_count = 0;
- int retval;

rc = pci_enable_device(pdev);
if (rc) {
@@ -134,7 +133,7 @@ static int jsm_probe_one(struct pci_dev *pdev, const struct pci_device_id *ent)
rc = jsm_tty_init(brd);
if (rc < 0) {
dev_err(&pdev->dev, "Can't init tty devices (%d)\n", rc);
- retval = -ENXIO;
+ rc = -ENXIO;
goto out_free_irq;
}

@@ -142,7 +141,7 @@ static int jsm_probe_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (rc < 0) {
/* XXX: leaking all resources from jsm_tty_init here! */
dev_err(&pdev->dev, "Can't init uart port (%d)\n", rc);
- retval = -ENXIO;
+ rc = -ENXIO;
goto out_free_irq;
}

@@ -161,7 +160,7 @@ static int jsm_probe_one(struct pci_dev *pdev, const struct pci_device_id *ent)
/* XXX: leaking all resources from jsm_tty_init and
jsm_uart_port_init here! */
dev_err(&pdev->dev, "memory allocation for flipbuf failed\n");
- retval = -ENOMEM;
+ rc = -ENOMEM;
goto out_free_irq;
}

2009-03-24 14:03:56

by Alan

[permalink] [raw]
Subject: [PATCH 05/30] PCI: quirks, don't mark one netmos as class other

From: Jiri Slaby <[email protected]>

Let it as serial, since it doesn't have subdevice in the form of 0x00PS.

Signed-off-by: Jiri Slaby <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

drivers/pci/quirks.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)


diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 92b9efe..5aa2afb 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -1664,9 +1664,13 @@ static void __devinit quirk_netmos(struct pci_dev *dev)
* of parallel ports and <S> is the number of serial ports.
*/
switch (dev->device) {
+ case PCI_DEVICE_ID_NETMOS_9835:
+ /* Well, this rule doesn't hold for the following 9835 device */
+ if (dev->subsystem_vendor == PCI_VENDOR_ID_IBM &&
+ dev->subsystem_device == 0x0299)
+ return;
case PCI_DEVICE_ID_NETMOS_9735:
case PCI_DEVICE_ID_NETMOS_9745:
- case PCI_DEVICE_ID_NETMOS_9835:
case PCI_DEVICE_ID_NETMOS_9845:
case PCI_DEVICE_ID_NETMOS_9855:
if ((dev->class >> 8) == PCI_CLASS_COMMUNICATION_SERIAL &&

2009-03-24 14:04:39

by Alan

[permalink] [raw]
Subject: [PATCH 06/30] devpts: must release s_umount on error

From: Sukadev Bhattiprolu <[email protected]>

We should drop the ->s_umount mutex if an error occurs after the
sget()/grab_super() call. This was introduced when adding support
for multiple instances of devpts and noticed during a code review/reorg.

Signed-off-by: Sukadev Bhattiprolu <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

fs/devpts/inode.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)


diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c
index bff4052..140b431 100644
--- a/fs/devpts/inode.c
+++ b/fs/devpts/inode.c
@@ -385,6 +385,7 @@ static int new_pts_mount(struct file_system_type *fs_type, int flags,

fail:
dput(mnt->mnt_sb->s_root);
+ up_write(&mnt->mnt_sb->s_umount);
deactivate_super(mnt->mnt_sb);
return err;
}
@@ -473,6 +474,7 @@ static int init_pts_mount(struct file_system_type *fs_type, int flags,
err = mknod_ptmx(mnt->mnt_sb);
if (err) {
dput(mnt->mnt_sb->s_root);
+ up_write(&mnt->mnt_sb->s_umount);
deactivate_super(mnt->mnt_sb);
}

2009-03-24 14:06:40

by Alan

[permalink] [raw]
Subject: [PATCH 09/30] blackfin: Explain why we cannot cpu_relax() in early serial code

From: Mike Frysinger <[email protected]>

Signed-off-by: Mike Frysinger <[email protected]>
Signed-off-by: Bryan Wu <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

drivers/serial/bfin_5xx.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)


diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c
index d46d764..c7c0c1b 100644
--- a/drivers/serial/bfin_5xx.c
+++ b/drivers/serial/bfin_5xx.c
@@ -1127,6 +1127,10 @@ static __init void early_serial_putc(struct uart_port *port, int ch)
unsigned timeout = 0xffff;
struct bfin_serial_port *uart = (struct bfin_serial_port *)port;

+ /* We cannot cpu_relax() here as doing so on the BF561 relies
+ * on the per-cpu region being setup, and since this is early
+ * serial code, it may not yet be usable ...
+ */
while ((!(UART_GET_LSR(uart) & THRE)) && --timeout)
barrier();

2009-03-24 14:06:08

by Alan

[permalink] [raw]
Subject: [PATCH 08/30] Use barrier instead of cpu_relax for early blackfin boot

From: Graf Yang <[email protected]>

We are making a SMP like patch to blackfin, cpu_relax() is replaced by a
data cache flush function which will count it to a per-cpu counter.
If this serial function is called too early, the per-cpu data area have
not been initialized, this call will cause crash.
So we'd like to use barrier() instead of cpu_relax().

Signed-off-by: Graf Yang <[email protected]>
Signed-off-by: Bryan Wu <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

drivers/serial/bfin_5xx.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c
index 318d69d..d46d764 100644
--- a/drivers/serial/bfin_5xx.c
+++ b/drivers/serial/bfin_5xx.c
@@ -1128,7 +1128,8 @@ static __init void early_serial_putc(struct uart_port *port, int ch)
struct bfin_serial_port *uart = (struct bfin_serial_port *)port;

while ((!(UART_GET_LSR(uart) & THRE)) && --timeout)
- cpu_relax();
+ barrier();
+
UART_PUT_CHAR(uart, ch);
}

2009-03-24 14:05:13

by Alan

[permalink] [raw]
Subject: [PATCH 07/30] cpm_uart: fix non-console port startup bug

From: Xiaotian Feng <[email protected]>

After UART interrupt handler is installed and rx is enabled, if an rx
interrupt comes before hardware init, rx->cur will be updated. Then the
hardware init will reset BD and make rx->cur out of sync, move the hardware
init code before request_irq.

Signed-off-by: Xiaotian Feng <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

drivers/serial/cpm_uart/cpm_uart_core.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)


diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c
index bde4b4b..5c6ef51 100644
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -406,6 +406,18 @@ static int cpm_uart_startup(struct uart_port *port)

pr_debug("CPM uart[%d]:startup\n", port->line);

+ /* If the port is not the console, make sure rx is disabled. */
+ if (!(pinfo->flags & FLAG_CONSOLE)) {
+ /* Disable UART rx */
+ if (IS_SMC(pinfo)) {
+ clrbits16(&pinfo->smcp->smc_smcmr, SMCMR_REN);
+ clrbits8(&pinfo->smcp->smc_smcm, SMCM_RX);
+ } else {
+ clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR);
+ clrbits16(&pinfo->sccp->scc_sccm, UART_SCCM_RX);
+ }
+ cpm_line_cr_cmd(pinfo, CPM_CR_INIT_TRX);
+ }
/* Install interrupt handler. */
retval = request_irq(port->irq, cpm_uart_int, 0, "cpm_uart", port);
if (retval)
@@ -420,8 +432,6 @@ static int cpm_uart_startup(struct uart_port *port)
setbits32(&pinfo->sccp->scc_gsmrl, (SCC_GSMRL_ENR | SCC_GSMRL_ENT));
}

- if (!(pinfo->flags & FLAG_CONSOLE))
- cpm_line_cr_cmd(pinfo, CPM_CR_INIT_TRX);
return 0;
}

2009-03-24 14:10:53

by Alan

[permalink] [raw]
Subject: [PATCH 19/30] riscom8: Auto-load riscom8 module when device opened.

From: Scott James Remnant <[email protected]>

The riscom8 module is missing the char-major-48-* alias that would cause
it to be auto-loaded when a device of that type is opened. This patch
adds the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

drivers/char/riscom8.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)


diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c
index 9af8d74..2176604 100644
--- a/drivers/char/riscom8.c
+++ b/drivers/char/riscom8.c
@@ -48,6 +48,7 @@
#include <linux/delay.h>
#include <linux/tty_flip.h>
#include <linux/spinlock.h>
+#include <linux/device.h>

#include <linux/uaccess.h>

@@ -1524,6 +1525,7 @@ module_param(iobase2, int, 0);
module_param(iobase3, int, 0);

MODULE_LICENSE("GPL");
+MODULE_ALIAS_CHARDEV_MAJOR(RISCOM8_NORMAL_MAJOR);
#endif /* MODULE */

/*

2009-03-24 14:12:54

by Alan

[permalink] [raw]
Subject: [PATCH 14/30] blackfin: Subtract ANOMALY_05000230 on quot

From: Graf Yang <[email protected]>

Fix bug - up arrow key works abnormal for bf561 ezkit board

Signed-off-by: Graf Yang <[email protected]>
Signed-off-by: Bryan Wu <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

drivers/serial/bfin_5xx.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c
index 371a62f..3ba5e78 100644
--- a/drivers/serial/bfin_5xx.c
+++ b/drivers/serial/bfin_5xx.c
@@ -760,7 +760,7 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios,
}

baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16);
- quot = uart_get_divisor(port, baud);
+ quot = uart_get_divisor(port, baud) - ANOMALY_05000230;
spin_lock_irqsave(&uart->port.lock, flags);

UART_SET_ANOMALY_THRESHOLD(uart, USEC_PER_SEC / baud * 15);

2009-03-24 14:08:41

by Alan

[permalink] [raw]
Subject: [PATCH 11/30] blackfin: Use unsigned long for flags with irq functions

From: Mike Frysinger <[email protected]>

Signed-off-by: Mike Frysinger <[email protected]>
Signed-off-by: Bryan Wu <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

drivers/serial/bfin_5xx.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)


diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c
index c7c0c1b..6bd9016 100644
--- a/drivers/serial/bfin_5xx.c
+++ b/drivers/serial/bfin_5xx.c
@@ -415,7 +415,8 @@ static void bfin_serial_dma_rx_chars(struct bfin_serial_port *uart)

void bfin_serial_rx_dma_timeout(struct bfin_serial_port *uart)
{
- int x_pos, pos, flags;
+ int x_pos, pos;
+ unsigned long flags;

spin_lock_irqsave(&uart->port.lock, flags);

@@ -1088,7 +1089,7 @@ static void
bfin_serial_console_write(struct console *co, const char *s, unsigned int count)
{
struct bfin_serial_port *uart = &bfin_serial_ports[co->index];
- int flags = 0;
+ unsigned long flags;

spin_lock_irqsave(&uart->port.lock, flags);
uart_console_write(&uart->port, s, count, bfin_serial_console_putchar);

2009-03-24 14:09:46

by Alan

[permalink] [raw]
Subject: [PATCH 17/30] specialix: Auto-load specialix module when device opened.

From: Scott James Remnant <[email protected]>

The specialix module is missing the char-major-75-* alias that would
cause it to be auto-loaded when a device of that type is opened. This
patch adds the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

drivers/char/specialix.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)


diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c
index 3c67c3d..e72be41 100644
--- a/drivers/char/specialix.c
+++ b/drivers/char/specialix.c
@@ -2365,3 +2365,4 @@ module_init(specialix_init_module);
module_exit(specialix_exit_module);

MODULE_LICENSE("GPL");
+MODULE_ALIAS_CHARDEV_MAJOR(SPECIALIX_NORMAL_MAJOR);

2009-03-24 14:09:26

by Alan

[permalink] [raw]
Subject: [PATCH 16/30] cyclades: Auto-load cyclades module when device opened.

From: Scott James Remnant <[email protected]>

The cyclades module is missing the char-major-19-* alias that would
cause it to be auto-loaded when a device of that type is opened. This
patch adds the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

drivers/char/cyclades.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)


diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index 6a59f72..4e89d49 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -646,6 +646,7 @@
#include <linux/spinlock.h>
#include <linux/bitops.h>
#include <linux/firmware.h>
+#include <linux/device.h>

#include <asm/system.h>
#include <linux/io.h>
@@ -5422,3 +5423,4 @@ module_exit(cy_cleanup_module);

MODULE_LICENSE("GPL");
MODULE_VERSION(CY_VERSION);
+MODULE_ALIAS_CHARDEV_MAJOR(CYCLADES_MAJOR);

2009-03-24 14:11:19

by Alan

[permalink] [raw]
Subject: [PATCH 18/30] usb: Auto-load cdc_acm module when device opened.

From: Scott James Remnant <[email protected]>

The cdc_acm module is missing the char-major-166-* alias that would
cause it to be auto-loaded when a device of that type is opened. This
patch adds the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

drivers/usb/class/cdc-acm.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index b3d5a23..85f22c6 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1493,4 +1493,4 @@ module_exit(acm_exit);
MODULE_AUTHOR( DRIVER_AUTHOR );
MODULE_DESCRIPTION( DRIVER_DESC );
MODULE_LICENSE("GPL");
-
+MODULE_ALIAS_CHARDEV_MAJOR(ACM_TTY_MAJOR);

2009-03-24 14:11:34

by Alan

[permalink] [raw]
Subject: [PATCH 20/30] rio: addition has higher precedence than ?:

From: Roel Kluin <[email protected]>

Signed-off-by: Roel Kluin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

drivers/char/rio/rio_linux.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c
index 2e8a6ee..ce81da5 100644
--- a/drivers/char/rio/rio_linux.c
+++ b/drivers/char/rio/rio_linux.c
@@ -333,7 +333,7 @@ void rio_copy_to_card(void *from, void __iomem *to, int len)

int rio_minor(struct tty_struct *tty)
{
- return tty->index + (tty->driver == rio_driver) ? 0 : 256;
+ return tty->index + ((tty->driver == rio_driver) ? 0 : 256);
}

static int rio_set_real_termios(void *ptr)

2009-03-24 14:11:54

by Alan

[permalink] [raw]
Subject: [PATCH 22/30] jsm: define init function as __devinit

From: Breno Leitao <[email protected]>

Signed-off-by: Breno Leitao <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

drivers/serial/jsm/jsm_driver.c | 2 +-
drivers/serial/jsm/jsm_tty.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)


diff --git a/drivers/serial/jsm/jsm_driver.c b/drivers/serial/jsm/jsm_driver.c
index e8da2f9..d2d32a1 100644
--- a/drivers/serial/jsm/jsm_driver.c
+++ b/drivers/serial/jsm/jsm_driver.c
@@ -52,7 +52,7 @@ int jsm_debug;
module_param(jsm_debug, int, 0);
MODULE_PARM_DESC(jsm_debug, "Driver debugging level");

-static int jsm_probe_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+static int __devinit jsm_probe_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{
int rc = 0;
struct jsm_board *brd;
diff --git a/drivers/serial/jsm/jsm_tty.c b/drivers/serial/jsm/jsm_tty.c
index 324c74d..3306963 100644
--- a/drivers/serial/jsm/jsm_tty.c
+++ b/drivers/serial/jsm/jsm_tty.c
@@ -367,7 +367,7 @@ static struct uart_ops jsm_ops = {
* Init the tty subsystem. Called once per board after board has been
* downloaded and init'ed.
*/
-int jsm_tty_init(struct jsm_board *brd)
+int __devinit jsm_tty_init(struct jsm_board *brd)
{
int i;
void __iomem *vaddr;
@@ -431,7 +431,7 @@ int jsm_tty_init(struct jsm_board *brd)
return 0;
}

-int jsm_uart_port_init(struct jsm_board *brd)
+int __devinit jsm_uart_port_init(struct jsm_board *brd)
{
int i;
struct jsm_channel *ch;

2009-03-24 14:12:37

by Alan

[permalink] [raw]
Subject: [PATCH 21/30] vcs: hook sysfs devices into object lifetime instead of "binding"

From: Kay Sievers <[email protected]>

During bootup performance tracing I noticed many occurrences of vca*
device creation and removal, leading to the usual userspace uevent
processing, which are, in this case, rather pointless.

A simple test showing the kernel timing (not including all the work
userspace has to do), gives us these numbers:

$ time for i in `seq 1000`; do echo a > /dev/tty2; done
real 0m1.142s
user 0m0.015s
sys 0m0.540s

If we move the hook for the vcs* driver core devices from the tty
"binding" to the vc allocation/deallocation, which is what the vcs*
devices represent, we get the following numbers:

$ time for i in `seq 1000`; do echo a > /dev/tty2; done
real 0m0.152s
user 0m0.030s
sys 0m0.072s

Signed-off-by: Kay Sievers <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

drivers/char/vc_screen.c | 16 ++++++++--------
drivers/char/vt.c | 5 +++--
include/linux/console.h | 4 ++--
3 files changed, 13 insertions(+), 12 deletions(-)


diff --git a/drivers/char/vc_screen.c b/drivers/char/vc_screen.c
index 4f3b3f9..d94d25c 100644
--- a/drivers/char/vc_screen.c
+++ b/drivers/char/vc_screen.c
@@ -479,18 +479,18 @@ static const struct file_operations vcs_fops = {

static struct class *vc_class;

-void vcs_make_sysfs(struct tty_struct *tty)
+void vcs_make_sysfs(int index)
{
- device_create(vc_class, NULL, MKDEV(VCS_MAJOR, tty->index + 1), NULL,
- "vcs%u", tty->index + 1);
- device_create(vc_class, NULL, MKDEV(VCS_MAJOR, tty->index + 129), NULL,
- "vcsa%u", tty->index + 1);
+ device_create(vc_class, NULL, MKDEV(VCS_MAJOR, index + 1), NULL,
+ "vcs%u", index + 1);
+ device_create(vc_class, NULL, MKDEV(VCS_MAJOR, index + 129), NULL,
+ "vcsa%u", index + 1);
}

-void vcs_remove_sysfs(struct tty_struct *tty)
+void vcs_remove_sysfs(int index)
{
- device_destroy(vc_class, MKDEV(VCS_MAJOR, tty->index + 1));
- device_destroy(vc_class, MKDEV(VCS_MAJOR, tty->index + 129));
+ device_destroy(vc_class, MKDEV(VCS_MAJOR, index + 1));
+ device_destroy(vc_class, MKDEV(VCS_MAJOR, index + 129));
}

int __init vcs_init(void)
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 7900bd6..2c1d133 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -778,6 +778,7 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */
}
vc->vc_kmalloced = 1;
vc_init(vc, vc->vc_rows, vc->vc_cols, 1);
+ vcs_make_sysfs(currcons);
atomic_notifier_call_chain(&vt_notifier_list, VT_ALLOCATE, &param);
}
return 0;
@@ -987,7 +988,9 @@ void vc_deallocate(unsigned int currcons)
if (vc_cons_allocated(currcons)) {
struct vc_data *vc = vc_cons[currcons].d;
struct vt_notifier_param param = { .vc = vc };
+
atomic_notifier_call_chain(&vt_notifier_list, VT_DEALLOCATE, &param);
+ vcs_remove_sysfs(currcons);
vc->vc_sw->con_deinit(vc);
put_pid(vc->vt_pid);
module_put(vc->vc_sw->owner);
@@ -2775,7 +2778,6 @@ static int con_open(struct tty_struct *tty, struct file *filp)
tty->termios->c_iflag |= IUTF8;
else
tty->termios->c_iflag &= ~IUTF8;
- vcs_make_sysfs(tty);
release_console_sem();
return ret;
}
@@ -2795,7 +2797,6 @@ static void con_shutdown(struct tty_struct *tty)
BUG_ON(vc == NULL);
acquire_console_sem();
vc->vc_tty = NULL;
- vcs_remove_sysfs(tty);
release_console_sem();
tty_shutdown(tty);
}
diff --git a/include/linux/console.h b/include/linux/console.h
index a67a90c..dcca533 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -137,8 +137,8 @@ extern void resume_console(void);
int mda_console_init(void);
void prom_con_init(void);

-void vcs_make_sysfs(struct tty_struct *tty);
-void vcs_remove_sysfs(struct tty_struct *tty);
+void vcs_make_sysfs(int index);
+void vcs_remove_sysfs(int index);

/* Some debug stub to catch some of the obvious races in the VT code */
#if 1

2009-03-24 14:10:08

by Alan

[permalink] [raw]
Subject: [PATCH 15/30] applicom: Auto-load applicom module when device opened.

From: Scott James Remnant <[email protected]>

The applicom module is missing the char-major-10-157 alias that would
cause it to be auto-loaded when a device of that type is opened. This
patch adds the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

drivers/char/applicom.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)


diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
index 05674fe..73a0765 100644
--- a/drivers/char/applicom.c
+++ b/drivers/char/applicom.c
@@ -75,6 +75,7 @@ MODULE_DEVICE_TABLE(pci, applicom_pci_tbl);
MODULE_AUTHOR("David Woodhouse & Applicom International");
MODULE_DESCRIPTION("Driver for Applicom Profibus card");
MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(AC_MINOR);

MODULE_SUPPORTED_DEVICE("ac");

2009-03-24 14:08:58

by Alan

[permalink] [raw]
Subject: [PATCH 13/30] Fix DMA rx ring buffer handling

From: Sonic Zhang <[email protected]>

Reported-by: Qian Zhang <[email protected]>
Signed-off-by: Sonic Zhang <[email protected]>
Signed-off-by: Bryan Wu <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

drivers/serial/bfin_5xx.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)


diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c
index 1e08e36..371a62f 100644
--- a/drivers/serial/bfin_5xx.c
+++ b/drivers/serial/bfin_5xx.c
@@ -401,9 +401,11 @@ static void bfin_serial_dma_rx_chars(struct bfin_serial_port *uart)
else
flg = TTY_NORMAL;

- for (i = uart->rx_dma_buf.tail; i != uart->rx_dma_buf.head; i++) {
+ for (i = uart->rx_dma_buf.tail; ; i++) {
if (i >= UART_XMIT_SIZE)
i = 0;
+ if (i == uart->rx_dma_buf.head)
+ break;
if (!uart_handle_sysrq_char(&uart->port, uart->rx_dma_buf.buf[i]))
uart_insert_char(&uart->port, status, OE,
uart->rx_dma_buf.buf[i], flg);

2009-03-24 14:12:22

by Alan

[permalink] [raw]
Subject: [PATCH 23/30] icom: remove unused variables

From: Breno Leitao <[email protected]>

Signed-off-by: Breno Leitao <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

drivers/serial/icom.c | 14 ++------------
1 files changed, 2 insertions(+), 12 deletions(-)


diff --git a/drivers/serial/icom.c b/drivers/serial/icom.c
index 2b7531d..6579e2b 100644
--- a/drivers/serial/icom.c
+++ b/drivers/serial/icom.c
@@ -1098,7 +1098,6 @@ static void icom_set_termios(struct uart_port *port,
{
int baud;
unsigned cflag, iflag;
- int bits;
char new_config2;
char new_config3 = 0;
char tmp_byte;
@@ -1119,34 +1118,27 @@ static void icom_set_termios(struct uart_port *port,
switch (cflag & CSIZE) {
case CS5: /* 5 bits/char */
new_config2 |= ICOM_ACFG_5BPC;
- bits = 7;
break;
case CS6: /* 6 bits/char */
new_config2 |= ICOM_ACFG_6BPC;
- bits = 8;
break;
case CS7: /* 7 bits/char */
new_config2 |= ICOM_ACFG_7BPC;
- bits = 9;
break;
case CS8: /* 8 bits/char */
new_config2 |= ICOM_ACFG_8BPC;
- bits = 10;
break;
default:
- bits = 10;
break;
}
if (cflag & CSTOPB) {
/* 2 stop bits */
new_config2 |= ICOM_ACFG_2STOP_BIT;
- bits++;
}
if (cflag & PARENB) {
/* parity bit enabled */
new_config2 |= ICOM_ACFG_PARITY_ENAB;
trace(ICOM_PORT, "PARENB", 0);
- bits++;
}
if (cflag & PARODD) {
/* odd parity */
@@ -1322,7 +1314,6 @@ static struct uart_driver icom_uart_driver = {
static int __devinit icom_init_ports(struct icom_adapter *icom_adapter)
{
u32 subsystem_id = icom_adapter->subsystem_id;
- int retval = 0;
int i;
struct icom_port *icom_port;

@@ -1368,7 +1359,7 @@ static int __devinit icom_init_ports(struct icom_adapter *icom_adapter)
}
}

- return retval;
+ return 0;
}

static void icom_port_active(struct icom_port *icom_port, struct icom_adapter *icom_adapter, int port_num)
@@ -1391,7 +1382,6 @@ static int __devinit icom_load_ports(struct icom_adapter *icom_adapter)
{
struct icom_port *icom_port;
int port_num;
- int retval;

for (port_num = 0; port_num < icom_adapter->numb_ports; port_num++) {

@@ -1405,7 +1395,7 @@ static int __devinit icom_load_ports(struct icom_adapter *icom_adapter)
icom_port->adapter = icom_adapter;

/* get port memory */
- if ((retval = get_port_memory(icom_port)) != 0) {
+ if (get_port_memory(icom_port) != 0) {
dev_err(&icom_port->adapter->pci_dev->dev,
"Memory allocation for port FAILED\n");
}

2009-03-24 14:08:13

by Alan

[permalink] [raw]
Subject: [PATCH 10/30] blackfin: BF538/9 serial uart support

From: Michael Hennerich <[email protected]>

Enable third UART on BF538/9

Signed-off-by: Michael Hennerich <[email protected]>
Signed-off-by: Bryan Wu <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

drivers/serial/Kconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 451b64f..46d4321 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -770,7 +770,7 @@ config UART1_RTS_PIN

config SERIAL_BFIN_UART2
bool "Enable UART2"
- depends on SERIAL_BFIN && (BF54x)
+ depends on SERIAL_BFIN && (BF54x || BF538 || BF539)
help
Enable UART2

2009-03-24 14:14:08

by Alan

[permalink] [raw]
Subject: [PATCH 25/30] tty: moxa, fix refcounting in moxa_poll_port

From: Jiri Slaby <[email protected]>

There is missing tty_kref_put on some paths in moxa_poll_port,
although the reference is always taken. Fix it.

Signed-off-by: Jiri Slaby <[email protected]>
Reported-by: Jan 'Yenya' Kasprzak <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

drivers/char/moxa.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)


diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c
index 8b0da97..4a4cab7 100644
--- a/drivers/char/moxa.c
+++ b/drivers/char/moxa.c
@@ -1486,11 +1486,11 @@ static int moxa_poll_port(struct moxa_port *p, unsigned int handle,
}

if (!handle) /* nothing else to do */
- return 0;
+ goto put;

intr = readw(ip); /* port irq status */
if (intr == 0)
- return 0;
+ goto put;

writew(0, ip); /* ACK port */
ofsAddr = p->tableAddr;
@@ -1499,16 +1499,17 @@ static int moxa_poll_port(struct moxa_port *p, unsigned int handle,
ofsAddr + HostStat);

if (!inited)
- return 0;
+ goto put;

if (tty && (intr & IntrBreak) && !I_IGNBRK(tty)) { /* BREAK */
tty_insert_flip_char(tty, 0, TTY_BREAK);
tty_schedule_flip(tty);
}
- tty_kref_put(tty);

if (intr & IntrLine)
moxa_new_dcdstate(p, readb(ofsAddr + FlagStat) & DCD_state);
+put:
+ tty_kref_put(tty);

return 0;
}

2009-03-24 14:13:45

by Alan

[permalink] [raw]
Subject: [PATCH 24/30] isicom: isicom kref leak fix

The isicom driver leaks a kref on the shutdown path. Drop the additional
kref we took

Signed-off-by: Alan Cox <[email protected]>
---

drivers/char/isicom.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)


diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c
index 24aa6e8..a59eac5 100644
--- a/drivers/char/isicom.c
+++ b/drivers/char/isicom.c
@@ -925,6 +925,7 @@ static void isicom_shutdown_port(struct isi_port *port)
if (!card->count)
isicom_shutdown_board(card);
}
+ tty_kref_put(tty);
}

static void isicom_flush_buffer(struct tty_struct *tty)

2009-03-24 14:15:16

by Alan

[permalink] [raw]
Subject: [PATCH 26/30] mxser: remove tty_port_tty_get from mxser_check_modem_status

From: Jiri Slaby <[email protected]>

mxser_check_modem_status is called with tty parameter, so the
reference should be increased by callers already -- for ioctl
syscall it is held whole time gap since open to close, for
interrupt, the reference count is increased in the irq handler.

There is no tty_kref_put in that function, so this also fixes
a refcounting bug.

Signed-off-by: Jiri Slaby <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

drivers/char/mxser.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)


diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c
index 402c9f2..a420e8d 100644
--- a/drivers/char/mxser.c
+++ b/drivers/char/mxser.c
@@ -820,7 +820,6 @@ static void mxser_check_modem_status(struct tty_struct *tty,
wake_up_interruptible(&port->port.open_wait);
}

- tty = tty_port_tty_get(&port->port);
if (port->port.flags & ASYNC_CTS_FLOW) {
if (tty->hw_stopped) {
if (status & UART_MSR_CTS) {

2009-03-24 14:14:51

by Alan

[permalink] [raw]
Subject: [PATCH 27/30] ucc: Fix leaky error path

Found by Daniel Marjamäki using cppcheck

Signed-off-by: Alan Cox <[email protected]>
---

drivers/serial/ucc_uart.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)


diff --git a/drivers/serial/ucc_uart.c b/drivers/serial/ucc_uart.c
index 315a933..7de66c0 100644
--- a/drivers/serial/ucc_uart.c
+++ b/drivers/serial/ucc_uart.c
@@ -1274,6 +1274,7 @@ static int ucc_uart_probe(struct of_device *ofdev,
if (!iprop) {
iprop = of_get_property(np, "device-id", NULL);
if (!iprop) {
+ kfree(qe_port);
dev_err(&ofdev->dev, "UCC is unspecified in "
"device tree\n");
return -EINVAL;

2009-03-24 14:17:39

by Alan

[permalink] [raw]
Subject: [PATCH 12/30] blackfin: Fix tty compile error in PIO mode

From: Sonic Zhang <[email protected]>

drivers/serial/bfin_5xx.c: In function bfin_serial_rx_chars:
drivers/serial/bfin_5xx.c:178: error: struct uart_info has no
member
named tty
make[3]: *** [drivers/serial/bfin_5xx.o] Error 1
make[2]: *** [drivers/serial] Error 2
make[1]: *** [drivers] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/root/projects/uClinux-dist/linux-2.6.x'
make: *** [linux] Error 1

Signed-off-by: Sonic Zhang <[email protected]>
Signed-off-by: Bryan Wu <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

drivers/serial/bfin_5xx.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c
index 6bd9016..1e08e36 100644
--- a/drivers/serial/bfin_5xx.c
+++ b/drivers/serial/bfin_5xx.c
@@ -174,10 +174,10 @@ static void bfin_serial_rx_chars(struct bfin_serial_port *uart)
return;
}

- if (!uart->port.info || !uart->port.info->tty)
+ if (!uart->port.info || !uart->port.info->port.tty)
return;
#endif
- tty = uart->port.info->tty;
+ tty = uart->port.info->port.tty;

if (ANOMALY_05000363) {
/* The BF533 (and BF561) family of processors have a nice anomaly

2009-03-24 14:17:58

by Alan

[permalink] [raw]
Subject: [PATCH 30/30] 8250_pci: ni8420 support

From: Will Page <[email protected]>

Signed-off-by: Will Page <[email protected]>
Signed-off-by: Shawn Bohrer <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

drivers/serial/8250_pci.c | 218 +++++++++++++++++++++++++++++++++++++++++++++
include/linux/pci_ids.h | 12 ++
2 files changed, 230 insertions(+), 0 deletions(-)


diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
index 2f570c7..5b0e80d 100644
--- a/drivers/serial/8250_pci.c
+++ b/drivers/serial/8250_pci.c
@@ -306,6 +306,33 @@ static void __devexit pci_plx9050_exit(struct pci_dev *dev)
}
}

+#define NI8420_INT_ENABLE_REG 0x38
+#define NI8420_INT_ENABLE_BIT 0x2000
+
+static void __devexit pci_ni8420_exit(struct pci_dev *dev)
+{
+ void __iomem *p;
+ unsigned long base, len;
+ unsigned int bar = 0;
+
+ if ((pci_resource_flags(dev, bar) & IORESOURCE_MEM) == 0) {
+ moan_device("no memory in bar", dev);
+ return;
+ }
+
+ base = pci_resource_start(dev, bar);
+ len = pci_resource_len(dev, bar);
+ p = ioremap_nocache(base, len);
+ if (p == NULL)
+ return;
+
+ /* Disable the CPU Interrupt */
+ writel(readl(p + NI8420_INT_ENABLE_REG) & ~(NI8420_INT_ENABLE_BIT),
+ p + NI8420_INT_ENABLE_REG);
+ iounmap(p);
+}
+
+
/* MITE registers */
#define MITE_IOWBSR1 0xc4
#define MITE_IOWCR1 0xf4
@@ -627,6 +654,31 @@ static int pci_xircom_init(struct pci_dev *dev)
return 0;
}

+static int pci_ni8420_init(struct pci_dev *dev)
+{
+ void __iomem *p;
+ unsigned long base, len;
+ unsigned int bar = 0;
+
+ if ((pci_resource_flags(dev, bar) & IORESOURCE_MEM) == 0) {
+ moan_device("no memory in bar", dev);
+ return 0;
+ }
+
+ base = pci_resource_start(dev, bar);
+ len = pci_resource_len(dev, bar);
+ p = ioremap_nocache(base, len);
+ if (p == NULL)
+ return -ENOMEM;
+
+ /* Enable CPU Interrupt */
+ writel(readl(p + NI8420_INT_ENABLE_REG) | NI8420_INT_ENABLE_BIT,
+ p + NI8420_INT_ENABLE_REG);
+
+ iounmap(p);
+ return 0;
+}
+
#define MITE_IOWBSR1_WSIZE 0xa
#define MITE_IOWBSR1_WIN_OFFSET 0x800
#define MITE_IOWBSR1_WENAB (1 << 7)
@@ -1023,6 +1075,114 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
*/
{
.vendor = PCI_VENDOR_ID_NI,
+ .device = PCI_DEVICE_ID_NI_PCI23216,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID,
+ .init = pci_ni8420_init,
+ .setup = pci_default_setup,
+ .exit = __devexit_p(pci_ni8420_exit),
+ },
+ {
+ .vendor = PCI_VENDOR_ID_NI,
+ .device = PCI_DEVICE_ID_NI_PCI2328,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID,
+ .init = pci_ni8420_init,
+ .setup = pci_default_setup,
+ .exit = __devexit_p(pci_ni8420_exit),
+ },
+ {
+ .vendor = PCI_VENDOR_ID_NI,
+ .device = PCI_DEVICE_ID_NI_PCI2324,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID,
+ .init = pci_ni8420_init,
+ .setup = pci_default_setup,
+ .exit = __devexit_p(pci_ni8420_exit),
+ },
+ {
+ .vendor = PCI_VENDOR_ID_NI,
+ .device = PCI_DEVICE_ID_NI_PCI2322,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID,
+ .init = pci_ni8420_init,
+ .setup = pci_default_setup,
+ .exit = __devexit_p(pci_ni8420_exit),
+ },
+ {
+ .vendor = PCI_VENDOR_ID_NI,
+ .device = PCI_DEVICE_ID_NI_PCI2324I,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID,
+ .init = pci_ni8420_init,
+ .setup = pci_default_setup,
+ .exit = __devexit_p(pci_ni8420_exit),
+ },
+ {
+ .vendor = PCI_VENDOR_ID_NI,
+ .device = PCI_DEVICE_ID_NI_PCI2322I,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID,
+ .init = pci_ni8420_init,
+ .setup = pci_default_setup,
+ .exit = __devexit_p(pci_ni8420_exit),
+ },
+ {
+ .vendor = PCI_VENDOR_ID_NI,
+ .device = PCI_DEVICE_ID_NI_PXI8420_23216,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID,
+ .init = pci_ni8420_init,
+ .setup = pci_default_setup,
+ .exit = __devexit_p(pci_ni8420_exit),
+ },
+ {
+ .vendor = PCI_VENDOR_ID_NI,
+ .device = PCI_DEVICE_ID_NI_PXI8420_2328,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID,
+ .init = pci_ni8420_init,
+ .setup = pci_default_setup,
+ .exit = __devexit_p(pci_ni8420_exit),
+ },
+ {
+ .vendor = PCI_VENDOR_ID_NI,
+ .device = PCI_DEVICE_ID_NI_PXI8420_2324,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID,
+ .init = pci_ni8420_init,
+ .setup = pci_default_setup,
+ .exit = __devexit_p(pci_ni8420_exit),
+ },
+ {
+ .vendor = PCI_VENDOR_ID_NI,
+ .device = PCI_DEVICE_ID_NI_PXI8420_2322,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID,
+ .init = pci_ni8420_init,
+ .setup = pci_default_setup,
+ .exit = __devexit_p(pci_ni8420_exit),
+ },
+ {
+ .vendor = PCI_VENDOR_ID_NI,
+ .device = PCI_DEVICE_ID_NI_PXI8422_2324,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID,
+ .init = pci_ni8420_init,
+ .setup = pci_default_setup,
+ .exit = __devexit_p(pci_ni8420_exit),
+ },
+ {
+ .vendor = PCI_VENDOR_ID_NI,
+ .device = PCI_DEVICE_ID_NI_PXI8422_2322,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID,
+ .init = pci_ni8420_init,
+ .setup = pci_default_setup,
+ .exit = __devexit_p(pci_ni8420_exit),
+ },
+ {
+ .vendor = PCI_VENDOR_ID_NI,
.device = PCI_ANY_ID,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
@@ -1334,6 +1494,7 @@ enum pci_board_num_t {
pbn_b1_2_115200,
pbn_b1_4_115200,
pbn_b1_8_115200,
+ pbn_b1_16_115200,

pbn_b1_1_921600,
pbn_b1_2_921600,
@@ -1343,6 +1504,9 @@ enum pci_board_num_t {
pbn_b1_2_1250000,

pbn_b1_bt_1_115200,
+ pbn_b1_bt_2_115200,
+ pbn_b1_bt_4_115200,
+
pbn_b1_bt_2_921600,

pbn_b1_1_1382400,
@@ -1609,6 +1773,12 @@ static struct pciserial_board pci_boards[] __devinitdata = {
.base_baud = 115200,
.uart_offset = 8,
},
+ [pbn_b1_16_115200] = {
+ .flags = FL_BASE1,
+ .num_ports = 16,
+ .base_baud = 115200,
+ .uart_offset = 8,
+ },

[pbn_b1_1_921600] = {
.flags = FL_BASE1,
@@ -1647,6 +1817,18 @@ static struct pciserial_board pci_boards[] __devinitdata = {
.base_baud = 115200,
.uart_offset = 8,
},
+ [pbn_b1_bt_2_115200] = {
+ .flags = FL_BASE1|FL_BASE_BARS,
+ .num_ports = 2,
+ .base_baud = 115200,
+ .uart_offset = 8,
+ },
+ [pbn_b1_bt_4_115200] = {
+ .flags = FL_BASE1|FL_BASE_BARS,
+ .num_ports = 4,
+ .base_baud = 115200,
+ .uart_offset = 8,
+ },

[pbn_b1_bt_2_921600] = {
.flags = FL_BASE1|FL_BASE_BARS,
@@ -3207,6 +3389,42 @@ static struct pci_device_id serial_pci_tbl[] = {
/*
* National Instruments
*/
+ { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI23216,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ pbn_b1_16_115200 },
+ { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2328,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ pbn_b1_8_115200 },
+ { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2324,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ pbn_b1_bt_4_115200 },
+ { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2322,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ pbn_b1_bt_2_115200 },
+ { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2324I,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ pbn_b1_bt_4_115200 },
+ { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2322I,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ pbn_b1_bt_2_115200 },
+ { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8420_23216,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ pbn_b1_16_115200 },
+ { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8420_2328,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ pbn_b1_8_115200 },
+ { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8420_2324,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ pbn_b1_bt_4_115200 },
+ { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8420_2322,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ pbn_b1_bt_2_115200 },
+ { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8422_2324,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ pbn_b1_bt_4_115200 },
+ { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8422_2322,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ pbn_b1_bt_2_115200 },
{ PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8430_2322,
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
pbn_ni8430_2 },
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index b3676fe..0e4f1ed 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -942,6 +942,18 @@
#define PCI_DEVICE_ID_SUN_CASSINI 0xabba

#define PCI_VENDOR_ID_NI 0x1093
+#define PCI_DEVICE_ID_NI_PCI2322 0xd130
+#define PCI_DEVICE_ID_NI_PCI2324 0xd140
+#define PCI_DEVICE_ID_NI_PCI2328 0xd150
+#define PCI_DEVICE_ID_NI_PXI8422_2322 0xd190
+#define PCI_DEVICE_ID_NI_PXI8422_2324 0xd1a0
+#define PCI_DEVICE_ID_NI_PXI8420_2322 0xd1d0
+#define PCI_DEVICE_ID_NI_PXI8420_2324 0xd1e0
+#define PCI_DEVICE_ID_NI_PXI8420_2328 0xd1f0
+#define PCI_DEVICE_ID_NI_PXI8420_23216 0xd1f1
+#define PCI_DEVICE_ID_NI_PCI2322I 0xd250
+#define PCI_DEVICE_ID_NI_PCI2324I 0xd270
+#define PCI_DEVICE_ID_NI_PCI23216 0xd2b0
#define PCI_DEVICE_ID_NI_PXI8430_2322 0x7080
#define PCI_DEVICE_ID_NI_PCI8430_2322 0x70db
#define PCI_DEVICE_ID_NI_PXI8430_2324 0x70dd

2009-03-24 14:15:47

by Alan

[permalink] [raw]
Subject: [PATCH 28/30] mux: fix build problem

From: Alexander Beregalov <[email protected]>

Fixes:

In file included from drivers/serial/mux.c:37:
include/linux/serial_core.h: In function 'uart_handle_sysrq_char':
include/linux/serial_core.h:467: error: 'struct uart_port' has no member named 'sysrq'
include/linux/serial_core.h:468: error: 'struct uart_port' has no member named 'sysrq'


Signed-off-by: Alexander Beregalov <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

include/linux/serial_core.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index df9245c..83e4b3f 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -277,7 +277,7 @@ struct uart_port {
struct uart_icount icount; /* statistics */

struct console *cons; /* struct console, if any */
-#ifdef CONFIG_SERIAL_CORE_CONSOLE
+#if defined(CONFIG_SERIAL_CORE_CONSOLE) || defined(SUPPORT_SYSRQ)
unsigned long sysrq; /* sysrq timeout */
#endif

2009-03-24 14:16:10

by Alan

[permalink] [raw]
Subject: [PATCH 29/30] 8250_pci: add support for National Instruments 843x RS232 devices

From: Shawn Bohrer <[email protected]>

This implements basic support for all 843x RS232 devices, but does not
add DMA support. This means that sustained data transfers at high baud
rates may not be possible on multiple ports simultaneously.

Signed-off-by: Shawn Bohrer <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---

drivers/serial/8250_pci.c | 193 +++++++++++++++++++++++++++++++++++++++++++++
include/linux/pci_ids.h | 14 +++
2 files changed, 207 insertions(+), 0 deletions(-)


diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
index 533f820..2f570c7 100644
--- a/drivers/serial/8250_pci.c
+++ b/drivers/serial/8250_pci.c
@@ -306,6 +306,36 @@ static void __devexit pci_plx9050_exit(struct pci_dev *dev)
}
}

+/* MITE registers */
+#define MITE_IOWBSR1 0xc4
+#define MITE_IOWCR1 0xf4
+#define MITE_LCIMR1 0x08
+#define MITE_LCIMR2 0x10
+
+#define MITE_LCIMR2_CLR_CPU_IE (1 << 30)
+
+static void __devexit pci_ni8430_exit(struct pci_dev *dev)
+{
+ void __iomem *p;
+ unsigned long base, len;
+ unsigned int bar = 0;
+
+ if ((pci_resource_flags(dev, bar) & IORESOURCE_MEM) == 0) {
+ moan_device("no memory in bar", dev);
+ return;
+ }
+
+ base = pci_resource_start(dev, bar);
+ len = pci_resource_len(dev, bar);
+ p = ioremap_nocache(base, len);
+ if (p == NULL)
+ return;
+
+ /* Disable the CPU Interrupt */
+ writel(MITE_LCIMR2_CLR_CPU_IE, p + MITE_LCIMR2);
+ iounmap(p);
+}
+
/* SBS Technologies Inc. PMC-OCTPRO and P-OCTAL cards */
static int
sbs_setup(struct serial_private *priv, const struct pciserial_board *board,
@@ -597,6 +627,82 @@ static int pci_xircom_init(struct pci_dev *dev)
return 0;
}

+#define MITE_IOWBSR1_WSIZE 0xa
+#define MITE_IOWBSR1_WIN_OFFSET 0x800
+#define MITE_IOWBSR1_WENAB (1 << 7)
+#define MITE_LCIMR1_IO_IE_0 (1 << 24)
+#define MITE_LCIMR2_SET_CPU_IE (1 << 31)
+#define MITE_IOWCR1_RAMSEL_MASK 0xfffffffe
+
+static int pci_ni8430_init(struct pci_dev *dev)
+{
+ void __iomem *p;
+ unsigned long base, len;
+ u32 device_window;
+ unsigned int bar = 0;
+
+ if ((pci_resource_flags(dev, bar) & IORESOURCE_MEM) == 0) {
+ moan_device("no memory in bar", dev);
+ return 0;
+ }
+
+ base = pci_resource_start(dev, bar);
+ len = pci_resource_len(dev, bar);
+ p = ioremap_nocache(base, len);
+ if (p == NULL)
+ return -ENOMEM;
+
+ /* Set device window address and size in BAR0 */
+ device_window = ((base + MITE_IOWBSR1_WIN_OFFSET) & 0xffffff00)
+ | MITE_IOWBSR1_WENAB | MITE_IOWBSR1_WSIZE;
+ writel(device_window, p + MITE_IOWBSR1);
+
+ /* Set window access to go to RAMSEL IO address space */
+ writel((readl(p + MITE_IOWCR1) & MITE_IOWCR1_RAMSEL_MASK),
+ p + MITE_IOWCR1);
+
+ /* Enable IO Bus Interrupt 0 */
+ writel(MITE_LCIMR1_IO_IE_0, p + MITE_LCIMR1);
+
+ /* Enable CPU Interrupt */
+ writel(MITE_LCIMR2_SET_CPU_IE, p + MITE_LCIMR2);
+
+ iounmap(p);
+ return 0;
+}
+
+/* UART Port Control Register */
+#define NI8430_PORTCON 0x0f
+#define NI8430_PORTCON_TXVR_ENABLE (1 << 3)
+
+static int
+pci_ni8430_setup(struct serial_private *priv, struct pciserial_board *board,
+ struct uart_port *port, int idx)
+{
+ void __iomem *p;
+ unsigned long base, len;
+ unsigned int bar, offset = board->first_offset;
+
+ if (idx >= board->num_ports)
+ return 1;
+
+ bar = FL_GET_BASE(board->flags);
+ offset += idx * board->uart_offset;
+
+ base = pci_resource_start(priv->dev, bar);
+ len = pci_resource_len(priv->dev, bar);
+ p = ioremap_nocache(base, len);
+
+ /* enable the transciever */
+ writeb(readb(p + offset + NI8430_PORTCON) | NI8430_PORTCON_TXVR_ENABLE,
+ p + offset + NI8430_PORTCON);
+
+ iounmap(p);
+
+ return setup_port(priv, port, bar, offset, board->reg_shift);
+}
+
+
static int pci_netmos_init(struct pci_dev *dev)
{
/* subdevice 0x00PS means <P> parallel, <S> serial */
@@ -913,6 +1019,18 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
.exit = __devexit_p(pci_ite887x_exit),
},
/*
+ * National Instruments
+ */
+ {
+ .vendor = PCI_VENDOR_ID_NI,
+ .device = PCI_ANY_ID,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID,
+ .init = pci_ni8430_init,
+ .setup = pci_ni8430_setup,
+ .exit = __devexit_p(pci_ni8430_exit),
+ },
+ /*
* Panacom
*/
{
@@ -1280,6 +1398,10 @@ enum pci_board_num_t {
pbn_exar_XR17C154,
pbn_exar_XR17C158,
pbn_pasemi_1682M,
+ pbn_ni8430_2,
+ pbn_ni8430_4,
+ pbn_ni8430_8,
+ pbn_ni8430_16,
};

/*
@@ -1850,6 +1972,37 @@ static struct pciserial_board pci_boards[] __devinitdata = {
.num_ports = 1,
.base_baud = 8333333,
},
+ /*
+ * National Instruments 843x
+ */
+ [pbn_ni8430_16] = {
+ .flags = FL_BASE0,
+ .num_ports = 16,
+ .base_baud = 3686400,
+ .uart_offset = 0x10,
+ .first_offset = 0x800,
+ },
+ [pbn_ni8430_8] = {
+ .flags = FL_BASE0,
+ .num_ports = 8,
+ .base_baud = 3686400,
+ .uart_offset = 0x10,
+ .first_offset = 0x800,
+ },
+ [pbn_ni8430_4] = {
+ .flags = FL_BASE0,
+ .num_ports = 4,
+ .base_baud = 3686400,
+ .uart_offset = 0x10,
+ .first_offset = 0x800,
+ },
+ [pbn_ni8430_2] = {
+ .flags = FL_BASE0,
+ .num_ports = 2,
+ .base_baud = 3686400,
+ .uart_offset = 0x10,
+ .first_offset = 0x800,
+ },
};

static const struct pci_device_id softmodem_blacklist[] = {
@@ -3052,6 +3205,46 @@ static struct pci_device_id serial_pci_tbl[] = {
pbn_pasemi_1682M },

/*
+ * National Instruments
+ */
+ { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8430_2322,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ pbn_ni8430_2 },
+ { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8430_2322,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ pbn_ni8430_2 },
+ { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8430_2324,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ pbn_ni8430_4 },
+ { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8430_2324,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ pbn_ni8430_4 },
+ { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8430_2328,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ pbn_ni8430_8 },
+ { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8430_2328,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ pbn_ni8430_8 },
+ { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8430_23216,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ pbn_ni8430_16 },
+ { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8430_23216,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ pbn_ni8430_16 },
+ { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8432_2322,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ pbn_ni8430_2 },
+ { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8432_2322,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ pbn_ni8430_2 },
+ { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8432_2324,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ pbn_ni8430_4 },
+ { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8432_2324,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ pbn_ni8430_4 },
+
+ /*
* ADDI-DATA GmbH communication cards <[email protected]>
*/
{ PCI_VENDOR_ID_ADDIDATA,
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index aca8c45..b3676fe 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -941,6 +941,20 @@
#define PCI_DEVICE_ID_SUN_TOMATILLO 0xa801
#define PCI_DEVICE_ID_SUN_CASSINI 0xabba

+#define PCI_VENDOR_ID_NI 0x1093
+#define PCI_DEVICE_ID_NI_PXI8430_2322 0x7080
+#define PCI_DEVICE_ID_NI_PCI8430_2322 0x70db
+#define PCI_DEVICE_ID_NI_PXI8430_2324 0x70dd
+#define PCI_DEVICE_ID_NI_PCI8430_2324 0x70df
+#define PCI_DEVICE_ID_NI_PXI8430_2328 0x70e2
+#define PCI_DEVICE_ID_NI_PCI8430_2328 0x70e4
+#define PCI_DEVICE_ID_NI_PXI8430_23216 0x70e6
+#define PCI_DEVICE_ID_NI_PCI8430_23216 0x70e7
+#define PCI_DEVICE_ID_NI_PXI8432_2322 0x70e8
+#define PCI_DEVICE_ID_NI_PCI8432_2322 0x70ea
+#define PCI_DEVICE_ID_NI_PXI8432_2324 0x70ec
+#define PCI_DEVICE_ID_NI_PCI8432_2324 0x70ee
+
#define PCI_VENDOR_ID_CMD 0x1095
#define PCI_DEVICE_ID_CMD_643 0x0643
#define PCI_DEVICE_ID_CMD_646 0x0646

2009-03-24 15:10:52

by Andrey Panin

[permalink] [raw]
Subject: Re: [PATCH 01/30] disallow SERIAL_8250_PNP with SERIAL_8250_CONSOLE

On 083, 03 24, 2009 at 02:01:52PM +0000, Alan Cox wrote:
> From: Clark Williams <[email protected]>
>
> There are known (but hard to fix issues) with using SERIAL_8250_PNP with
> SERIAL_8250_CONSOLE. This patch just sidesteps that by not allowing PNP
> when CONSOLE is selected.

This patch looks very controversial from my POV. Now distro people must decide
what to enable SERIAL_8250_PNP or SERIAL_8250_CONSOLE. And no matter what you
choose you'll get a regression, non-working serial console vs broken detection of
perfectly working hardware like additional serial ports on industrial computers,
notebook touchpads and finally old and dusty ISA PnP modems.

How widespread are these "known but hard to fix issues", to justify such drastic
change ?

> Signed-off-by: Clark Williams <[email protected]>
> Signed-off-by: Alan Cox <[email protected]>
> ---
>
> drivers/serial/Kconfig | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
>
> diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
> index 7d7f576..451b64f 100644
> --- a/drivers/serial/Kconfig
> +++ b/drivers/serial/Kconfig
> @@ -91,7 +91,7 @@ config SERIAL_8250_PCI
>
> config SERIAL_8250_PNP
> tristate "8250/16550 PNP device support" if EMBEDDED
> - depends on SERIAL_8250 && PNP
> + depends on SERIAL_8250 && PNP && ! SERIAL_8250_CONSOLE
> default SERIAL_8250
> help
> This builds standard PNP serial support. You may be able to
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>

2009-03-24 15:22:27

by Alan

[permalink] [raw]
Subject: Re: [PATCH 01/30] disallow SERIAL_8250_PNP with SERIAL_8250_CONSOLE

> This patch looks very controversial from my POV. Now distro people must decide
> what to enable SERIAL_8250_PNP or SERIAL_8250_CONSOLE. And no matter what you

They do already, otherwise your machine crashes at boot.

> choose you'll get a regression, non-working serial console vs broken detection of
> perfectly working hardware like additional serial ports on industrial computers,
> notebook touchpads and finally old and dusty ISA PnP modems.
>
> How widespread are these "known but hard to fix issues", to justify such drastic
> change ?

Any situation where you have a serial console on an ISAPnP device
explodes on boot. I do intend to find a better fix for this, but in the
meantime it is best that the quick fix goes in IMHO.

2009-03-24 21:00:17

by Matthew Garrett

[permalink] [raw]
Subject: Re: [PATCH 01/30] disallow SERIAL_8250_PNP with SERIAL_8250_CONSOLE

On Tue, Mar 24, 2009 at 03:22:03PM +0000, Alan Cox wrote:
> > This patch looks very controversial from my POV. Now distro people must decide
> > what to enable SERIAL_8250_PNP or SERIAL_8250_CONSOLE. And no matter what you
>
> They do already, otherwise your machine crashes at boot.

We don't. The effect of this patch would be to silently disable 8250_PNP
(since we don't build with CONFIG_EMBEDDED) and cause a surprising
reduction in hardware support. How long has this been broken for?

--
Matthew Garrett | [email protected]

2009-03-24 21:28:00

by Alan

[permalink] [raw]
Subject: Re: [PATCH 01/30] disallow SERIAL_8250_PNP with SERIAL_8250_CONSOLE

On Tue, 24 Mar 2009 20:59:47 +0000
Matthew Garrett <[email protected]> wrote:

> On Tue, Mar 24, 2009 at 03:22:03PM +0000, Alan Cox wrote:
> > > This patch looks very controversial from my POV. Now distro people must decide
> > > what to enable SERIAL_8250_PNP or SERIAL_8250_CONSOLE. And no matter what you
> >
> > They do already, otherwise your machine crashes at boot.
>
> We don't. The effect of this patch would be to silently disable 8250_PNP
> (since we don't build with CONFIG_EMBEDDED) and cause a surprising
> reduction in hardware support. How long has this been broken for?

Since the conversion to drivers/serial - so years.

Alan

2009-03-24 21:34:43

by Matthew Garrett

[permalink] [raw]
Subject: Re: [PATCH 01/30] disallow SERIAL_8250_PNP with SERIAL_8250_CONSOLE

On Tue, Mar 24, 2009 at 09:26:53PM +0000, Alan Cox wrote:
> On Tue, 24 Mar 2009 20:59:47 +0000
> Matthew Garrett <[email protected]> wrote:
>
> > On Tue, Mar 24, 2009 at 03:22:03PM +0000, Alan Cox wrote:
> > > > This patch looks very controversial from my POV. Now distro people must decide
> > > > what to enable SERIAL_8250_PNP or SERIAL_8250_CONSOLE. And no matter what you
> > >
> > > They do already, otherwise your machine crashes at boot.
> >
> > We don't. The effect of this patch would be to silently disable 8250_PNP
> > (since we don't build with CONFIG_EMBEDDED) and cause a surprising
> > reduction in hardware support. How long has this been broken for?
>
> Since the conversion to drivers/serial - so years.

So everyone using serial console with 8250_PNP enabled gets a crash on
boot, and has done for years? Really?

--
Matthew Garrett | [email protected]

2009-03-24 21:39:33

by Alan

[permalink] [raw]
Subject: Re: [PATCH 01/30] disallow SERIAL_8250_PNP with SERIAL_8250_CONSOLE

> > Since the conversion to drivers/serial - so years.
>
> So everyone using serial console with 8250_PNP enabled gets a crash on
> boot, and has done for years? Really?

If their console port is PnP listed yes.

2009-03-24 21:43:44

by Matthew Garrett

[permalink] [raw]
Subject: Re: [PATCH 01/30] disallow SERIAL_8250_PNP with SERIAL_8250_CONSOLE

On Tue, Mar 24, 2009 at 09:38:41PM +0000, Alan Cox wrote:
> > > Since the conversion to drivers/serial - so years.
> >
> > So everyone using serial console with 8250_PNP enabled gets a crash on
> > boot, and has done for years? Really?
>
> If their console port is PnP listed yes.

So this patch breaks the case where a kernel with PNP support is booted
on a system without PNP-listed serial ports? Do we know the ratio of
machines fixed by this compared to the machines broken?

--
Matthew Garrett | [email protected]

2009-03-24 22:19:35

by Alan

[permalink] [raw]
Subject: Re: [PATCH 01/30] disallow SERIAL_8250_PNP with SERIAL_8250_CONSOLE

On Tue, 24 Mar 2009 21:43:21 +0000
Matthew Garrett <[email protected]> wrote:

> On Tue, Mar 24, 2009 at 09:38:41PM +0000, Alan Cox wrote:
> > > > Since the conversion to drivers/serial - so years.
> > >
> > > So everyone using serial console with 8250_PNP enabled gets a crash on
> > > boot, and has done for years? Really?
> >
> > If their console port is PnP listed yes.
>
> So this patch breaks the case where a kernel with PNP support is booted
> on a system without PNP-listed serial ports? Do we know the ratio of
> machines fixed by this compared to the machines broken?

Well the original patch came from Red Hat so perhaps they can provide
data based on their userbase ?

2009-03-24 22:29:59

by Matthew Garrett

[permalink] [raw]
Subject: Re: [PATCH 01/30] disallow SERIAL_8250_PNP with SERIAL_8250_CONSOLE

On Tue, Mar 24, 2009 at 10:18:16PM +0000, Alan Cox wrote:
> On Tue, 24 Mar 2009 21:43:21 +0000
> Matthew Garrett <[email protected]> wrote:
> > So this patch breaks the case where a kernel with PNP support is booted
> > on a system without PNP-listed serial ports? Do we know the ratio of
> > machines fixed by this compared to the machines broken?
>
> Well the original patch came from Red Hat so perhaps they can provide
> data based on their userbase ?

I'd prefer not to go with this approach unless we've got a convincing
number of bugs filed. It's guaranteed to reduce hardware support in
favour of fixing an unknown number of machines.

--
Matthew Garrett | [email protected]

2009-03-24 22:37:48

by Alan

[permalink] [raw]
Subject: Re: [PATCH 01/30] disallow SERIAL_8250_PNP with SERIAL_8250_CONSOLE

On Tue, 24 Mar 2009 22:29:34 +0000
Matthew Garrett <[email protected]> wrote:

> On Tue, Mar 24, 2009 at 10:18:16PM +0000, Alan Cox wrote:
> > On Tue, 24 Mar 2009 21:43:21 +0000
> > Matthew Garrett <[email protected]> wrote:
> > > So this patch breaks the case where a kernel with PNP support is booted
> > > on a system without PNP-listed serial ports? Do we know the ratio of
> > > machines fixed by this compared to the machines broken?
> >
> > Well the original patch came from Red Hat so perhaps they can provide
> > data based on their userbase ?
>
> I'd prefer not to go with this approach unless we've got a convincing
> number of bugs filed. It's guaranteed to reduce hardware support in
> favour of fixing an unknown number of machines.

I get a regular stream of complaints. But as I said Red Hat is the patch
originator, Red Hat has the distro bugzilla so perhaps Red Hat folks can
comment ?

Alan

2009-03-24 22:58:36

by Matthew Garrett

[permalink] [raw]
Subject: Re: [PATCH 01/30] disallow SERIAL_8250_PNP with SERIAL_8250_CONSOLE

On Tue, Mar 24, 2009 at 10:36:32PM +0000, Alan Cox wrote:
> On Tue, 24 Mar 2009 22:29:34 +0000
> Matthew Garrett <[email protected]> wrote:
> > I'd prefer not to go with this approach unless we've got a convincing
> > number of bugs filed. It's guaranteed to reduce hardware support in
> > favour of fixing an unknown number of machines.
>
> I get a regular stream of complaints. But as I said Red Hat is the patch
> originator, Red Hat has the distro bugzilla so perhaps Red Hat folks can
> comment ?

I've had a dig through Bugzilla but couldn't find it, and it doesn't
seem to be in anything we're shipping right now. Clark, do you have a
pointer to a bug that this patch came from?

--
Matthew Garrett | [email protected]

2009-03-25 23:04:41

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH 01/30] disallow SERIAL_8250_PNP with SERIAL_8250_CONSOLE

On Tuesday 24 March 2009 04:58:12 pm Matthew Garrett wrote:
> On Tue, Mar 24, 2009 at 10:36:32PM +0000, Alan Cox wrote:
> > On Tue, 24 Mar 2009 22:29:34 +0000
> > Matthew Garrett <[email protected]> wrote:
> > > I'd prefer not to go with this approach unless we've got a convincing
> > > number of bugs filed. It's guaranteed to reduce hardware support in
> > > favour of fixing an unknown number of machines.
> >
> > I get a regular stream of complaints. But as I said Red Hat is the patch
> > originator, Red Hat has the distro bugzilla so perhaps Red Hat folks can
> > comment ?
>
> I've had a dig through Bugzilla but couldn't find it, and it doesn't
> seem to be in anything we're shipping right now. Clark, do you have a
> pointer to a bug that this patch came from?

This patch is a major problem for ia64. ia64 doesn't have any legacy
serial port probing, so if we turn off SERIAL_8250_PNP, we won't find
any of the non-PCI built-in ports. Many of these machines have only
serial consoles, so turning off either SERIAL_8250_PNP or SERIAL_8250_CONSOLE
is a problem.

Red Hat has been shipping with ia64 kernels with CONFIG_SERIAL_8250_CONSOLE=y
and CONFIG_SERIAL_8250_PNP=y (or its predecessor CONFIG_SERIAL_8250_ACPI=y)
since at least RHEL4.

Bjorn