Bjorn Helgaas | 5 Apr 2007 00:45
Picon
Favicon

[patch 0/5] PNP: convert x86 legacy serial to platform devs, add SMC IR PNP probe

This series converts i386 and x86_64 legacy serial ports to be platform
devices and prevents probing for them if we have PNP.

This prevents double discovery, where a device was found both by the
legacy probe and by 8250_pnp.

This also prevents the serial driver from claiming IRDA devices (unless
they have a UART PNP ID).  The serial legacy probe sometimes assumed the
wrong IRQ, so the user had to use "setserial" to fix it.

Removing the need for setserial to make IRDA devices work seems good,
but it does break some things.  In particular, you may need to keep
setserial from poking legacy UART stuff back in by doing something like
"dpkg-reconfigure setserial" with the "kernel" option.  Otherwise, the
setserial-discovered "UART" will claim resources and prevent the IRDA
driver from loading.

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

Bjorn Helgaas | 5 Apr 2007 00:45
Picon
Favicon

[patch 2/5] PNP: workaround HP BIOS defect that leaves SMCF010 device partly enabled

Some HP/Compaq firmware reports via ACPI that the SMCF010 IR device is
enabled, but in fact, it leaves the device partly disabled.

HP nw8240 BIOS 68DTV Ver. F.0F, released 9/15/2005 is one BIOS that has
this problem.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas <at> hp.com>

Index: w/drivers/pnp/quirks.c
===================================================================
--- w.orig/drivers/pnp/quirks.c	2007-03-29 14:24:51.000000000 -0600
+++ w/drivers/pnp/quirks.c	2007-03-29 14:42:54.000000000 -0600
 <at>  <at>  -16,6 +16,7  <at>  <at> 
 #include <linux/string.h>
 #include <linux/slab.h>
 #include <linux/pnp.h>
+#include <linux/io.h>
 #include "base.h"

 
 <at>  <at>  -106,6 +107,34  <at>  <at> 
 	return;
 }

+static void quirk_smc_enable(struct pnp_dev *dev)
+{
+	unsigned int firbase;
+
+	if (!dev->active || !pnp_port_valid(dev, 1))
+		return;
(Continue reading)

Bjorn Helgaas | 5 Apr 2007 00:45
Picon
Favicon

[patch 4/5] smsc-ircc2: add PNP support

Claim devices using PNP, unless the user explicitly specified device
addresses.  This can be disabled with the "smsc-ircc2.nopnp" option.

This removes the need for probing legacy addresses and helps untangle
IR devices from serial8250 devices.

Sometimes the SMC device is at a legacy COM port address but does not
use the legacy COM IRQ.  In this case, claiming the device using PNP
rather than 8250 legacy probe means we can automatically use the
correct IRQ rather than forcing the user to use "setserial" to set the
IRQ manually.

If the PNP claim doesn't work, make sure you don't have a setserial init
script, e.g., /etc/init.d/setserial, configured to poke in legacy COM
port resources for the IRDA device.  That causes the serial driver to
claim resources needed by this driver.

Based on this patch by Ville Syrjälä:
    http://www.hpl.hp.com/personal/Jean_Tourrilhes/IrDA/ir260_smsc_pnp.diff

Signed-off-by: Bjorn Helgaas <bjorn.helgaas <at> hp.com>

Index: w/drivers/net/irda/smsc-ircc2.c
===================================================================
--- w.orig/drivers/net/irda/smsc-ircc2.c	2007-04-04 13:45:18.000000000 -0600
+++ w/drivers/net/irda/smsc-ircc2.c	2007-04-04 13:47:00.000000000 -0600
 <at>  <at>  -79,6 +79,10  <at>  <at> 
 MODULE_DESCRIPTION("SMC IrCC SIR/FIR controller driver");
 MODULE_LICENSE("GPL");

(Continue reading)

Bjorn Helgaas | 5 Apr 2007 00:45
Picon
Favicon

[patch 3/5] smsc-ircc2: tidy up module parameter checking

To determine whether the user specified a module parameter, use some #defines
instead of checking for bare magic numbers.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas <at> hp.com>

Index: w/drivers/net/irda/smsc-ircc2.c
===================================================================
--- w.orig/drivers/net/irda/smsc-ircc2.c	2007-04-04 13:38:30.000000000 -0600
+++ w/drivers/net/irda/smsc-ircc2.c	2007-04-04 13:45:18.000000000 -0600
 <at>  <at>  -79,11 +79,13  <at>  <at> 
 MODULE_DESCRIPTION("SMC IrCC SIR/FIR controller driver");
 MODULE_LICENSE("GPL");

-static int ircc_dma = 255;
+#define DMA_INVAL 255
+static int ircc_dma = DMA_INVAL;
 module_param(ircc_dma, int, 0);
 MODULE_PARM_DESC(ircc_dma, "DMA channel");

-static int ircc_irq = 255;
+#define IRQ_INVAL 255
+static int ircc_irq = IRQ_INVAL;
 module_param(ircc_irq, int, 0);
 MODULE_PARM_DESC(ircc_irq, "IRQ line");

 <at>  <at>  -646,7 +648,7  <at>  <at> 
 	self->io.fifo_size = SMSC_IRCC2_FIFO_SIZE;
 	self->io.speed = SMSC_IRCC2_C_IRDA_FALLBACK_SPEED;

-	if (irq < 255) {
(Continue reading)

Bjorn Helgaas | 5 Apr 2007 00:45
Picon
Favicon

[patch 1/5] PNP: notice whether we have PNP devices (PNPBIOS or PNPACPI)

If we can discover devices using PNP, we can skip some legacy probes.
This flag ("pnp_platform_devices") indicates that PNPBIOS or PNPACPI
is enabled and should tell us about builtin devices.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas <at> hp.com>

Index: work/drivers/pnp/core.c
===================================================================
--- work.orig/drivers/pnp/core.c	2007-03-27 13:05:23.000000000 -0600
+++ work/drivers/pnp/core.c	2007-03-27 16:12:54.000000000 -0600
 <at>  <at>  -23,6 +23,14  <at>  <at> 
 LIST_HEAD(pnp_global);
 DEFINE_SPINLOCK(pnp_lock);

+/*
+ * ACPI or PNPBIOS should tell us about all platform devices, so we can
+ * skip some blind probes.  ISAPNP typically enumerates only plug-in ISA
+ * devices, not built-in things like COM ports.
+ */
+int pnp_platform_devices;
+EXPORT_SYMBOL(pnp_platform_devices);
+
 void *pnp_alloc(long size)
 {
 	void *result;
Index: work/drivers/pnp/pnpacpi/core.c
===================================================================
--- work.orig/drivers/pnp/pnpacpi/core.c	2007-03-27 13:05:23.000000000 -0600
+++ work/drivers/pnp/pnpacpi/core.c	2007-03-27 14:44:05.000000000 -0600
 <at>  <at>  -247,6 +247,7  <at>  <at> 
(Continue reading)

Bjorn Helgaas | 5 Apr 2007 00:45
Picon
Favicon

[patch 5/5] x86, serial: convert legacy COM ports to platform devices

Make x86 COM ports into platform devices and don't probe for them
if we have PNP.

This prevents double discovery, where a device was found both by
the legacy probe and by 8250_pnp, e.g.,

    serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
    00:02: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A

This also means IRDA devices without a UART PNP ID will no longer be
claimed by the serial driver, which might require changes in IRDA
drivers and administration.

In addition to this patch, you may need to configure a setserial init
script, e.g., /etc/init.d/setserial, so it doesn't poke legacy UART
stuff back in.  On Debian, "dpkg-reconfigure setserial" with the "kernel"
option does this.

To force the old legacy probe behavior even when we have PNPBIOS or
ACPI, load the new legacy_serial module (or build 8250 static) with
the "legacy_serial.force" option.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas <at> hp.com>

Index: w/include/asm-i386/serial.h
===================================================================
--- w.orig/include/asm-i386/serial.h	2007-03-27 16:12:29.000000000 -0600
+++ w/include/asm-i386/serial.h	2007-03-27 16:13:04.000000000 -0600
 <at>  <at>  -11,19 +11,3  <at>  <at> 
  * megabits/second; but this requires the faster clock.
(Continue reading)

Randy Dunlap | 5 Apr 2007 01:16
Picon
Favicon

Re: [patch 4/5] smsc-ircc2: add PNP support

On Wed, 04 Apr 2007 16:45:40 -0600 Bjorn Helgaas wrote:

> Index: w/drivers/net/irda/smsc-ircc2.c
> ===================================================================
> --- w.orig/drivers/net/irda/smsc-ircc2.c	2007-04-04 13:45:18.000000000 -0600
> +++ w/drivers/net/irda/smsc-ircc2.c	2007-04-04 13:47:00.000000000 -0600
>  <at>  <at>  -79,6 +79,10  <at>  <at> 
>  MODULE_DESCRIPTION("SMC IrCC SIR/FIR controller driver");
>  MODULE_LICENSE("GPL");
>  
> +static int smsc_nopnp;
> +module_param_named(nopnp, smsc_nopnp, bool, 0);
> +MODULE_PARM_DESC(nopnp, "Do not use PNP to detect controller settings");

Document this parameter (like you did "legacy_serial.force" in the
other patch -- thanks).

>  #define DMA_INVAL 255
>  static int ircc_dma = DMA_INVAL;
>  module_param(ircc_dma, int, 0);

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
-
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

(Continue reading)

Bjorn Helgaas | 5 Apr 2007 20:45
Picon
Favicon

Re: [patch 4/5] smsc-ircc2: add PNP support

On Wednesday 04 April 2007 17:16, Randy Dunlap wrote:
> On Wed, 04 Apr 2007 16:45:40 -0600 Bjorn Helgaas wrote:
> > +static int smsc_nopnp;
> > +module_param_named(nopnp, smsc_nopnp, bool, 0);
> > +MODULE_PARM_DESC(nopnp, "Do not use PNP to detect controller settings");
> 
> Document this parameter (like you did "legacy_serial.force" in the
> other patch -- thanks).

Thanks for the reminder.  Here's an updated patch with documentation.

Subject: smsc-ircc2: add PNP support

Claim devices using PNP, unless the user explicitly specified device
addresses.  This can be disabled with the "smsc-ircc2.nopnp" option.

This removes the need for probing legacy addresses and helps untangle
IR devices from serial8250 devices.

Sometimes the SMC device is at a legacy COM port address but does not
use the legacy COM IRQ.  In this case, claiming the device using PNP
rather than 8250 legacy probe means we can automatically use the
correct IRQ rather than forcing the user to use "setserial" to set the
IRQ manually.

If the PNP claim doesn't work, make sure you don't have a setserial init
script, e.g., /etc/init.d/setserial, configured to poke in legacy COM
port resources for the IRDA device.  That causes the serial driver to
claim resources needed by this driver.

(Continue reading)

Mikhail Zolotaryov | 6 Apr 2007 17:11
Picon

[PATCH] PPC4xx UART0 (8250) problem

On PPC4xx embedded we often have UART0 on IRQ0 but 8250 UART driver uses
IRQ0 as "no irq" hack.
It's suggested that platforms with UART on IRQ0 will redefine
is_real_interrupt(irq) macro but 8250 code anyway overrides that.
As the result, serial line on UART0 works on polling-way and we have
character loss on high baud rates.

In patch I've added check if UART0 is on IRQ0, if so we define
is_real_interrupt macro to be 1 (true).
Also, check if is_real_interrupt macro is already defined added to 8250
UART driver.

--- linux-2.6.20.5.orig/include/asm-ppc/ibm4xx.h        2007-03-23
21:52:51.000000000 +0200
+++ linux-2.6.20.5/include/asm-ppc/ibm4xx.h     2007-04-06
17:37:22.000000000 +0300
 <at>  <at>  -54,6 +54,12  <at>  <at> 
 #include <platforms/4xx/xilinx_ml403.h>
 #endif

+#ifdef UART0_INT
+#if (UART0_INT == 0)
+#define is_real_interrupt(irq)  (1)
+#endif
+#endif
+
 #ifndef __ASSEMBLY__

 #ifdef CONFIG_40x
--- linux-2.6.20.5.orig/drivers/serial/8250.c   2007-03-23
(Continue reading)

Mikhail Zolotaryov | 7 Apr 2007 06:21
Picon

[PATCH] PPC4xx UART0 (8250) problem

On PPC4xx embedded we often have UART0 on IRQ0 but 8250 UART driver
uses IRQ0 as "no irq" hack. It's suggested that platforms with UART
on IRQ0 will redefine is_real_interrupt(irq) macro but 8250 code
anyway overrides that. As the result, serial line on UART0 works
on polling-way and we have character loss on high baud rates.

In patch I added check if UART0 is on IRQ0, if so we define
is_real_interrupt macro to be 1 (true). Also, check if
is_real_interrupt macro is already defined added to 8250 UART
driver.

-------------------------------------------------------------------

--- linux.orig/include/asm-ppc/ibm4xx.h        2007-03-23 21:52:51.000000000 +0200
+++ linux/include/asm-ppc/ibm4xx.h     2007-04-06 17:37:22.000000000 +0300
 <at>  <at>  -54,6 +54,12  <at>  <at> 
 #include <platforms/4xx/xilinx_ml403.h>
 #endif

+#ifdef UART0_INT
+#if (UART0_INT == 0)
+#define is_real_interrupt(irq)  (1)
+#endif
+#endif
+
 #ifndef __ASSEMBLY__

 #ifdef CONFIG_40x
--- linux.orig/drivers/serial/8250.c   2007-03-23 21:52:51.000000000 +0200
+++ linux/drivers/serial/8250.c        2007-04-06 16:44:32.000000000 +0300
(Continue reading)


Gmane