serial: fix serial_cs I/O windows for Argosy RS-COM 2P
authorMaciej Szmigiero <mhej@o2.pl>
Thu, 1 Dec 2011 21:39:22 +0000 (22:39 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 10 Dec 2011 03:07:46 +0000 (19:07 -0800)
commit7f97c000e87751fdca69d14cba2bbba795c1a972
treefebcbb9ca2ab65cd26ed06df84981ebe8f8a3589
parent7d73aaf1d45d9bd95638680361db4d019ebb75bb
serial: fix serial_cs I/O windows for Argosy RS-COM 2P

Current serial_cs driver has a problem when trying to detect whether
a card has multiple ports: serial_config() calls pcmcia_loop_config()
which iterates over card CIS configurations by calling
serial_check_for_multi() for each of them.

This function wants to check (and select) a configuration
that has either one long I/O window spanning multiple ports or two 8-port
windows for two serial ports.

Problem is, that every pcmcia_loop_config() iteration only updates
the windows (via pcmcia_do_loop_config() in resource[0] and resource[1])
when CONF_AUTO_SET_IO flag is set on the device, which is set only later
in the code.

Fix it by setting this flag earlier.

In addition to this, when multi-port card is detected
and it does not have an one, long I/O window
multi_config_check_notpicky() tries to locate two I/O windows and assumes
they are continuous without checking.

On an Argosy RS-COM 2P this selects first configuration, which
unfortunately has two non-continuous I/O windows.
The net effect is that the second serial port on the card does not work.

Fix it by checking whether the windows are really continuous.

Signed-off-by: Maciej Szmigiero <mhej@o2.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/tty/serial/serial_cs.c
This page took 0.028775 seconds and 5 git commands to generate.