[PATCH] spi: stm32: enable controller before asserting CS
Mark Brown
broonie at kernel.org
Fri Dec 1 13:50:33 PST 2023
On Fri, Dec 01, 2023 at 04:40:14PM -0500, Ben Wolsieffer wrote:
> This patch fixes the bug by enabling the controller in prepare_message()
> and disabling it in unprepare_message(), which are called while CS is
> not asserted.
This feels like it'd be a good fit for moving to runtime PM - that way
we avoid bouncing the controller on and off between messages which is
probably better anyway. The driver already does pinctrl management for
the device there.
> Note that bug is likely not present on the STM32H7, because it supports
> the AFCNTR bit (and this driver sets it), which keeps the SPI pins
> driven even while the controller is disabled.
It also occurs to me that this isn't going to work for devices which
chip select inverted - for them we can't stop driving chip select at all
since they need it held high when idle. There aren't that many such
devices and it'd loose us the PM which is rather awkward... I guess
that's an incremental issue with a more invasive fix though.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20231201/dacafb53/attachment.sig>
More information about the linux-arm-kernel
mailing list