Created attachment 287951 [details] n25Q128 patch Situation- Currently, the spi-nor.c has a generic lock/unlock for the spi nor dev id - n25q128a11. Like, /* Micron <--> ST Micro */ are treated similar. The locking logic takes care of the truth table that comprises of "SEC | TB | BP2 | BP1 | BP0 ". However, the Micron 128Mb N25Q128A uses - "TB BP3 BP2 BP1 BP0". Attached is the datasheet for N25Q128A11. Problem - Since, we are not using BP3, the logic is wrong and the lock/unlock fails for this device. Tried Solution - I have tried to put the 3.x kernel solution for the n25Q128Mb flash micron for 4.12.x version and it has worked. Here is my patch for 4.12.x. But, I don't know how to put this patch for the latest kernel version - 5.6. This new version has tried to make the locking/unlocking quite generic.
Created attachment 287953 [details] n25q128 datasheet
---------- Forwarded message --------- From: <Tudor.Ambarus@microchip.com> Date: Mon, Apr 20, 2020 at 5:29 PM Subject: Re: [PATCH] driver/mtd/spi-nor: Regression lock/unlock fail To: <shreyasjoshi15@gmail.com> Cc: <marek.vasut@gmail.com>, <linux-mtd@lists.infradead.org> Hi, Shreyas, This is not a regression because locking was never enabled for n25q128a11. Please apply the following patch on spi-nor/next, it should solve your locking problems: https://patchwork.ozlabs.org/project/linux-mtd/patch/1587103677-244754-1-git-send-email-chenxiang66@hisilicon.com/