Thomas Pfaff 7deb39ed8d serial_core: fix uart PORT_UNKNOWN handling
While porting a RS485 driver from 2.6.29 to 3.14, i noticed that the serial tty
driver could break it by using uart ports that it does not own :

1. uart_change_pm ist called during uart_open and calls the uart pm function
   without checking for PORT_UNKNOWN.
   The fix is to move uart_change_pm from uart_open to uart_port_startup.
2. The return code from the uart request_port call in uart_set_info is not
   handled properly, leading to the situation that the serial driver also
   thinks it owns the uart ports.
   This can triggered by doing following actions :

   setserial /dev/ttyS0 uart none    # release the uart ports
   modprobe lirc-serial              # or any other device that uses the uart
   setserial /dev/ttyS0 uart 16550   # gives no error and the uart tty driver
                                     # can use the ports as well

Signed-off-by: Thomas Pfaff <tpfaff@pcs.com>
Reviewed-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-24 15:38:22 -07:00
..
2014-02-28 16:31:00 -08:00
2014-02-28 16:25:47 -08:00
2013-01-15 22:30:15 -08:00
2013-03-18 16:24:29 -07:00
2011-03-31 11:26:23 -03:00
2013-12-08 16:56:05 -08:00
2014-02-13 10:18:48 -08:00
2013-10-16 13:08:16 -07:00
2013-07-24 15:12:53 -07:00
2014-03-17 16:13:23 -07:00
2014-03-17 16:13:23 -07:00
2014-04-16 14:31:13 -07:00