All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Arlott <simon@fire.lp0.eu>
To: Brian Norris <computersforpeace@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>,
	linux-mtd@lists.infradead.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Kevin Cernekee <cernekee@gmail.com>,
	bcm-kernel-feedback-list@broadcom.com
Subject: Re: [PATCH] brcmnand: Clear EXT_ADDR error registers in PIO mode
Date: Tue, 17 Nov 2015 07:41:21 +0000	[thread overview]
Message-ID: <564ADA21.8070700@simon.arlott.org.uk> (raw)
In-Reply-To: <20151117004005.GU8456@google.com>

On 17/11/15 00:40, Brian Norris wrote:
> + bcm-kernel-feedback-list
> 
> On Mon, Nov 16, 2015 at 10:05:39PM +0000, Simon Arlott wrote:
>> If an error occurs in flash above 4GB in PIO mode then the EXT_ADDR
>> registers will be set to the location of the error and never cleared.
>> 
>> Reset them to 0 before reading.
>> 
>> Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
> 
> Patch looks OK. Did you see this problem in practice, or is this just
> theoretical? I thought the documentation seemed to suggest these
> registers were cleared together with their non-_EXT counterparts. But
> implementation definitely trumps documentation for HW.

It's theoretical (I don't have 4GB+ flash), but the Broadcom version of
the NAND driver does this.

> Brian
> 
>> ---
>>  drivers/mtd/nand/brcmnand/brcmnand.c | 2 ++
>>  1 file changed, 2 insertions(+)
>> 
>> diff --git a/drivers/mtd/nand/brcmnand/brcmnand.c b/drivers/mtd/nand/brcmnand/brcmnand.c
>> index 12c6190..2c8f67f 100644
>> --- a/drivers/mtd/nand/brcmnand/brcmnand.c
>> +++ b/drivers/mtd/nand/brcmnand/brcmnand.c
>> @@ -1400,6 +1400,8 @@ static int brcmnand_read_by_pio(struct mtd_info *mtd, struct nand_chip *chip,
>>  	/* Clear error addresses */
>>  	brcmnand_write_reg(ctrl, BRCMNAND_UNCORR_ADDR, 0);
>>  	brcmnand_write_reg(ctrl, BRCMNAND_CORR_ADDR, 0);
>> +	brcmnand_write_reg(ctrl, BRCMNAND_UNCORR_EXT_ADDR, 0);
>> +	brcmnand_write_reg(ctrl, BRCMNAND_CORR_EXT_ADDR, 0);
>>  
>>  	brcmnand_write_reg(ctrl, BRCMNAND_CMD_EXT_ADDRESS,
>>  			(host->cs << 16) | ((addr >> 32) & 0xffff));
>> -- 
>> 2.1.4
>> 
>> -- 
>> Simon Arlott
> 


-- 
Simon Arlott

  reply	other threads:[~2015-11-17  7:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-16 22:05 [PATCH] brcmnand: Clear EXT_ADDR error registers in PIO mode Simon Arlott
2015-11-17  0:40 ` Brian Norris
2015-11-17  7:41   ` Simon Arlott [this message]
2015-11-17 17:55     ` Brian Norris
2015-11-20 18:42       ` Simon Arlott
2015-12-01  1:47         ` Brian Norris
2015-12-01  1:53 ` Brian Norris

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=564ADA21.8070700@simon.arlott.org.uk \
    --to=simon@fire.lp0.eu \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=cernekee@gmail.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    /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.