[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b070eb2a-05d7-4e6a-8de9-15179045d192@sirena.org.uk>
Date: Fri, 1 Dec 2023 21:50:33 +0000
From: Mark Brown <broonie@...nel.org>
To: Ben Wolsieffer <ben.wolsieffer@...ring.com>
Cc: linux-spi@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Alain Volmat <alain.volmat@...s.st.com>
Subject: Re: [PATCH] spi: stm32: enable controller before asserting CS
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.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists