Re: [PATCH] serial: pnx8xxx_uart: Fix break signal handling

From: Mischa Jonker
Date: Tue Jan 13 2009 - 08:22:28 EST


On Tue, Jan 13, 2009 at 1:11 PM, Alan Cox <alan@xxxxxxxxxxxxxxxxxxx> wrote:
> On Tue, 13 Jan 2009 12:09:13 +0100
> "Jonker M.D.S.X." <nlv14114@xxxxxxxxxxxxxxxxxxx> wrote:
>
>> From: Mischa Jonker <mischa.jonker@xxxxxxx>
>>
>> When a break signal is detected, the next character should be ignored.
>> This was not implemented correctly for the pnx8xxx_uart driver.
>>
>> Signed-off-by: Mischa Jonker <mischa.jonker@xxxxxxx>
>> ---
>>
>> diff --git a/drivers/serial/pnx8xxx_uart.c b/drivers/serial/pnx8xxx_uart.c
>> index 22e30d2..1bb8f1b 100644
>> --- a/drivers/serial/pnx8xxx_uart.c
>> +++ b/drivers/serial/pnx8xxx_uart.c
>> @@ -187,7 +187,7 @@ static void pnx8xxx_rx_chars(struct pnx8xxx_port *sport)
>> status = FIFO_TO_SM(serial_in(sport, PNX8XXX_FIFO)) |
>> ISTAT_TO_SM(serial_in(sport, PNX8XXX_ISTAT));
>> while (status & FIFO_TO_SM(PNX8XXX_UART_FIFO_RXFIFO)) {
>> - ch = serial_in(sport, PNX8XXX_FIFO);
>> + ch = serial_in(sport, PNX8XXX_FIFO) & 0xff;
>
> This appears to be unrelated.
>

Correct, you can look to it as two separate bugs:
a) the next character is not ignored while it should;
b) the status bits 31-8 are copied to the 'ch' variable while they shouldn't.

Both bugs prevent correct break signal handling (and therefore correct
behaviour of the magic SysRq key). Bug b didn't cause too much trouble
earlier because in most situations the status bits are all zero; for
this case they unfortunately aren't.

I can split them up if you like, or we can keep them together, as they
are in fact related.

Thanks,

Mischa Jonker
--
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/