Re: [PATCH v4] serial: 8250_dw: preserve BUSY-safe fractional divisor programming
From: Andy Shevchenko
Date: Tue Oct 27 2026 - 13:22:33 EST
On Tue, Oct 27, 2026 at 11:10:57AM -0600, James Hilliard wrote:
> dw8250_probe() installs a divisor setter that makes the UART idle and
> checks DLAB before writing DLL and DLH. When dw8250_setup_port() detects
> fractional-divisor support, it replaces that setter with the library's
> callback. The replacement writes DLF and uses serial8250_do_set_divisor(),
> bypassing the divisor setter's idle sequence and DLAB readback.
>
> If the LCR update fails to set DLAB, the subsequent divisor writes can
> reach TX and IER instead of DLL and DLH.
>
> Expose the library's fractional-divisor calculation and DLF write as
> shared helpers. Install the BUSY-safe setter after hardware discovery and
> use the shared DLF helper to program the fractional field only after DLAB
> has been confirmed, alongside DLL and DLH. Keep fractional-divisor
> detection and calculator selection in the library, preserving the core
> calculation for integer-only ports. Let the shared DLF setter check for
> fractional-divisor support so callers can use it for either kind of port.
Okay, this version is good enough,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
--
With Best Regards,
Andy Shevchenko