Ian Abbott | 26 Nov 2004 22:29
Picon
Favicon
Gravatar

[PATCH][2.6.10-rc2-bk9] Assume struct uart_state closing times are in centiseconds

[Reposting due to Cc: address mix-up the first time!]

Hi,

The current use of close_delay and closing_wait within serial_core.c is
a little messed up for the following reasons:

* The values are scaled by uart_set_info() but not scaled back by
uart_get_info(), so the values are different unless HZ==100.

* The closing_wait value is scaled by uart_set_info() and compared to an
unscaled magic value USF_CLOSING_WAIT_NONE in uart_close().

As uart_set_info already assumes that the new values are in centisecond
units and scaling could mess up the comparison with magic values (even
if the magic values are scaled), I propose to store the raw centisecond
values in struct uart_state and scale them at the point of use.  Here is
a patch to do that.

Signed-off-by: Ian Abbott <abbotti <at> mev.co.uk>

Attachment (serial_closing_time.patch): text/x-patch, 2277 bytes

Gmane