Re: [PATCH] serial 8250: tighten test for using backup timer

From: Alex Williamson
Date: Tue Aug 05 2008 - 16:07:26 EST


Hi Will,

On Tue, 2008-08-05 at 12:44 +0100, Will Newton wrote:
> Hi,
>
> Sorry to not have picked up on this earlier, but this change seems to
> break an old DesignWare UART I have in an SoC here. It has a number of
> known issues, one of which is it does not appropriately reassert THRE.
>
> What seems to happen is that the first time the port is opened the
> code tests for incorrect reassertion of THRE and correctly sets up the
> backup timer. The port is closed and subsequently reopened and this
> time around the new logic prevents the backup timer from being
> enabled. I'm not 100% sure of the details of the bug that is being
> worked around here, but it appears that the second time the port is
> opened it is not possible to detect the bug because the previous THRE
> condition has already been acknowledged.
>
> The attached patch fixes the problem for me and attempts to preserve
> the new behaviour at the same time. Comments?

It would be nice if there was a simple procedure we could do on the UART
to reset it to a state so the test works repeatedly. However, with all
the buggy UARTs out there, that could end up disturbing someone else.

This change works for me, though it is using up a bit in the bugs field;
not that we seem to be allocating them at any great rate. I think it
would be worthy of a comment in the code to understand why this new
block exists outside the test so we don't need to refer back to the
commit changeset.

Acked-by: Alex Williamson <alex.williamson@xxxxxx>

Thanks, Alex

--
Alex Williamson HP Open Source & Linux Org.

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