linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] spi: spi-mem: Fix spi_mem_poll_status()
@ 2022-06-02  9:10 patrice.chotard
  2022-06-06 16:13 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: patrice.chotard @ 2022-06-02  9:10 UTC (permalink / raw)
  To: Mark Brown, Alexandre Torgue
  Cc: linux-spi, linux-stm32, linux-arm-kernel, linux-kernel,
	christophe.kerello, patrice.chotard

From: Patrice Chotard <patrice.chotard@foss.st.com>

In spi_mem_exec_op(), in case cs_gpiod descriptor is set, exec_op()
callback can't be used.
The same must be applied in spi_mem_poll_status(), poll_status()
callback can't be used, we must use the legacy path using
read_poll_timeout().

Tested on STM32mp257c-ev1 specific evaluation board on which a
spi-nand was mounted instead of a spi-nor.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
---
 drivers/spi/spi-mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
index e8de4f5017cd..0c79193d9697 100644
--- a/drivers/spi/spi-mem.c
+++ b/drivers/spi/spi-mem.c
@@ -808,7 +808,7 @@ int spi_mem_poll_status(struct spi_mem *mem,
 	    op->data.dir != SPI_MEM_DATA_IN)
 		return -EINVAL;
 
-	if (ctlr->mem_ops && ctlr->mem_ops->poll_status) {
+	if (ctlr->mem_ops && ctlr->mem_ops->poll_status && !mem->spi->cs_gpiod) {
 		ret = spi_mem_access_start(mem);
 		if (ret)
 			return ret;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] spi: spi-mem: Fix spi_mem_poll_status()
  2022-06-02  9:10 [PATCH 1/1] spi: spi-mem: Fix spi_mem_poll_status() patrice.chotard
@ 2022-06-06 16:13 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2022-06-06 16:13 UTC (permalink / raw)
  To: alexandre.torgue, patrice.chotard
  Cc: christophe.kerello, linux-kernel, linux-spi, linux-stm32,
	linux-arm-kernel

On Thu, 2 Jun 2022 11:10:22 +0200, patrice.chotard@foss.st.com wrote:
> From: Patrice Chotard <patrice.chotard@foss.st.com>
> 
> In spi_mem_exec_op(), in case cs_gpiod descriptor is set, exec_op()
> callback can't be used.
> The same must be applied in spi_mem_poll_status(), poll_status()
> callback can't be used, we must use the legacy path using
> read_poll_timeout().
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: spi-mem: Fix spi_mem_poll_status()
      commit: 2283679f4c468df367830b7eb8f22d48a6940e19

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-06 16:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-02  9:10 [PATCH 1/1] spi: spi-mem: Fix spi_mem_poll_status() patrice.chotard
2022-06-06 16:13 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).