From: Alexander Sverdlin <alexander.sverdlin@nokia.com>
To: Luis Alberto Herrera <luisalberto@google.com>,
tudor.ambarus@microchip.com
Cc: Vignesh Raghavendra <vigneshr@ti.com>,
Boris Brezillon <bbrezillon@kernel.org>,
Richard Weinberger <richard@nod.at>,
Jethro Beekman <jethro@fortanix.com>,
linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
Miquel Raynal <miquel.raynal@bootlin.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: Re: [PATCH] mtd: revert "spi-nor: intel: provide a range for poll_timout"
Date: Wed, 22 Jul 2020 18:37:21 +0200 [thread overview]
Message-ID: <40ef3da0-56f4-3c78-f875-a750afaf2ec5@nokia.com> (raw)
In-Reply-To: <20200610224652.64336-1-luisalberto@google.com>
Hello Luis,
thank you for the patch!
On 11/06/2020 00:46, Luis Alberto Herrera wrote:
> This change reverts aba3a882a178: "mtd: spi-nor: intel: provide a range
> for poll_timout". That change introduces a performance regression when
> reading sequentially from flash. Logging calls to intel_spi_read without
> this change we get:
>
> Start MTD read
> [ 20.045527] intel_spi_read(from=1800000, len=400000)
> [ 20.045527] intel_spi_read(from=1800000, len=400000)
> [ 282.199274] intel_spi_read(from=1c00000, len=400000)
> [ 282.199274] intel_spi_read(from=1c00000, len=400000)
> [ 544.351528] intel_spi_read(from=2000000, len=400000)
> [ 544.351528] intel_spi_read(from=2000000, len=400000)
> End MTD read
>
> With this change:
>
> Start MTD read
> [ 21.942922] intel_spi_read(from=1c00000, len=400000)
> [ 21.942922] intel_spi_read(from=1c00000, len=400000)
> [ 23.784058] intel_spi_read(from=2000000, len=400000)
> [ 23.784058] intel_spi_read(from=2000000, len=400000)
> [ 25.625006] intel_spi_read(from=2400000, len=400000)
> [ 25.625006] intel_spi_read(from=2400000, len=400000)
> End MTD read
I've performed my testing as well and got the following results:
Vanilla Linux 4.9 (i.e. before the introduction of the offending
patch):
dd if=/dev/flash/by-name/XXX of=/dev/null bs=4k
1280+0 records in
1280+0 records out
5242880 bytes (5.2 MB, 5.0 MiB) copied, 3.91981 s, 1.3 MB/s
Vanilla 4.19 (i.e. with offending patch):
dd if=/dev/flash/by-name/XXX of=/dev/null bs=4k
1280+0 records in
1280+0 records out
5242880 bytes (5.2 MB, 5.0 MiB) copied, 6.70891 s, 781 kB/s
4.19 + revert:
dd if=/dev/flash/by-name/XXX of=/dev/null bs=4k
1280+0 records in
1280+0 records out
5242880 bytes (5.2 MB, 5.0 MiB) copied, 3.90503 s, 1.3 MB/s
Therefore it looks good from my PoV:
Tested-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
> Signed-off-by: Luis Alberto Herrera <luisalberto@google.com>
> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> ---
> drivers/mtd/spi-nor/controllers/intel-spi.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/spi-nor/controllers/intel-spi.c b/drivers/mtd/spi-nor/controllers/intel-spi.c
> index 61d2a0ad2131..2b89361a0d3a 100644
> --- a/drivers/mtd/spi-nor/controllers/intel-spi.c
> +++ b/drivers/mtd/spi-nor/controllers/intel-spi.c
> @@ -292,7 +292,7 @@ static int intel_spi_wait_hw_busy(struct intel_spi *ispi)
> u32 val;
>
> return readl_poll_timeout(ispi->base + HSFSTS_CTL, val,
> - !(val & HSFSTS_CTL_SCIP), 40,
> + !(val & HSFSTS_CTL_SCIP), 0,
> INTEL_SPI_TIMEOUT * 1000);
> }
>
> @@ -301,7 +301,7 @@ static int intel_spi_wait_sw_busy(struct intel_spi *ispi)
> u32 val;
>
> return readl_poll_timeout(ispi->sregs + SSFSTS_CTL, val,
> - !(val & SSFSTS_CTL_SCIP), 40,
> + !(val & SSFSTS_CTL_SCIP), 0,
> INTEL_SPI_TIMEOUT * 1000);
> }
>
>
--
Best regards,
Alexander Sverdlin.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2020-07-22 16:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-10 22:46 [PATCH] mtd: revert "spi-nor: intel: provide a range for poll_timout" Luis Alberto Herrera
2020-06-11 10:39 ` Mika Westerberg
2020-06-26 10:57 ` Tudor.Ambarus
2020-07-22 16:37 ` Alexander Sverdlin [this message]
2020-07-22 17:03 ` Tudor.Ambarus
2020-07-23 9:05 ` Alexander Sverdlin
2020-07-28 8:28 ` Tudor.Ambarus
2020-07-28 9:55 ` Tudor Ambarus
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=40ef3da0-56f4-3c78-f875-a750afaf2ec5@nokia.com \
--to=alexander.sverdlin@nokia.com \
--cc=bbrezillon@kernel.org \
--cc=jethro@fortanix.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=luisalberto@google.com \
--cc=mika.westerberg@linux.intel.com \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=tudor.ambarus@microchip.com \
--cc=vigneshr@ti.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 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).