author: Zhoujie Wu <zjwu@marvell.com> 2018-10-09 13:12:14 +0200
committer: Jens Axboe <axboe@kernel.dk> 2018-10-09 08:25:08 -0600
commit: 8a57fc3823d08edb1661a06d9e0a8c2365ac561e
parent: a70985f83c625a5eaf618be81621e5e4521a66c6
Commit Summary:
Diffstat:
1 file changed, 2 insertions, 0 deletions
diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c
index e3573880dbda..e5239aba806b 100644
--- a/drivers/lightnvm/pblk-init.c
+++ b/drivers/lightnvm/pblk-init.c
@@ -407,6 +407,8 @@ static int pblk_core_init(struct pblk *pblk)
pblk->min_write_pgs = geo->ws_opt;
max_write_ppas = pblk->min_write_pgs * geo->all_luns;
pblk->max_write_pgs = min_t(int, max_write_ppas, NVM_MAX_VLBA);
+ pblk->max_write_pgs = min_t(int, pblk->max_write_pgs,
+ queue_max_hw_sectors(dev->q) / (geo->csecs >> SECTOR_SHIFT));
pblk_set_sec_per_write(pblk, pblk->min_write_pgs);
pblk->pad_dist = kcalloc(pblk->min_write_pgs - 1, sizeof(atomic64_t),