Re: [PATCH v2] serial_core: fix uart PORT_UNKNOWN handling

From: One Thousand Gnomes
Date: Wed Apr 23 2014 - 08:36:50 EST


On Wed, 23 Apr 2014 12:33:22 +0200
Thomas Pfaff <tpfaff@xxxxxxx> wrote:

> From: "Thomas Pfaff" <tpfaff@xxxxxxx>
>
> 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@xxxxxxx>
Reviewed-by: Alan Cox <alan@xxxxxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/