Linux-mtd Archive on lore.kernel.org
 help / color / Atom feed
From: John Garry <john.garry@huawei.com>
To: <Tudor.Ambarus@microchip.com>, <linux-mtd@lists.infradead.org>
Cc: broonie@kernel.org, fengsheng5@huawei.com
Subject: Re: flash_lock issue for n25q 128mb spi nor part
Date: Tue, 3 Dec 2019 15:29:08 +0000
Message-ID: <32a6af31-341b-67cf-a98d-d77a495c7ecc@huawei.com> (raw)
In-Reply-To: <9d41bfca-f4e3-beb2-ff7f-78be49e8d80e@microchip.com>

>>
>> Here's an example flow (with my hack to stop using 16b SR method):
>>
>> root@ubuntu:/home/john# flash_lock -l /dev/mtd0
>> root@ubuntu:/home/john# mtd_debug erase /dev/mtd0 0xe00000 4096
>> [   69.650642] spi-nor spi-PRP0001:00: at 0xe00000, len 4096
>> Erased 4096 bytes from address 0x00e00000 in flash
>> root@ubuntu:/home/john# mtd_debug write /dev/mtd0 0xe00000 4096 dump4096
>> [   77.093755] spi-nor spi-PRP0001:00: to 0x00e00000, len 4096
>> Copied 4096 bytes from dump4096 to address 0x00e00000 in flash
>> root@ubuntu:/home/john# mtd_debug read /dev/mtd0 0xe00000 4096 temp
>> [   82.162445] spi-nor spi-PRP0001:00: from 0x00e00000, len 4096
>> Copied 4096 bytes from address 0x00e00000 in flash to temp
>> root@ubuntu:/home/john# flash_lock -u /dev/mtd0
>> [   87.558435] spi-nor spi-PRP0001:00: SR1: read back test failed
>> flash_lock: error!: could not unlock device: /dev/mtd0
>>
>>              error 5 (Input/output error)
>> root@ubuntu:/home/john#
>>
>> Unlock reports an error as the the read back test in
>> spi_nor_write_sr1_and_check() fails as the SR.WEL has never been cleared.
>>
> 
> Interesting.

I note that spi_nor_erase() exits with a call to 
spi_nor_write_disable(), yet spi_nor_write() doesn't - maybe we should 
add a similar call there.

> 
> 
> Does the following do the trick?
> 
> -       { "n25q128a11",  INFO(0x20bb18, 0, 64 * 1024,  256, SECT_4K |
> SPI_NOR_QUAD_READ) },
> +       { "n25q128a11",  INFO(0x20bb18, 0, 64 * 1024,  256, SECT_4K | USE_FSR |
> +                             SPI_NOR_QUAD_READ) },
> 

I'll give it a spin - along with your SR lock fix - when I get back on 
the HW again.

> This can of course be extended to all micron flashes, if all support FSR, but
> some documentation work has to be made.
> 
>> I'm just saying this while it's fresh in my head - I don't want to seem
>> pushy :)
> 
> No worries, this is a good initiative, thanks.
> 

Much appreciated,
John


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply index

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-02 17:28 John Garry
2019-12-03  9:45 ` Tudor.Ambarus
2019-12-03 10:31   ` John Garry
2019-12-03 11:07     ` Tudor.Ambarus
2019-12-03 11:44       ` John Garry
2019-12-03 12:05         ` Tudor.Ambarus
2019-12-03 12:27           ` Tudor.Ambarus
2019-12-03 12:35             ` John Garry
2019-12-03 13:57               ` John Garry
2019-12-03 14:44                 ` Tudor.Ambarus
2019-12-03 15:29                   ` John Garry [this message]
2019-12-04 11:10                     ` John Garry
2019-12-03 14:16               ` [PATCH] mtd: spi-nor: Fix the write Status Register on micron flashes Tudor.Ambarus
2019-12-03 14:50                 ` [PATCH v2] mtd: spi-nor: Fix the writing of the " Tudor.Ambarus
2019-12-04 10:18                   ` John Garry

Reply instructions:

You may reply publically 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=32a6af31-341b-67cf-a98d-d77a495c7ecc@huawei.com \
    --to=john.garry@huawei.com \
    --cc=Tudor.Ambarus@microchip.com \
    --cc=broonie@kernel.org \
    --cc=fengsheng5@huawei.com \
    --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

Linux-mtd Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mtd/0 linux-mtd/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mtd linux-mtd/ https://lore.kernel.org/linux-mtd \
		linux-mtd@lists.infradead.org
	public-inbox-index linux-mtd

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-mtd


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git