Skip to contentSkip to conversation

Serial and tty for 2.6.30

PATCH In review Alan Cox 7 participants 48 messages Mar 24, 2009 – Mar 25, 2009

Subsystems (7)
lore
Share & tools
lore

Alan Cox

author
#0 lore raw

cover 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(-)
author
#1 lore raw

PATCH 1/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.

---

 drivers/serial/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/serial/Kconfig +1 -1
index 7d7f576..451b64f 100644
@@ -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
#2 lore raw

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

Quoted 5 lines · Alan Cox

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 ?

Quoted 28 lines

---

 drivers/serial/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/serial/Kconfig +1 -2
index 7d7f576..451b64f 100644
@@ -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/

author
#3 lore raw

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

Quoted 2 lines

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.

Quoted 6 lines

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.

#4 lore raw

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

Quoted 4 lines · Alan Cox
Quoted 2 lines

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?

Signature · 1 line
Matthew Garrett | [email protected]
author
#5 lore raw

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

Quoted 9 lines · On Tue, 24 Mar 2009 20:59:47 +0000 Matthew Garrett <[email protected]> wrote:
Quoted 4 lines · Alan Cox
Quoted 2 lines

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

#6 lore raw

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

Quoted 7 lines · Alan Cox
Quoted 4 lines · On Tue, 24 Mar 2009 20:59:47 +0000 Matthew Garrett <[email protected]> wrote:
Quoted 3 lines · Alan Cox
Quoted 2 lines

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

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

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?

Signature · 1 line
Matthew Garrett | [email protected]
author
#7 lore raw

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

Quoted 4 lines
Quoted 1 line

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.

#8 lore raw

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

Quoted 6 lines · Alan Cox
Quoted 4 lines
Quoted 1 line

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?

Signature · 1 line
Matthew Garrett | [email protected]
author
#9 lore raw

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

Quoted 11 lines · On Tue, 24 Mar 2009 21:43:21 +0000 Matthew Garrett <[email protected]> wrote:
Quoted 6 lines · Alan Cox
Quoted 4 lines
Quoted 1 line

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 ?

#10 lore raw

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

Quoted 8 lines · Alan Cox
Quoted 3 lines · 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.

Signature · 1 line
Matthew Garrett | [email protected]
author
#11 lore raw

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

Quoted 7 lines · On Tue, 24 Mar 2009 22:29:34 +0000 Matthew Garrett <[email protected]> wrote:
Quoted 6 lines · Alan Cox
Quoted 3 lines · 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?

Quoted 6 lines
Quoted 2 lines

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

#12 lore raw

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

Quoted 9 lines · Alan Cox
Quoted 3 lines · 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?

Signature · 1 line
Matthew Garrett | [email protected]
#13 lore raw

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

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 7 lines · On Tue, 24 Mar 2009 22:58:12 +0000 Matthew Garrett <[email protected]> wrote:
Quoted 6 lines · Alan Cox
Quoted 3 lines · 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.

Quoted 8 lines
Quoted 3 lines

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?

No BZ on this one. I was trying to bring up a new version of the RT kernel on some of my lab h/w (mostly whiteboxes, all w/serial console) and kept panic'ing during boot. I eventually stumbled upon PNP serial as a likely culprit, turned it off and the problem went away. So I sent the patch to Alan.

My *guess* is that the RT kernel locking changes (spinlock -> rt_mutex) opened up a race window. This was on the 2.6.26/27 series; I don't seem to see this on .29.

So, no complaint from me if you drop it.

Clark
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)

iEYEARECAAYFAknKPhMACgkQHyuj/+TTEp0mUgCfWUyRZuQRAFsCCOhXHWtw/EdF rdMAnjSPfFLbXioSSwR6Y17U2c3a/LZq
=XsNZ
-----END PGP SIGNATURE-----

#14 lore raw

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

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 6 lines · On Wed, 25 Mar 2009 09:22:03 -0500 Clark Williams <[email protected]> wrote:

No BZ on this one. I was trying to bring up a new version of the RT kernel on some of my lab h/w (mostly whiteboxes, all w/serial console) and kept panic'ing during boot. I eventually stumbled upon PNP serial as a likely culprit, turned it off and the problem went away. So I sent the patch to Alan.

Ugh, that's what I get for replying before my third cup of coffee.

I was trying to bring up a 2.6.26-rt kernel on an IBM LS20 blade back in January. It was a comparison experiement (MRG RT wasn't going to use a 2.6.26 kernel), so I didn't file a BZ or keep any of the data around :(.

I don't see this panic in the 2.6.24 series, nor do I see it in the 2.6.29 series, so it seems that I only saw it in 2.6.26. I'll keep an eye out for this behavior again, but still no complaint if this patch gets dropped.

Sorry for the noise.

Clark
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)

iEYEARECAAYFAknKS0sACgkQHyuj/+TTEp0+mACeJjp91ShccCiiKv5epw5uPr+Y fbUAoODsU8FLORNqVBDJePT581bBXK6l
=Mk5b
-----END PGP SIGNATURE-----

author
#15 lore raw

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

Quoted 5 lines

I don't see this panic in the 2.6.24 series, nor do I see it in the 2.6.29 series, so it seems that I only saw it in 2.6.26. I'll keep an eye out for this behavior again, but still no complaint if this patch gets dropped.

I can dup it to order in 2.6.29

#16 lore raw

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

Quoted 7 lines · Alan Cox
Quoted 5 lines

I don't see this panic in the 2.6.24 series, nor do I see it in the 2.6.29 series, so it seems that I only saw it in 2.6.26. I'll keep an eye out for this behavior again, but still no complaint if this patch gets dropped.

I can dup it to order in 2.6.29

It's still fixing one configuration by breaking another. There's no harm in maintaining the status quo.

Signature · 1 line
Matthew Garrett | [email protected]
#17 lore raw

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

Quoted 3 lines · Matthew Garrett

It's still fixing one configuration by breaking another. There's no harm in maintaining the status quo.

I do agree. We do _not_ fix a problem by making another one. We're better off with the old problem than with a new one.

Linus

#18 lore raw

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

In reply to Matthew Garrett
Quoted 7 lines · Matthew Garrett
Quoted 6 lines · Alan Cox
Quoted 3 lines · 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.

Quoted 7 lines
Quoted 3 lines

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

author
#19 lore raw

PATCH 2/30 8250_pnp.c: add another Wacom tablet

In reply to Alan Cox

From: Danny Kukawka <[email protected]>

Add another serial Wacom tablet with pnp_id: WACF009.

--

 8250_pnp.c |    1 +
 1 file changed, 1 insertion(+)

---

 drivers/serial/8250_pnp.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/serial/8250_pnp.c +1 -0
index bbcfc26..6db9f13 100644
@@ -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 */
author
#20 lore raw

PATCH 3/30 serial: Update PNP IDs

In reply to Alan Cox

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.

---

 drivers/serial/8250_pnp.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
drivers/serial/8250_pnp.c +5 -1
index 6db9f13..d71dfe3 100644
@@ -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
author
#21 lore raw

PATCH 4/30 jsm: Fix the return variable and removing the unused retval.

In reply to Alan Cox

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.

---

 drivers/serial/jsm/jsm_driver.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/serial/jsm/jsm_driver.c +3 -4
index ac79cbe..e8da2f9 100644
@@ -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;
 	}
 
author
#22 lore raw

PATCH 5/30 PCI: quirks, don't mark one netmos as class other

In reply to Alan Cox

From: Jiri Slaby <[email protected]>

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

---

 drivers/pci/quirks.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
drivers/pci/quirks.c +5 -1
index 92b9efe..5aa2afb 100644
@@ -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 &&
author
#23 lore raw

PATCH 6/30 devpts: must release s_umount on error

In reply to Alan Cox

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.

---

 fs/devpts/inode.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
fs/devpts/inode.c +2 -0
index bff4052..140b431 100644
@@ -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);
 	}
 
author
#24 lore raw

PATCH 7/30 cpm_uart: fix non-console port startup bug

In reply to Alan Cox

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.

---

 drivers/serial/cpm_uart/cpm_uart_core.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
drivers/serial/cpm_uart/cpm_uart_core.c +12 -2
index bde4b4b..5c6ef51 100644
@@ -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;
 }
 
author
#25 lore raw

PATCH 8/30 Use barrier instead of cpu_relax for early blackfin boot

In reply to Alan Cox

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().

---

 drivers/serial/bfin_5xx.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/serial/bfin_5xx.c +2 -1
index 318d69d..d46d764 100644
@@ -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);
 }
 
author
#26 lore raw

PATCH 9/30 blackfin: Explain why we cannot cpu_relax() in early serial code

In reply to Alan Cox

From: Mike Frysinger <[email protected]>

---

 drivers/serial/bfin_5xx.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/serial/bfin_5xx.c +4 -0
index d46d764..c7c0c1b 100644
@@ -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();
 
author
#27 lore raw

PATCH 10/30 blackfin: BF538/9 serial uart support

In reply to Alan Cox

From: Michael Hennerich <[email protected]>

Enable third UART on BF538/9

---

 drivers/serial/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/serial/Kconfig +1 -1
index 451b64f..46d4321 100644
@@ -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
 
author
#28 lore raw

PATCH 11/30 blackfin: Use unsigned long for flags with irq functions

In reply to Alan Cox

From: Mike Frysinger <[email protected]>

---

 drivers/serial/bfin_5xx.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/serial/bfin_5xx.c +3 -2
index c7c0c1b..6bd9016 100644
@@ -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);
author
#29 lore raw

PATCH 12/30 blackfin: Fix tty compile error in PIO mode

In reply to Alan Cox

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

---

 drivers/serial/bfin_5xx.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/serial/bfin_5xx.c +2 -2
index 6bd9016..1e08e36 100644
@@ -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
author
#30 lore raw

PATCH 13/30 Fix DMA rx ring buffer handling

In reply to Alan Cox

From: Sonic Zhang <[email protected]>

---

 drivers/serial/bfin_5xx.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/serial/bfin_5xx.c +3 -1
index 1e08e36..371a62f 100644
@@ -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);
author
#31 lore raw

PATCH 14/30 blackfin: Subtract ANOMALY_05000230 on quot

In reply to Alan Cox

From: Graf Yang <[email protected]>

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

---

 drivers/serial/bfin_5xx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/serial/bfin_5xx.c +1 -1
index 371a62f..3ba5e78 100644
@@ -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);
author
#32 lore raw

PATCH 15/30 applicom: Auto-load applicom module when device opened.

In reply to Alan Cox

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.

---

 drivers/char/applicom.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/char/applicom.c +1 -0
index 05674fe..73a0765 100644
@@ -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");
 
author
#33 lore raw

PATCH 16/30 cyclades: Auto-load cyclades module when device opened.

In reply to Alan Cox

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.

---

 drivers/char/cyclades.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/char/cyclades.c +2 -0
index 6a59f72..4e89d49 100644
@@ -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);
author
#34 lore raw

PATCH 17/30 specialix: Auto-load specialix module when device opened.

In reply to Alan Cox

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.

---

 drivers/char/specialix.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/char/specialix.c +1 -0
index 3c67c3d..e72be41 100644
@@ -2365,3 +2365,4 @@ module_init(specialix_init_module);
 module_exit(specialix_exit_module);
 
 MODULE_LICENSE("GPL");
+MODULE_ALIAS_CHARDEV_MAJOR(SPECIALIX_NORMAL_MAJOR);
author
#35 lore raw

PATCH 18/30 usb: Auto-load cdc_acm module when device opened.

In reply to Alan Cox

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.

---

 drivers/usb/class/cdc-acm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/usb/class/cdc-acm.c +1 -1
index b3d5a23..85f22c6 100644
@@ -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);
author
#36 lore raw

PATCH 19/30 riscom8: Auto-load riscom8 module when device opened.

In reply to Alan Cox

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.

---

 drivers/char/riscom8.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/char/riscom8.c +2 -0
index 9af8d74..2176604 100644
@@ -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 */
 
 /*
author
#37 lore raw

PATCH 20/30 rio: addition has higher precedence than ?:

In reply to Alan Cox

From: Roel Kluin <[email protected]>

---

 drivers/char/rio/rio_linux.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/char/rio/rio_linux.c +1 -1
index 2e8a6ee..ce81da5 100644
@@ -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)
author
#38 lore raw

PATCH 21/30 vcs: hook sysfs devices into object lifetime instead of "binding"

In reply to Alan Cox

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

---

 drivers/char/vc_screen.c |   16 ++++++++--------
 drivers/char/vt.c        |    5 +++--
 include/linux/console.h  |    4 ++--
 3 files changed, 13 insertions(+), 12 deletions(-)
drivers/char/vc_screen.c +8 -8
index 4f3b3f9..d94d25c 100644
@@ -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)
drivers/char/vt.c +3 -2
index 7900bd6..2c1d133 100644
@@ -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);
 }
include/linux/console.h +2 -2
index a67a90c..dcca533 100644
@@ -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
author
#39 lore raw

PATCH 22/30 jsm: define init function as __devinit

In reply to Alan Cox

From: Breno Leitao <[email protected]>

---

 drivers/serial/jsm/jsm_driver.c |    2 +-
 drivers/serial/jsm/jsm_tty.c    |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/serial/jsm/jsm_driver.c +1 -1
index e8da2f9..d2d32a1 100644
@@ -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;
drivers/serial/jsm/jsm_tty.c +2 -2
index 324c74d..3306963 100644
@@ -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;
author
#40 lore raw

PATCH 23/30 icom: remove unused variables

In reply to Alan Cox

From: Breno Leitao <[email protected]>

---

 drivers/serial/icom.c |   14 ++------------
 1 files changed, 2 insertions(+), 12 deletions(-)
drivers/serial/icom.c +2 -12
index 2b7531d..6579e2b 100644
@@ -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");
 			}
author
#41 lore raw

PATCH 24/30 isicom: isicom kref leak fix

In reply to Alan Cox

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

---

 drivers/char/isicom.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/char/isicom.c +1 -0
index 24aa6e8..a59eac5 100644
@@ -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)
author
#42 lore raw

PATCH 25/30 tty: moxa, fix refcounting in moxa_poll_port

In reply to Alan Cox

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.

---

 drivers/char/moxa.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
drivers/char/moxa.c +5 -4
index 8b0da97..4a4cab7 100644
@@ -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;
 }
author
#43 lore raw

PATCH 26/30 mxser: remove tty_port_tty_get from mxser_check_modem_status

In reply to Alan Cox

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.

---

 drivers/char/mxser.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/char/mxser.c +0 -1
index 402c9f2..a420e8d 100644
@@ -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) {
author
#44 lore raw

PATCH 27/30 ucc: Fix leaky error path

In reply to Alan Cox

Found by Daniel Marjamäki using cppcheck

---

 drivers/serial/ucc_uart.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/serial/ucc_uart.c +1 -0
index 315a933..7de66c0 100644
@@ -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;

--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#45 lore raw

PATCH 28/30 mux: fix build problem

In reply to Alan Cox

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'

---

 include/linux/serial_core.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/serial_core.h +1 -1
index df9245c..83e4b3f 100644
@@ -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
 
author
#46 lore raw

PATCH 29/30 8250_pci: add support for National Instruments 843x RS232 devices

In reply to Alan Cox

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.

---

 drivers/serial/8250_pci.c |  193 +++++++++++++++++++++++++++++++++++++++++++++
 include/linux/pci_ids.h   |   14 +++
 2 files changed, 207 insertions(+), 0 deletions(-)
drivers/serial/8250_pci.c +193 -0
index 533f820..2f570c7 100644
@@ -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,
include/linux/pci_ids.h +14 -0
index aca8c45..b3676fe 100644
@@ -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
author
#47 lore raw

PATCH 30/30 8250_pci: ni8420 support

In reply to Alan Cox

From: Will Page <[email protected]>

---

 drivers/serial/8250_pci.c |  218 +++++++++++++++++++++++++++++++++++++++++++++
 include/linux/pci_ids.h   |   12 ++
 2 files changed, 230 insertions(+), 0 deletions(-)
drivers/serial/8250_pci.c +218 -0
index 2f570c7..5b0e80d 100644
@@ -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 },
include/linux/pci_ids.h +12 -0
index b3676fe..0e4f1ed 100644
@@ -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