Re: [PATCH] spi: dw: fix wrong BAUDR setting after resume

From: Mark Brown

Date: Tue Jun 16 2026 - 13:32:38 EST


On Fri, Jun 12, 2026 at 08:28:35AM +0800, Jisheng Zhang wrote:

> After resuming from suspend to ram, spi transfer stops working. Further
> debugging shows that the BAUDR register isn't correctly set, this is
> due to dws->current_freq doesn't match the HW BAUDR setting,
> specifically, the dws->current_freq equals to speed_hz, but BAUDR is 0.
> so the dw_spi_set_clk() in below code won't be called:

> if (dws->current_freq != speed_hz) {
> dw_spi_set_clk(dws, clk_div);
> dws->current_freq = speed_hz;
> }

> The mismatch comes from dw_spi_shutdown_chip() when suspending.
> Fix this mismatch by setting dws->current_freq to 0 as well when
> clearing BAUDR reg in dw_spi_shutdown_chip().

Looks like the same bug exists for rx_sample_dly, that's a separate
issue though.

Attachment: signature.asc
Description: PGP signature