lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aa083709-c3e2-f075-1a99-c31399a1cb77@gmail.com>
Date:   Wed, 23 May 2018 14:54:17 +0200
From:   Marek Vasut <marek.vasut@...il.com>
To:     Tudor Ambarus <tudor.ambarus@...rochip.com>,
        cyrille.pitchen@...rochip.com, dwmw2@...radead.org,
        computersforpeace@...il.com, boris.brezillon@...tlin.com,
        richard@....at
Cc:     linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org,
        nicolas.ferre@...rochip.com, Cristian.Birsan@...rochip.com
Subject: Re: [RFC PATCH] mtd: spi-nor: add support to non-uniform SPI NOR
 flash memories

On 05/23/2018 02:52 PM, Tudor Ambarus wrote:
> Hi, Marek,

Hi,

> On 05/23/2018 12:56 PM, Marek Vasut wrote:
> [...]
>>>> [...]
>>>>
>>>>>>> +    while (len) {
>>>>>>> +        cmd = spi_nor_find_best_erase_cmd(map, region, addr, len);
>>>>>>> +        if (!cmd)
>>>>>>> +            return -EINVAL;
>>>>>> What would happen if you realize mid-way that you cannot erase some
>>>>>> sector , do you end up with partial erase ?
>>>>> Is this possible? In non-overlaid regions, the address is aligned with
>>>>> at least one of the erase commands, else -EINVAL. For overlaid regions
>>>>> alignment doesn't matter. But yes, if this is possible, in this case,
>>>>> this proposal will do a partial erase.
>>>> Shouldn't we fail up front instead ?
>>> It will be great if we can do this without having performance penalties.
>>> Can we loose the conditions for the last erase command? If one wants to
>>> erase 80k chunk starting from offset 0 and only 32k and 64k erase type
>>> are supported, can we erase 96k?
>> No. But can you maybe build a list of erase commands to be executed once
>> you validate that the erase can be performed for example ?
> 
> My second choice was an array witch saves u8 opcode and u32 erasesize.
> There are flashes of 256MB, in the worst case scenario with 4k erase
> type, we will end up with 64K entries.

Some RLE encoding might help here ?

> How about enforcing the length to be multiple of mtd->erasesize, like we
> do in uniform_erase? With this, the problem disappears.

What is the erase size for the 4k-sector 256MiB flash ?

-- 
Best regards,
Marek Vasut

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ