提交 77e372a3 编写于 作者: S Sean Young 提交者: Greg Kroah-Hartman

tty/8250_pnp: serial port detection regression since v3.7

The InsydeH2O BIOS (version dated 09/12/2011) has the following in
its pnp resouces for its serial ports:

$ cat /sys/bus/pnp/devices/00:0b/resources
state = active
io disabled
irq disabled

We do not check if the resources are disabled, and create a bogus
ttyS* device. Since commit 835d844d (8250_pnp: do pnp probe
before legacy probe) we get a bogus ttyS0, which prevents the legacy
probe from detecting it.

Note, the BIOS can also be upgraded, fixing this problem, but for people
who can't do that, this fix is needed.
Reported-by: NVincent Deffontaines <vincent@gryzor.com>
Tested-by: NVincent Deffontaines <vincent@gryzor.com>
Signed-off-by: NSean Young <sean@mess.org>
Cc: stable@vger.kernel.org
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 064256fe
...@@ -429,6 +429,7 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) ...@@ -429,6 +429,7 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
{ {
struct uart_8250_port uart; struct uart_8250_port uart;
int ret, line, flags = dev_id->driver_data; int ret, line, flags = dev_id->driver_data;
struct resource *res = NULL;
if (flags & UNKNOWN_DEV) { if (flags & UNKNOWN_DEV) {
ret = serial_pnp_guess_board(dev); ret = serial_pnp_guess_board(dev);
...@@ -439,11 +440,12 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) ...@@ -439,11 +440,12 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
memset(&uart, 0, sizeof(uart)); memset(&uart, 0, sizeof(uart));
if (pnp_irq_valid(dev, 0)) if (pnp_irq_valid(dev, 0))
uart.port.irq = pnp_irq(dev, 0); uart.port.irq = pnp_irq(dev, 0);
if ((flags & CIR_PORT) && pnp_port_valid(dev, 2)) { if ((flags & CIR_PORT) && pnp_port_valid(dev, 2))
uart.port.iobase = pnp_port_start(dev, 2); res = pnp_get_resource(dev, IORESOURCE_IO, 2);
uart.port.iotype = UPIO_PORT; else if (pnp_port_valid(dev, 0))
} else if (pnp_port_valid(dev, 0)) { res = pnp_get_resource(dev, IORESOURCE_IO, 0);
uart.port.iobase = pnp_port_start(dev, 0); if (pnp_resource_enabled(res)) {
uart.port.iobase = res->start;
uart.port.iotype = UPIO_PORT; uart.port.iotype = UPIO_PORT;
} else if (pnp_mem_valid(dev, 0)) { } else if (pnp_mem_valid(dev, 0)) {
uart.port.mapbase = pnp_mem_start(dev, 0); uart.port.mapbase = pnp_mem_start(dev, 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册