All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: bcm-qspi: fix MSPI only access with bcm_qspi_exec_mem_op()
@ 2022-03-28 14:24 Kamal Dasu
  2022-03-28 17:57 ` Florian Fainelli
  2022-04-07 17:12 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Kamal Dasu @ 2022-03-28 14:24 UTC (permalink / raw)
  To: Kamal Dasu, bcm-kernel-feedback-list, Mark Brown, Boris Brezillon
  Cc: linux-spi, linux-kernel

This fixes case where MSPI controller is used to access spi-nor
flash and BSPI block is not present.

Fixes: 5f195ee7d830 ("spi: bcm-qspi: Implement the spi_mem interface")
Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
---
 drivers/spi/spi-bcm-qspi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-bcm-qspi.c b/drivers/spi/spi-bcm-qspi.c
index 86c76211b3d3..cad2d55dcd3d 100644
--- a/drivers/spi/spi-bcm-qspi.c
+++ b/drivers/spi/spi-bcm-qspi.c
@@ -1205,7 +1205,7 @@ static int bcm_qspi_exec_mem_op(struct spi_mem *mem,
 	addr = op->addr.val;
 	len = op->data.nbytes;
 
-	if (bcm_qspi_bspi_ver_three(qspi) == true) {
+	if (has_bspi(qspi) && bcm_qspi_bspi_ver_three(qspi) == true) {
 		/*
 		 * The address coming into this function is a raw flash offset.
 		 * But for BSPI <= V3, we need to convert it to a remapped BSPI
@@ -1224,7 +1224,7 @@ static int bcm_qspi_exec_mem_op(struct spi_mem *mem,
 	    len < 4)
 		mspi_read = true;
 
-	if (mspi_read)
+	if (!has_bspi(qspi) || mspi_read)
 		return bcm_qspi_mspi_exec_mem_op(spi, op);
 
 	ret = bcm_qspi_bspi_set_mode(qspi, op, 0);
-- 
2.17.1


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

* Re: [PATCH] spi: bcm-qspi: fix MSPI only access with bcm_qspi_exec_mem_op()
  2022-03-28 14:24 [PATCH] spi: bcm-qspi: fix MSPI only access with bcm_qspi_exec_mem_op() Kamal Dasu
@ 2022-03-28 17:57 ` Florian Fainelli
  2022-04-07 17:12 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2022-03-28 17:57 UTC (permalink / raw)
  To: Kamal Dasu, bcm-kernel-feedback-list, Mark Brown, Boris Brezillon
  Cc: linux-spi, linux-kernel

On 3/28/22 07:24, Kamal Dasu wrote:
> This fixes case where MSPI controller is used to access spi-nor
> flash and BSPI block is not present.
> 
> Fixes: 5f195ee7d830 ("spi: bcm-qspi: Implement the spi_mem interface")
> Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

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

* Re: [PATCH] spi: bcm-qspi: fix MSPI only access with bcm_qspi_exec_mem_op()
  2022-03-28 14:24 [PATCH] spi: bcm-qspi: fix MSPI only access with bcm_qspi_exec_mem_op() Kamal Dasu
  2022-03-28 17:57 ` Florian Fainelli
@ 2022-04-07 17:12 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2022-04-07 17:12 UTC (permalink / raw)
  To: bbrezillon, bcm-kernel-feedback-list, kdasu.kdev; +Cc: linux-spi, linux-kernel

On Mon, 28 Mar 2022 10:24:42 -0400, Kamal Dasu wrote:
> This fixes case where MSPI controller is used to access spi-nor
> flash and BSPI block is not present.
> 
> 

Applied to

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

Thanks!

[1/1] spi: bcm-qspi: fix MSPI only access with bcm_qspi_exec_mem_op()
      commit: 2c7d1b281286c46049cd22b43435cecba560edde

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] 3+ messages in thread

end of thread, other threads:[~2022-04-07 17:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-28 14:24 [PATCH] spi: bcm-qspi: fix MSPI only access with bcm_qspi_exec_mem_op() Kamal Dasu
2022-03-28 17:57 ` Florian Fainelli
2022-04-07 17:12 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.