Re: [PATCH v2 0/3] mtd: spi-nor: winbond: Fix protection handling

From: Pratyush Yadav

Date: Mon Mar 30 2026 - 11:20:30 EST


On Mon, Mar 30 2026, Miquel Raynal wrote:

>>> The devices do not correctly describe their Status Register layout and
>>> protection capabilities (locking flags, TB bit, BP bit configuration).
>>> As a result, the spi-nor core rejects protection requests and locking
>>> operations fail with -EINVAL, e.g.:
>>>
>>> flash_lock -l /dev/mtd29
>>> flash_lock: error!: could not lock device: /dev/mtd29
>>> error 22 (Invalid argument)
>>>
>>> Update the device flags to match the actual hardware behavior so that
>>> locking and unlocking regions work correctly.
>>>
>>> All changes were validated using flash_lock on the affected devices.
>>
>> Applied patches 1 and 3 to spi-nor/next. Thanks!
>>
>> Skipped patch 2 since you say that you haven't got a device to test
>> with. I don't have a very strong opinion on this, but I do think we
>> should test patches on real hardware just to we get some sanity checking
>> for the patch.
>
> Honestly, I am pretty convinced patch 2 cannot make more harm as the
> block protection is already badly broken by not being described at
> all. Furthermore, for similar chips I have, these bits are relevant, so
> I would rather be in favour of going forward with patch 2, because at
> most it will just not fix the behaviour as it pretends it does.
>
> My 2cts :)

Hmm, okay, I'll apply that one too then.

--
Regards,
Pratyush Yadav