All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robin Gong <yibin.gong@nxp.com>
To: Marco Felsch <m.felsch@pengutronix.de>
Cc: "mark.rutland@arm.com" <mark.rutland@arm.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
	"vkoul@kernel.org" <vkoul@kernel.org>,
	"will.deacon@arm.com" <will.deacon@arm.com>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"martin.fuzzey@flowbird.group" <martin.fuzzey@flowbird.group>,
	"u.kleine-koenig@pengutronix.de" <u.kleine-koenig@pengutronix.de>,
	"dan.j.williams@intel.com" <dan.j.williams@intel.com>,
	"matthias.schiffer@ew.tq-group.com" 
	<matthias.schiffer@ew.tq-group.com>,
	"frieder.schrempf@kontron.de" <frieder.schrempf@kontron.de>,
	"r.schwebel@pengutronix.de" <r.schwebel@pengutronix.de>,
	"Benjamin.Bara@skidata.com" <Benjamin.Bara@skidata.com>,
	"Richard.Leitner@skidata.com" <Richard.Leitner@skidata.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-spi@vger.kernel.org" <linux-spi@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: RE: [PATCH v13 00/12] add ecspi ERR009165 for i.mx6/7 soc family
Date: Mon, 21 Sep 2020 08:25:16 +0000	[thread overview]
Message-ID: <VE1PR04MB66387B8FEBBC937CE0A1AC24893A0@VE1PR04MB6638.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20200911164018.6treqdmywzjhqe3a@pengutronix.de>

On 2020/09/12 0:40 Marco Felsch <m.felsch@pengutronix.de> wrote:
> Hi Robin,
> 
> I took your patches and did a few test on the mainline available
> fsl,imx6q-sabrelite. I used a vanilla linux version v5.9-rc1 for all my tests except
> the needed SPI-NOR patches [1]. Following are my results:
Marco, thanks for your test :)

> 
> Testcase 1: "Using ROM-FW"
> ===
> [OK] Playing Audio (SSI)
> [OK] TX/RX bytes on a different UART (not the serial used for
>      interaction)
> [OK] Writing to the SPI-NOR
> [OK] Doing all at the same time (once for TX and once for RX on UART)
> 
> Notes:
> - Your Patches adding a maybe noise message "sdma firmware not ready".
>   Maybe we should consider about that if it should be a warning or a info.
That means the script you're using is ram script which may not be loaded as your
case. That should be a warning I think, to avoid too much noise I have refine it
to dev_warn_once.

> 
> - For spi-nor I did run this test:
>   dd if=/dev/urandom of=/var/tmp/test1M bs=1M count=1 && \
>   flashcp -v /var/tmp/test1M /dev/mtd2
> 
>   and checked /proc/interrupts:
>   25:    2107169          0          0          0       GPC  31
> Level	2008000.spi
> 
> Testcase 2: "Using new FW from linux-firmware"
> ===
> [OK] Playing Audio (SSI)
> [OK] TX/RX bytes on a different UART (not the serial used for
>      interaction)
> [OK] Writing to the SPI-NOR
> [OK] Doing all at the same time (once for TX and once for RX on UART)
> 
> Notes:
> - For spi-nor I did run this test:
>   dd if=/dev/urandom of=/var/tmp/test1M bs=1M count=1 && \
>   flashcp -v /var/tmp/test1M /dev/mtd2
> 
>   and checked /proc/interrupts:
>   25:    2107993          0          0          0       GPC  31
> Level	2008000.spi
> 
>   I saw no SDMA interrupts during this testcase instead I saw only spi
>   controller interrupts.
That's not expected. But I have tried just now and show that SDMA interrupt
caught by spi as belows. Are you sure sdma firmware loaded indeed?

./spidev_test -D /dev/spidev0.0 -s 1200000 -b 8 -S 512 -I 1 -l 8 -S 512 -I
spi mode: 0x24
bits per word: 8
max speed: 1200000 Hz (1200 kHz)
total: tx 0.5KB, rx 0.5KB
root@imx6qpdlsolox:~# cat /proc/interrupts | grep dma
 58:          2          0       GPC   2 Level     sdma 


> 
> - According linux-firmware you did a version bump from 3.5 to 4.5 but my
>   dmesg shows:
>   imx-sdma 20ec000.sdma: loaded firmware 3.5
3.x is used for i.mx6 family while 4.x is used for i.mx7/8 since there are some
change on ROM which depended by RAM script. Not means version bump
between 3.5/4.5. 3.5 is correct on i.mx6q. 

> 
> SPI Benchmark:
> ===
> flash_erase /dev/mtd2 0 0 && \
> 	dd if=/dev/urandom of=/dev/mtd2 bs=1M count=1
> 
> - without firmware (ROM-FW)
>   1048576 bytes (1.0 MB, 1.0 MiB) copied, 51.9713 s, 20.2 kB/s
> 
> - with firmware
>   1048576 bytes (1.0 MB, 1.0 MiB) copied, 59.4174 s, 17.6 kB/s
> 
> Conclusion:
> ===
> It seems that we don't have any performance boost with your patchset instead
> we are increasing the complexity and the interrupts...
Yes, that's expected. What ERR009165 fix is data correct on spi bus though
that bring performance drop in dma mode, because the workaround just let
sdma do similar thing as cpu (PIO), while cpu running faster than sdma. If you
care much spi performance, PIO is better way. If care cpu loading, dma way
is better. 

> 
> Pls let me know if I did something wrong during testing or if my test setup was
> wrong. Note: the /dev/mtd2 isn't mainlined yet but if you use barebox you only
> have to add:
> 8<---------------------------------------------------------------------
> diff --git a/arch/arm/dts/imx6qdl-sabrelite.dtsi
> b/arch/arm/dts/imx6qdl-sabrelite.dtsi
> index ec3d364bde..256dd90a0f 100644
> --- a/arch/arm/dts/imx6qdl-sabrelite.dtsi
> +++ b/arch/arm/dts/imx6qdl-sabrelite.dtsi
> @@ -38,6 +38,11 @@
>  		label = "barebox-environment";
>  		reg = <0xe0000 0x20000>;
>  	};
> +
> +	parition@100000 {
> +		label = "user-partition";
> +		reg = <0x100000 0x100000>;
> +	};
>  };
> 
>  &ocotp {
> 8<---------------------------------------------------------------------
> to the barebox device tree.
> 
> [1]
> https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.infra
> dead.org%2Fpipermail%2Flinux-mtd%2F2020-September%2F082099.html&am
> p;data=02%7C01%7Cyibin.gong%40nxp.com%7C324d4b5c2f2344883a3108d85
> 67166f9%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C1%7C63735439234
> 6471210&amp;sdata=ru8fKz6wpDhzYeaHIT28T0OybHlCFHJ41N1lJYuqKgE%3D&
> amp;reserved=0
> 
> Regards,
>   Marco

WARNING: multiple messages have this Message-ID (diff)
From: Robin Gong <yibin.gong@nxp.com>
To: Marco Felsch <m.felsch@pengutronix.de>
Cc: "mark.rutland@arm.com" <mark.rutland@arm.com>,
	"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
	"r.schwebel@pengutronix.de" <r.schwebel@pengutronix.de>,
	"will.deacon@arm.com" <will.deacon@arm.com>,
	"Benjamin.Bara@skidata.com" <Benjamin.Bara@skidata.com>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"Richard.Leitner@skidata.com" <Richard.Leitner@skidata.com>,
	"matthias.schiffer@ew.tq-group.com"
	<matthias.schiffer@ew.tq-group.com>,
	"frieder.schrempf@kontron.de" <frieder.schrempf@kontron.de>,
	dl-linux-imx <linux-imx@nxp.com>,
	"martin.fuzzey@flowbird.group" <martin.fuzzey@flowbird.group>,
	"u.kleine-koenig@pengutronix.de" <u.kleine-koenig@pengutronix.de>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"dan.j.williams@intel.com" <dan.j.williams@intel.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-spi@vger.kernel.org" <linux-spi@vger.kernel.org>,
	"vkoul@kernel.org" <vkoul@kernel.org>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>
Subject: RE: [PATCH v13 00/12] add ecspi ERR009165 for i.mx6/7 soc family
Date: Mon, 21 Sep 2020 08:25:16 +0000	[thread overview]
Message-ID: <VE1PR04MB66387B8FEBBC937CE0A1AC24893A0@VE1PR04MB6638.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20200911164018.6treqdmywzjhqe3a@pengutronix.de>

On 2020/09/12 0:40 Marco Felsch <m.felsch@pengutronix.de> wrote:
> Hi Robin,
> 
> I took your patches and did a few test on the mainline available
> fsl,imx6q-sabrelite. I used a vanilla linux version v5.9-rc1 for all my tests except
> the needed SPI-NOR patches [1]. Following are my results:
Marco, thanks for your test :)

> 
> Testcase 1: "Using ROM-FW"
> ===
> [OK] Playing Audio (SSI)
> [OK] TX/RX bytes on a different UART (not the serial used for
>      interaction)
> [OK] Writing to the SPI-NOR
> [OK] Doing all at the same time (once for TX and once for RX on UART)
> 
> Notes:
> - Your Patches adding a maybe noise message "sdma firmware not ready".
>   Maybe we should consider about that if it should be a warning or a info.
That means the script you're using is ram script which may not be loaded as your
case. That should be a warning I think, to avoid too much noise I have refine it
to dev_warn_once.

> 
> - For spi-nor I did run this test:
>   dd if=/dev/urandom of=/var/tmp/test1M bs=1M count=1 && \
>   flashcp -v /var/tmp/test1M /dev/mtd2
> 
>   and checked /proc/interrupts:
>   25:    2107169          0          0          0       GPC  31
> Level	2008000.spi
> 
> Testcase 2: "Using new FW from linux-firmware"
> ===
> [OK] Playing Audio (SSI)
> [OK] TX/RX bytes on a different UART (not the serial used for
>      interaction)
> [OK] Writing to the SPI-NOR
> [OK] Doing all at the same time (once for TX and once for RX on UART)
> 
> Notes:
> - For spi-nor I did run this test:
>   dd if=/dev/urandom of=/var/tmp/test1M bs=1M count=1 && \
>   flashcp -v /var/tmp/test1M /dev/mtd2
> 
>   and checked /proc/interrupts:
>   25:    2107993          0          0          0       GPC  31
> Level	2008000.spi
> 
>   I saw no SDMA interrupts during this testcase instead I saw only spi
>   controller interrupts.
That's not expected. But I have tried just now and show that SDMA interrupt
caught by spi as belows. Are you sure sdma firmware loaded indeed?

./spidev_test -D /dev/spidev0.0 -s 1200000 -b 8 -S 512 -I 1 -l 8 -S 512 -I
spi mode: 0x24
bits per word: 8
max speed: 1200000 Hz (1200 kHz)
total: tx 0.5KB, rx 0.5KB
root@imx6qpdlsolox:~# cat /proc/interrupts | grep dma
 58:          2          0       GPC   2 Level     sdma 


> 
> - According linux-firmware you did a version bump from 3.5 to 4.5 but my
>   dmesg shows:
>   imx-sdma 20ec000.sdma: loaded firmware 3.5
3.x is used for i.mx6 family while 4.x is used for i.mx7/8 since there are some
change on ROM which depended by RAM script. Not means version bump
between 3.5/4.5. 3.5 is correct on i.mx6q. 

> 
> SPI Benchmark:
> ===
> flash_erase /dev/mtd2 0 0 && \
> 	dd if=/dev/urandom of=/dev/mtd2 bs=1M count=1
> 
> - without firmware (ROM-FW)
>   1048576 bytes (1.0 MB, 1.0 MiB) copied, 51.9713 s, 20.2 kB/s
> 
> - with firmware
>   1048576 bytes (1.0 MB, 1.0 MiB) copied, 59.4174 s, 17.6 kB/s
> 
> Conclusion:
> ===
> It seems that we don't have any performance boost with your patchset instead
> we are increasing the complexity and the interrupts...
Yes, that's expected. What ERR009165 fix is data correct on spi bus though
that bring performance drop in dma mode, because the workaround just let
sdma do similar thing as cpu (PIO), while cpu running faster than sdma. If you
care much spi performance, PIO is better way. If care cpu loading, dma way
is better. 

> 
> Pls let me know if I did something wrong during testing or if my test setup was
> wrong. Note: the /dev/mtd2 isn't mainlined yet but if you use barebox you only
> have to add:
> 8<---------------------------------------------------------------------
> diff --git a/arch/arm/dts/imx6qdl-sabrelite.dtsi
> b/arch/arm/dts/imx6qdl-sabrelite.dtsi
> index ec3d364bde..256dd90a0f 100644
> --- a/arch/arm/dts/imx6qdl-sabrelite.dtsi
> +++ b/arch/arm/dts/imx6qdl-sabrelite.dtsi
> @@ -38,6 +38,11 @@
>  		label = "barebox-environment";
>  		reg = <0xe0000 0x20000>;
>  	};
> +
> +	parition@100000 {
> +		label = "user-partition";
> +		reg = <0x100000 0x100000>;
> +	};
>  };
> 
>  &ocotp {
> 8<---------------------------------------------------------------------
> to the barebox device tree.
> 
> [1]
> https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.infra
> dead.org%2Fpipermail%2Flinux-mtd%2F2020-September%2F082099.html&am
> p;data=02%7C01%7Cyibin.gong%40nxp.com%7C324d4b5c2f2344883a3108d85
> 67166f9%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C1%7C63735439234
> 6471210&amp;sdata=ru8fKz6wpDhzYeaHIT28T0OybHlCFHJ41N1lJYuqKgE%3D&
> amp;reserved=0
> 
> Regards,
>   Marco

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

  reply	other threads:[~2020-09-21  8:25 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-31 16:03 [PATCH v13 00/12] add ecspi ERR009165 for i.mx6/7 soc family Robin Gong
2020-08-31 16:03 ` Robin Gong
2020-08-31 16:03 ` [PATCH v13 01/12] Revert "ARM: dts: imx6q: Use correct SDMA script for SPI5 core" Robin Gong
2020-08-31 16:03   ` Robin Gong
2020-08-31 16:03 ` [PATCH v13 02/12] Revert "ARM: dts: imx6: Use correct SDMA script for SPI cores" Robin Gong
2020-08-31 16:03   ` Robin Gong
2020-08-31 16:03 ` [PATCH v13 03/12] Revert "dmaengine: imx-sdma: refine to load context only once" Robin Gong
2020-08-31 16:03   ` Robin Gong
2020-08-31 16:03 ` [PATCH v13 04/12] dmaengine: imx-sdma: remove duplicated sdma_load_context Robin Gong
2020-08-31 16:03   ` Robin Gong
2020-08-31 16:03 ` [PATCH v13 05/12] dmaengine: dma: imx-sdma: add fw_loaded and is_ram_script Robin Gong
2020-08-31 16:03   ` Robin Gong
2020-08-31 16:03 ` [PATCH v13 06/12] dmaengine: imx-sdma: add mcu_2_ecspi script Robin Gong
2020-08-31 16:03   ` Robin Gong
2020-08-31 16:03 ` [PATCH v13 07/12] spi: imx: fix ERR009165 Robin Gong
2020-08-31 16:03   ` Robin Gong
2020-08-31 16:03 ` [PATCH v13 08/12] spi: imx: remove ERR009165 workaround on i.mx6ul Robin Gong
2020-08-31 16:03   ` Robin Gong
2020-08-31 16:03 ` [PATCH v13 09/12] dmaengine: imx-sdma: remove ERR009165 " Robin Gong
2020-08-31 16:03   ` Robin Gong
2020-08-31 16:03 ` [PATCH v13 10/12] dma: imx-sdma: add i.mx6ul compatible name Robin Gong
2020-08-31 16:03   ` Robin Gong
2020-08-31 16:03 ` [PATCH v13 11/12] dmaengine: imx-sdma: add uart rom script Robin Gong
2020-08-31 16:03   ` Robin Gong
2020-08-31 16:03 ` [PATCH v13 12/12] dmaengine: imx-sdma: add terminated list for freed descriptor in worker Robin Gong
2020-08-31 16:03   ` Robin Gong
2020-09-11 16:40 ` [PATCH v13 00/12] add ecspi ERR009165 for i.mx6/7 soc family Marco Felsch
2020-09-11 16:40   ` Marco Felsch
2020-09-21  8:25   ` Robin Gong [this message]
2020-09-21  8:25     ` Robin Gong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VE1PR04MB66387B8FEBBC937CE0A1AC24893A0@VE1PR04MB6638.eurprd04.prod.outlook.com \
    --to=yibin.gong@nxp.com \
    --cc=Benjamin.Bara@skidata.com \
    --cc=Richard.Leitner@skidata.com \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=dan.j.williams@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=frieder.schrempf@kontron.de \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=m.felsch@pengutronix.de \
    --cc=mark.rutland@arm.com \
    --cc=martin.fuzzey@flowbird.group \
    --cc=matthias.schiffer@ew.tq-group.com \
    --cc=r.schwebel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=vkoul@kernel.org \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.