]> git.ipfire.org Git - thirdparty/linux.git/commit
mtd: spi-nor: swp: check SR_TB flag when getting tb_mask
authorShiji Yang <yangshiji66@outlook.com>
Wed, 28 Jan 2026 12:42:56 +0000 (20:42 +0800)
committerPratyush Yadav (Google) <pratyush@kernel.org>
Fri, 13 Mar 2026 11:13:46 +0000 (11:13 +0000)
commit94645aa41bf9ecb87c2ce78b1c3405bfb6074a37
tree994f14a3cb71fc5531c18f77815cf6421bf7e599
parent6d660fba6a32a34ad7d746d7f65317831daaf033
mtd: spi-nor: swp: check SR_TB flag when getting tb_mask

When the chip does not support top/bottom block protect, the tb_mask
must be set to 0, otherwise SR1 bit5 will be unexpectedly modified.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Fixes: 3dd8012a8eeb ("mtd: spi-nor: add TB (Top/Bottom) protect support")
Reviewed-by: Michael Walle <mwalle@kernel.org>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Pratyush Yadav (Google) <pratyush@kernel.org>
drivers/mtd/spi-nor/swp.c