Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Norris <computersforpeace@gmail.com>
To: Aaron Wu <Aaron.wu@analog.com>
Cc: dwmw2@infradead.org, sonic.zhang@analog.com,
	linux-mtd@lists.infradead.org
Subject: Re: [PATCH] [mtd] gpio_flash: fix the bug in handling gpio flash read/write when offset + len from mtd exceeds the window size
Date: Fri, 15 Aug 2014 18:28:52 -0700	[thread overview]
Message-ID: <20140816012852.GI18411@ld-irv-0074> (raw)
In-Reply-To: <1407383029-24290-1-git-send-email-Aaron.wu@analog.com>

On Thu, Aug 07, 2014 at 11:43:49AM +0800, Aaron Wu wrote:
> Signed-off-by: Aaron Wu <Aaron.wu@analog.com>
> 
> fix the bug in handling gpio flash read/write when offset + len
> from mtd exceeds the window size

Typically, you should have the commit message comments before the
'Signed-off-by'.

> ---
>  drivers/mtd/maps/gpio-addr-flash.c |   43 ++++++++++++++++++++++++------------
>  1 file changed, 29 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/mtd/maps/gpio-addr-flash.c b/drivers/mtd/maps/gpio-addr-flash.c
> index a4c477b..947631a 100644
> --- a/drivers/mtd/maps/gpio-addr-flash.c
> +++ b/drivers/mtd/maps/gpio-addr-flash.c
> @@ -99,22 +99,29 @@ static map_word gf_read(struct map_info *map, unsigned long ofs)
>   *	@from: flash offset to copy from
>   *	@len:  how much to copy
>   *
> - * We rely on the MTD layer to chunk up copies such that a single request here
> - * will not cross a window size.  This allows us to only wiggle the GPIOs once
> - * before falling back to a normal memcpy.  Reading the higher layer code shows
> - * that this is indeed the case, but add a BUG_ON() to future proof.
> + *Toggle the correct GPIO according to @from to enable the right flash bank,
> + *still the read offset plus len may execceds the actual Window size,when
> + *this happnes, reverts the value for multiple read until all data is read.
>   */

The spacing and wording is a little off, so I reworded this. Queued to
l2-mtd.git/next, with the following diff applied:

diff --git a/drivers/mtd/maps/gpio-addr-flash.c b/drivers/mtd/maps/gpio-addr-flash.c
index 947631a329f7..2fb346091af2 100644
--- a/drivers/mtd/maps/gpio-addr-flash.c
+++ b/drivers/mtd/maps/gpio-addr-flash.c
@@ -99,9 +99,8 @@ static map_word gf_read(struct map_info *map, unsigned long ofs)
  *	@from: flash offset to copy from
  *	@len:  how much to copy
  *
- *Toggle the correct GPIO according to @from to enable the right flash bank,
- *still the read offset plus len may execceds the actual Window size,when
- *this happnes, reverts the value for multiple read until all data is read.
+ * The "from" region may straddle more than one window, so toggle the GPIOs for
+ * each window region before reading its data.
  */
 static void gf_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
 {

Thanks,
Brian

      reply	other threads:[~2014-08-16  1:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-07  3:43 [PATCH] [mtd] gpio_flash: fix the bug in handling gpio flash read/write when offset + len from mtd exceeds the window size Aaron Wu
2014-08-16  1:28 ` Brian Norris [this message]

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=20140816012852.GI18411@ld-irv-0074 \
    --to=computersforpeace@gmail.com \
    --cc=Aaron.wu@analog.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=sonic.zhang@analog.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