public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: "Cédric Le Goater" <clg@kaod.org>, linux-mtd@lists.infradead.org
Cc: Boris Brezillon <boris.brezillon@free-electrons.com>,
	Richard Weinberger <richard@nod.at>,
	Cyrille Pitchen <cyrille.pitchen@atmel.com>,
	Brian Norris <computersforpeace@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH 4/4] mtd: spi-nor: aspeed: use command mode for reads
Date: Thu, 20 Apr 2017 15:58:02 +0200	[thread overview]
Message-ID: <9c60f3f9-3f74-930d-07f9-9cb7cb8ba8f4@gmail.com> (raw)
In-Reply-To: <66e385ec-6688-9ce7-1250-ec840201147e@kaod.org>

On 04/20/2017 03:53 PM, Cédric Le Goater wrote:
> On 04/20/2017 03:31 PM, Marek Vasut wrote:
>> On 04/20/2017 01:56 PM, Cédric Le Goater wrote:
>>> When reading flash contents, try to use the "command mode" if the AHB
>>> window configured for the flash module is big enough. Else, just fall
>>> back to the "user mode" to perform the read.
>>>
>>> Signed-off-by: Cédric Le Goater <clg@kaod.org>
>>> ---
>>>
>>>  Changes since initial version :
>>>
>>>  - rebased on current patchset which removed DMA support
>>>
>>>  drivers/mtd/spi-nor/aspeed-smc.c | 27 ++++++++++++++++++++++++++-
>>>  1 file changed, 26 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/mtd/spi-nor/aspeed-smc.c b/drivers/mtd/spi-nor/aspeed-smc.c
>>> index 60c020482946..43015aec4557 100644
>>> --- a/drivers/mtd/spi-nor/aspeed-smc.c
>>> +++ b/drivers/mtd/spi-nor/aspeed-smc.c
>>> @@ -394,6 +394,31 @@ static ssize_t aspeed_smc_read_user(struct spi_nor *nor, loff_t from,
>>>  
>>>  	aspeed_smc_read_from_ahb(read_buf, chip->ahb_base, len);
>>>  	aspeed_smc_stop_user(nor);
>>> +	return 0;
>>> +}
>>> +
>>> +static ssize_t aspeed_smc_read(struct spi_nor *nor, loff_t from, size_t len,
>>> +			       u_char *read_buf)
>>> +{
>>> +	struct aspeed_smc_chip *chip = nor->priv;
>>> +
>>> +	/*
>>> +	 * The AHB window configured for the chip is too small for the
>>> +	 * read offset. Use the "User mode" of the controller to
>>> +	 * perform the read.
>>> +	 */
>>> +	if (from >= chip->ahb_window_size) {
>>> +		aspeed_smc_read_user(nor, from, len, read_buf);
>>> +		goto out;
>>
>> What about turning this into dumb if () {} else {} and dropping the goto ?
> 
> yes, well, this is because I have other patches adding DMAs :
> 
> 	https://github.com/legoater/linux/commit/6880924dc2cf7a47c446a708df528b72d9bf9134#diff-e466368d609006970aab53a7b840221fR575
> 
> but as of today, the benefits in speed are to be proven and the current 
> implementation does not support vmalloc'ed buffers. So I can drop the 
> goto without too much regrets (if you insist :)

Nah, if you have further plans with this code, I don't mind either way.

-- 
Best regards,
Marek Vasut

  reply	other threads:[~2017-04-20 13:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-20 11:56 [PATCH 0/4] mtd: spi-nor: aspeed: add dual read and command mode support Cédric Le Goater
2017-04-20 11:56 ` [PATCH 1/4] mtd: spi-nor: aspeed: remove dummies from keep mask Cédric Le Goater
2017-04-20 13:28   ` Marek Vasut
2017-06-20 22:25     ` Cyrille Pitchen
2017-04-20 11:56 ` [PATCH 2/4] mtd: spi-nor: aspeed: add support for SPI dual IO read mode Cédric Le Goater
2017-04-20 13:28   ` Marek Vasut
2017-06-20 22:50   ` Cyrille Pitchen
2017-06-21  7:32     ` Cédric Le Goater
2017-06-21 12:25       ` Cédric Le Goater
2017-06-21 22:46         ` Cyrille Pitchen
2017-04-20 11:56 ` [PATCH 3/4] mtd: spi-nor: aspeed: configure chip window on AHB bus Cédric Le Goater
2017-04-20 13:30   ` Marek Vasut
2017-06-20 22:34     ` Cyrille Pitchen
2017-04-20 11:56 ` [PATCH 4/4] mtd: spi-nor: aspeed: use command mode for reads Cédric Le Goater
2017-04-20 13:31   ` Marek Vasut
2017-04-20 13:33     ` Richard Weinberger
2017-04-20 13:53     ` Cédric Le Goater
2017-04-20 13:58       ` Marek Vasut [this message]
2017-06-20  7:10         ` Cédric Le Goater
2017-06-20  9:07         ` Cédric Le Goater
     [not found]           ` <2bd0b105-7652-8917-4a1d-6f218eaf848e@atmel.com>
2017-06-20 13:49             ` Cédric Le Goater
2017-06-20 14:06             ` Cédric Le Goater

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=9c60f3f9-3f74-930d-07f9-9cb7cb8ba8f4@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=clg@kaod.org \
    --cc=computersforpeace@gmail.com \
    --cc=cyrille.pitchen@atmel.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    /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