diff options
author | Yifeng Zhao <zyf@rock-chips.com> | 2019-01-31 16:02:06 +0800 |
---|---|---|
committer | Tao Huang <huangtao@rock-chips.com> | 2019-02-12 09:29:48 +0800 |
commit | f7468ce49e849e368709db3c594301b1d4ac1da7 (patch) | |
tree | e7213678dd081737147ec9184eb7f7306030d8ab | |
parent | bc4c7f125e28633f8df23e66ba65fe90811d0d13 (diff) |
drivers: rk_nand: fix the exception of f2fs execution discard function
If the discard_granularity of the NAND flash block device has not
been initialized, then the DM device will not set max_discard_sectors
while it is created,and f2fs will have exceptions when it performs
the discard function.
bug:
WARNING: at fs/f2fs/segment.c:1212
[ 28.075747] Hardware name: Rockchip rk3326 863 avb board (DT)
[ 28.075767] task: ffffffc03b08d100 task.stack: ffffffc02f0b4000
[ 28.075802] PC is at __submit_discard_cmd+0x1b4/0x4ec
[ 28.075840] LR is at __issue_discard_cmd+0x1b8/0x248
[ 28.075859] pc : [<ffffff800831f218>] lr : [<ffffff800831f8d0>] pstate: 60400145
[ 28.075874] sp : ffffffc02f0b7be0
Change-Id: I940728a675e7a30a05742bf2a7dcace92f7a2354
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
-rw-r--r-- | drivers/rk_nand/rk_nand_blk.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/rk_nand/rk_nand_blk.c b/drivers/rk_nand/rk_nand_blk.c index 1f24efbd69ba..e35130b4741a 100644 --- a/drivers/rk_nand/rk_nand_blk.c +++ b/drivers/rk_nand/rk_nand_blk.c @@ -676,6 +676,8 @@ static int nand_blk_register(struct nand_blk_ops *nandr) queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, nandr->rq); blk_queue_max_discard_sectors(nandr->rq, UINT_MAX >> 9); + /* discard_granularity config to one nand page size 32KB*/ + nandr->rq->limits.discard_granularity = 64 << 9; nandr->rq->queuedata = nandr; INIT_LIST_HEAD(&nandr->devs); |