[PATCH v6 00/28] mtd: spi-nor: Enhance software protection
Pratyush Yadav
pratyush at kernel.org
Tue May 26 08:35:23 PDT 2026
On Tue, May 26 2026, Miquel Raynal wrote:
> Hello,
>
> Back in October 2025, the "locking" support in SPI NOR was discussed on
> the mailing list (link below). The conclusion was that this support
> could benefit from some enhancements. As I myself had to dig into it,
> here is a proposal.
>
> First issue that I see, the MEMLOCK ioctl is not behaving correctly
> in some cases, as addressed in:
>
> mtd: spi-nor: swp: Improve locking user experience
>
> Then there is no clear explanation of the shortcuts taken by the kernel
> in terms of uAPI, so there is an attempt to list them in:
>
> mtd: spi-nor: swp: Explain the MEMLOCK ioctl implementation behaviour
>
> Plus, Tudor also asked if we could cover locking in the testing
> procedure, which is done in:
>
> mtd: spi-nor: Add steps for testing locking support
>
> In order to simplify this procedure, and because it got very helpful
> during my testing/development, I want to propose additions to the
> debugfs output:
>
> mtd: spi-nor: debugfs: Add locking support TODO: make the captures again
>
> Finally, I am providing an implementation for the complement (CMP)
> feature in order to allow finer control of the regions locked. This
> feature is for instance available on Winbond chips:
>
> [core] mtd: spi-nor: swp: Add support for the complement feature
> [doc] mtd: spi-nor: Add steps for testing locking with CMP
> [use] mtd: spi-nor: winbond: Add CMP locking support
>
> Disclaimer: it was much less straightforward than I initially thought to
> get the CMP feature working correctly. I tested it with as much focus as
> I could, and I am improving the test coverage for the new cases, I am
> also providing extra test cases in the metadata of the commit (which do
> not make sense to test for chip additions, but may be sensible show when
> making core additions like this one), but honestly there are so many
> possibilities, I may still be missing corner cases. I hope this will
> anyway be helpful to others!
>
> All the other patches are misc improvements or style fixes which I faced
> and fixed during my development.
>
> Link: https://lore.kernel.org/linux-mtd/92e99a96-5582-48a5-a4f9-e9b33fcff171@linux.dev/
>
> Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>
Applied to spi-nor/next. This should give us around 3 weeks to soak in
linux next. Expect the SPI NOR PR a little bit later than usual, around
the start of the merge window so we can maximize the exposure of these
patches.
Apologies once again for the crappy contributor experience, I tried to
get to this sooner, but wasn't much successful at it :-/
[...]
--
Regards,
Pratyush Yadav
More information about the linux-mtd
mailing list