public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] cfi: fix the incomplete erased status check in buffer write
Date: Tue, 6 Mar 2012 15:51:25 +0100	[thread overview]
Message-ID: <201203061551.25332.sr@denx.de> (raw)
In-Reply-To: <1329652117-14084-1-git-send-email-hotforest@gmail.com>

Hi "htbegin",

first sorry for the late review.

On Sunday 19 February 2012 12:48:37 htbegin wrote:
> Without the fix, flash_write_cfibuffer will return timeout error
> instead of not-erased error when all bytes in the first word of
> a sector are 0xFF and other words are not.
> 
> Signed-off-by: htbegin <hotforest@gmail.com>

Please use your real name here in the s-o-b line.

> ---
>  drivers/mtd/cfi_flash.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
> index 722c3fc..35294bc 100644
> --- a/drivers/mtd/cfi_flash.c
> +++ b/drivers/mtd/cfi_flash.c
> @@ -873,7 +873,7 @@ static int flash_write_cfibuffer (flash_info_t * info,
> ulong dest, uchar * cp, void *src = cp;
>  	void *dst = (void *)dest;
>  	void *dst2 = dst;
> -	int flag = 0;
> +	int flag = 1;
>  	uint offset = 0;
>  	unsigned int shift;
>  	uchar write_cmd;
> @@ -898,7 +898,7 @@ static int flash_write_cfibuffer (flash_info_t * info,
> ulong dest, uchar * cp,
> 
>  	cnt = len >> shift;
> 
> -	while ((cnt-- > 0) && (flag == 0)) {
> +	while ((cnt-- > 0) && (flag == 1)) {
>  		switch (info->portwidth) {
>  		case FLASH_CFI_8BIT:
>  			flag = ((flash_read8(dst2) & flash_read8(src)) ==

I checked your patch, and it seems to me that you have spotted a problem. But 
your problem description above doesn't seem to be totally correct. From my 
understanding, the loop checking for not erased flash aborts directly once 
0xff is found. So that the check doesn't continue till the first non-0xff word 
as it should be.

Can you confirm this? Then please re-send you patch with a new patch 
description and a correct name in the Signed-off-by line.

Thanks.

Best regards,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

  reply	other threads:[~2012-03-06 14:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-19 11:48 [U-Boot] [PATCH] cfi: fix the incomplete erased status check in buffer write htbegin
2012-03-06 14:51 ` Stefan Roese [this message]
2012-03-15 15:33   ` [U-Boot] [PATCH v2] " htbegin

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=201203061551.25332.sr@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /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