Commit f71ce0a
mtd: rawnand: serialize lock/unlock against other NAND operations
[ Upstream commit bab2bc6 ]
nand_lock() and nand_unlock() call into chip->ops.lock_area/unlock_area
without holding the NAND device lock. On controllers that implement
SET_FEATURES via multiple low-level PIO commands, these can race with
concurrent UBI/UBIFS background erase/write operations that hold the
device lock, resulting in cmd_pending conflicts on the NAND controller.
Add nand_get_device()/nand_release_device() around the lock/unlock
operations to serialize them against all other NAND controller access.
Fixes: 9227008 ("mtd: rawnand: Add support for manufacturer specific lock/unlock operation")
Signed-off-by: Kamal Dasu <kamal.dasu@broadcom.com>
Reviewed-by: William Zhang <william.zhang@broadcom.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 1bfd188 commit f71ce0a
1 file changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4868 | 4868 | | |
4869 | 4869 | | |
4870 | 4870 | | |
| 4871 | + | |
4871 | 4872 | | |
4872 | 4873 | | |
4873 | 4874 | | |
4874 | 4875 | | |
4875 | | - | |
| 4876 | + | |
| 4877 | + | |
| 4878 | + | |
| 4879 | + | |
| 4880 | + | |
4876 | 4881 | | |
4877 | 4882 | | |
4878 | 4883 | | |
| |||
4884 | 4889 | | |
4885 | 4890 | | |
4886 | 4891 | | |
| 4892 | + | |
4887 | 4893 | | |
4888 | 4894 | | |
4889 | 4895 | | |
4890 | 4896 | | |
4891 | | - | |
| 4897 | + | |
| 4898 | + | |
| 4899 | + | |
| 4900 | + | |
| 4901 | + | |
4892 | 4902 | | |
4893 | 4903 | | |
4894 | 4904 | | |
| |||
0 commit comments