Commit 5fd5c07
mtd: rawnand: serialize lock/unlock against other NAND operations
[ Upstream commit bab2bc6e850a697a23b9e5f0e21bb8c187615e95 ]
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 f8b5b83 commit 5fd5c07
1 file changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4737 | 4737 | | |
4738 | 4738 | | |
4739 | 4739 | | |
| 4740 | + | |
4740 | 4741 | | |
4741 | 4742 | | |
4742 | 4743 | | |
4743 | 4744 | | |
4744 | | - | |
| 4745 | + | |
| 4746 | + | |
| 4747 | + | |
| 4748 | + | |
| 4749 | + | |
4745 | 4750 | | |
4746 | 4751 | | |
4747 | 4752 | | |
| |||
4753 | 4758 | | |
4754 | 4759 | | |
4755 | 4760 | | |
| 4761 | + | |
4756 | 4762 | | |
4757 | 4763 | | |
4758 | 4764 | | |
4759 | 4765 | | |
4760 | | - | |
| 4766 | + | |
| 4767 | + | |
| 4768 | + | |
| 4769 | + | |
| 4770 | + | |
4761 | 4771 | | |
4762 | 4772 | | |
4763 | 4773 | | |
| |||
0 commit comments