mtd: spi-nor: swp: Explain the MEMLOCK ioctl implementation behaviour

Add more details about how these requests are actually handled in the
SPI NOR core. Their behaviour was not entirely clear to me at first, and
explaining them in plain English sounds the way to go.

Reviewed-by: Michael Walle <mwalle@kernel.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Pratyush Yadav <pratyush@kernel.org>
This commit is contained in:
Miquel Raynal 2026-05-26 16:56:32 +02:00 committed by Pratyush Yadav
parent 461e2f8a2d
commit 5eeff82d38

View File

@ -279,9 +279,14 @@ struct spi_nor_erase_map {
/**
* struct spi_nor_locking_ops - SPI NOR locking methods
* @lock: lock a region of the SPI NOR.
* @unlock: unlock a region of the SPI NOR.
* @is_locked: check if a region of the SPI NOR is completely locked
* @lock: lock a region of the SPI NOR, never locks more than what is
* requested, ie. may lock less.
* @unlock: unlock a region of the SPI NOR, may unlock more than what is
* requested.
* @is_locked: check if a region of the SPI NOR is completely locked, returns
* false otherwise. This feedback may be misleading because users
* may get an "unlocked" status even though a subpart of the region
* is effectively locked.
*/
struct spi_nor_locking_ops {
int (*lock)(struct spi_nor *nor, loff_t ofs, u64 len);