[PATCH v2 2/6] mtd: spi-nor: add erase die (chip) capability

Tudor Ambarus tudor.ambarus at linaro.org
Fri Nov 3 06:26:40 PDT 2023



On 11/3/23 12:53, Fabio Estevam wrote:
> On 03/11/2023 09:30, Fabio Estevam wrote:
> 
>> The problem I see is that the erase operation was super slow.
>>
>> Please see the timestamps to get an idea.
>>
>> Is this slow-erase behavior expected? Please note that the

No.

>> SPI controller on the i.MX8MP does not have DMA support at the moment.

We don't use DMA for erases, it doesn't matter whether you use DMA or not.

> 
> Measuring the time it takes to erase the whole flash:
> 
> root at mcde3000a:~# time flash_erase /dev/mtd0 0 0
> Erasing 131072 Kibyte @ 0 --  0 [ 1502.857687] spi-nor spi0.0: *****
> nor->reg_proto = 0x00010101
> % complete [ 1502.866354] spi-nor spi0.0: *****
> [ 1502.870631] spi-nor spi0.0: ***** op.cmd.nbytes = 0x01
> [ 1502.875891] spi-nor spi0.0: ***** op.cmd.buswidth = 0x01
> [ 1502.881311] spi-nor spi0.0: ***** op.cmd.opcode = 0xc4
> [ 1502.886559] spi-nor spi0.0: *****
> [ 1502.889888] spi-nor spi0.0: ***** op.addr.nbytes = 0x04
> [ 1502.895220] spi-nor spi0.0: ***** op.addr.buswidth = 0x01
> [ 1502.900724] spi-nor spi0.0: ***** op.addr.buswidth = 0x0
> [ 1502.906141] spi-nor spi0.0: *****
> [ 1502.909474] spi-nor spi0.0: ***** op.dummy.nbytes = 0x00
> [ 1502.914899] spi-nor spi0.0: ***** op.dummy.buswidth = 0x00
> [ 1502.920489] spi-nor spi0.0: *****
> [ 1502.923823] spi-nor spi0.0: ***** op.data.buswidth = 0x00
> [ 1502.929323] spi-nor spi0.0: ***** op.data.nbytes = 0
> [ 1620.329673] spi-nor spi0.0: ***** nor->reg_proto = 0x00010101
> [ 1620.335538] spi-nor spi0.0: *****
> [ 1620.338869] spi-nor spi0.0: ***** op.cmd.nbytes = 0x01
> [ 1620.344127] spi-nor spi0.0: ***** op.cmd.buswidth = 0x01
> [ 1620.349543] spi-nor spi0.0: ***** op.cmd.opcode = 0xc4
> [ 1620.354791] spi-nor spi0.0: *****
> [ 1620.358123] spi-nor spi0.0: ***** op.addr.nbytes = 0x04
> [ 1620.363452] spi-nor spi0.0: ***** op.addr.buswidth = 0x01
> [ 1620.368953] spi-nor spi0.0: ***** op.addr.buswidth = 0x4000000
> [ 1620.374890] spi-nor spi0.0: *****
> [ 1620.378229] spi-nor spi0.0: ***** op.dummy.nbytes = 0x00
> [ 1620.383646] spi-nor spi0.0: ***** op.dummy.buswidth = 0x00
> [ 1620.389234] spi-nor spi0.0: *****
> [ 1620.392566] spi-nor spi0.0: ***** op.data.buswidth = 0x00
> [ 1620.398068] spi-nor spi0.0: ***** op.data.nbytes = 0
> Erasing 131072 Kibyte @ 0 -- 100 % complete
> 
> real    3m56.795s
> user    0m0.001s
> sys    3m15.840s
> 
> Originally, I was also getting around 4 minutes to erase the whole flash,
> so the erase-die performance is comparable to the erase one sector at time.
> 

Which version of mtd-utils are you using? I guess the flash-erase
utility is written in a bad way. Please use the following while I check
what flash_erase is doing:

time mtd_debug erase /dev/mtd0 0 134217728

ta



More information about the linux-mtd mailing list