All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: atmel-quadspi: Use optimezed memcpy_fromio()/memcpy_toio()
@ 2020-07-16  4:31 ` Tudor Ambarus
  0 siblings, 0 replies; 4+ messages in thread
From: Tudor Ambarus @ 2020-07-16  4:31 UTC (permalink / raw)
  To: broonie
  Cc: linux-spi, nicolas.ferre, alexandre.belloni, ludovic.desroches,
	linux-kernel, linux-arm-kernel, Tudor Ambarus

Optimezed mem*io operations are defined for LE platforms, use them.

The ARM and !ARCH_EBSA110 dependencies for COMPILE_TEST were added
only for the _memcpy_fromio()/_memcpy_toio() functions. Drop these
dependencies.

Tested unaligned accesses on both sama5d2 and sam9x60 QSPI controllers
using SPI NOR flashes, everything works ok. The following performance
improvement can be seen when running mtd_speedtest:

sama5d2_xplained (mx25l25635e)
- before:
	mtd_speedtest: eraseblock write speed is 983 KiB/s
	mtd_speedtest: eraseblock read speed is 6150 KiB/s
- after:
	mtd_speedtest: eraseblock write speed is 1055 KiB/s
	mtd_speedtest: eraseblock read speed is 20144 KiB/s

sam9x60ek (sst26vf064b)
- before:
	mtd_speedtest: eraseblock write speed is 4770 KiB/s
	mtd_speedtest: eraseblock read speed is 8062 KiB/s
- after:
	mtd_speedtest: eraseblock write speed is 4524 KiB/s
	mtd_speedtest: eraseblock read speed is 21186 KiB/s

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 drivers/spi/Kconfig         | 2 +-
 drivers/spi/atmel-quadspi.c | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index fd64c865f6ef..b89d03a36cbd 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -103,7 +103,7 @@ config SPI_AT91_USART
 
 config SPI_ATMEL_QUADSPI
 	tristate "Atmel Quad SPI Controller"
-	depends on ARCH_AT91 || (ARM && COMPILE_TEST && !ARCH_EBSA110)
+	depends on ARCH_AT91 || COMPILE_TEST
 	depends on OF && HAS_IOMEM
 	help
 	  This enables support for the Quad SPI controller in master mode.
diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c
index a898755fb41e..8c009c175f2c 100644
--- a/drivers/spi/atmel-quadspi.c
+++ b/drivers/spi/atmel-quadspi.c
@@ -430,11 +430,11 @@ static int atmel_qspi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op)
 
 		/* Send/Receive data */
 		if (op->data.dir == SPI_MEM_DATA_IN)
-			_memcpy_fromio(op->data.buf.in, aq->mem + offset,
-				       op->data.nbytes);
+			memcpy_fromio(op->data.buf.in, aq->mem + offset,
+				      op->data.nbytes);
 		else
-			_memcpy_toio(aq->mem + offset, op->data.buf.out,
-				     op->data.nbytes);
+			memcpy_toio(aq->mem + offset, op->data.buf.out,
+				    op->data.nbytes);
 
 		/* Release the chip-select */
 		atmel_qspi_write(QSPI_CR_LASTXFER, aq, QSPI_CR);
-- 
2.25.1


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

* [PATCH] spi: atmel-quadspi: Use optimezed memcpy_fromio()/memcpy_toio()
@ 2020-07-16  4:31 ` Tudor Ambarus
  0 siblings, 0 replies; 4+ messages in thread
From: Tudor Ambarus @ 2020-07-16  4:31 UTC (permalink / raw)
  To: broonie
  Cc: alexandre.belloni, Tudor Ambarus, linux-kernel,
	ludovic.desroches, linux-spi, linux-arm-kernel

Optimezed mem*io operations are defined for LE platforms, use them.

The ARM and !ARCH_EBSA110 dependencies for COMPILE_TEST were added
only for the _memcpy_fromio()/_memcpy_toio() functions. Drop these
dependencies.

Tested unaligned accesses on both sama5d2 and sam9x60 QSPI controllers
using SPI NOR flashes, everything works ok. The following performance
improvement can be seen when running mtd_speedtest:

sama5d2_xplained (mx25l25635e)
- before:
	mtd_speedtest: eraseblock write speed is 983 KiB/s
	mtd_speedtest: eraseblock read speed is 6150 KiB/s
- after:
	mtd_speedtest: eraseblock write speed is 1055 KiB/s
	mtd_speedtest: eraseblock read speed is 20144 KiB/s

sam9x60ek (sst26vf064b)
- before:
	mtd_speedtest: eraseblock write speed is 4770 KiB/s
	mtd_speedtest: eraseblock read speed is 8062 KiB/s
- after:
	mtd_speedtest: eraseblock write speed is 4524 KiB/s
	mtd_speedtest: eraseblock read speed is 21186 KiB/s

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 drivers/spi/Kconfig         | 2 +-
 drivers/spi/atmel-quadspi.c | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index fd64c865f6ef..b89d03a36cbd 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -103,7 +103,7 @@ config SPI_AT91_USART
 
 config SPI_ATMEL_QUADSPI
 	tristate "Atmel Quad SPI Controller"
-	depends on ARCH_AT91 || (ARM && COMPILE_TEST && !ARCH_EBSA110)
+	depends on ARCH_AT91 || COMPILE_TEST
 	depends on OF && HAS_IOMEM
 	help
 	  This enables support for the Quad SPI controller in master mode.
diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c
index a898755fb41e..8c009c175f2c 100644
--- a/drivers/spi/atmel-quadspi.c
+++ b/drivers/spi/atmel-quadspi.c
@@ -430,11 +430,11 @@ static int atmel_qspi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op)
 
 		/* Send/Receive data */
 		if (op->data.dir == SPI_MEM_DATA_IN)
-			_memcpy_fromio(op->data.buf.in, aq->mem + offset,
-				       op->data.nbytes);
+			memcpy_fromio(op->data.buf.in, aq->mem + offset,
+				      op->data.nbytes);
 		else
-			_memcpy_toio(aq->mem + offset, op->data.buf.out,
-				     op->data.nbytes);
+			memcpy_toio(aq->mem + offset, op->data.buf.out,
+				    op->data.nbytes);
 
 		/* Release the chip-select */
 		atmel_qspi_write(QSPI_CR_LASTXFER, aq, QSPI_CR);
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] spi: atmel-quadspi: Use optimezed memcpy_fromio()/memcpy_toio()
  2020-07-16  4:31 ` Tudor Ambarus
@ 2020-07-16 23:58   ` Mark Brown
  -1 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2020-07-16 23:58 UTC (permalink / raw)
  To: Tudor Ambarus
  Cc: linux-spi, linux-kernel, linux-arm-kernel, ludovic.desroches,
	alexandre.belloni

On Thu, 16 Jul 2020 07:31:39 +0300, Tudor Ambarus wrote:
> Optimezed mem*io operations are defined for LE platforms, use them.
> 
> The ARM and !ARCH_EBSA110 dependencies for COMPILE_TEST were added
> only for the _memcpy_fromio()/_memcpy_toio() functions. Drop these
> dependencies.
> 
> Tested unaligned accesses on both sama5d2 and sam9x60 QSPI controllers
> using SPI NOR flashes, everything works ok. The following performance
> improvement can be seen when running mtd_speedtest:
> 
> [...]

Applied to

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

Thanks!

[1/1] spi: atmel-quadspi: Use optimezed memcpy_fromio()/memcpy_toio()
      commit: b780c3f38812bce7d7baebe2108738a043d6c4c3

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

* Re: [PATCH] spi: atmel-quadspi: Use optimezed memcpy_fromio()/memcpy_toio()
@ 2020-07-16 23:58   ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2020-07-16 23:58 UTC (permalink / raw)
  To: Tudor Ambarus
  Cc: alexandre.belloni, ludovic.desroches, linux-kernel,
	linux-arm-kernel, linux-spi

On Thu, 16 Jul 2020 07:31:39 +0300, Tudor Ambarus wrote:
> Optimezed mem*io operations are defined for LE platforms, use them.
> 
> The ARM and !ARCH_EBSA110 dependencies for COMPILE_TEST were added
> only for the _memcpy_fromio()/_memcpy_toio() functions. Drop these
> dependencies.
> 
> Tested unaligned accesses on both sama5d2 and sam9x60 QSPI controllers
> using SPI NOR flashes, everything works ok. The following performance
> improvement can be seen when running mtd_speedtest:
> 
> [...]

Applied to

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

Thanks!

[1/1] spi: atmel-quadspi: Use optimezed memcpy_fromio()/memcpy_toio()
      commit: b780c3f38812bce7d7baebe2108738a043d6c4c3

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2020-07-16 23:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-16  4:31 [PATCH] spi: atmel-quadspi: Use optimezed memcpy_fromio()/memcpy_toio() Tudor Ambarus
2020-07-16  4:31 ` Tudor Ambarus
2020-07-16 23:58 ` Mark Brown
2020-07-16 23:58   ` 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.