summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatias Bjørling <m@bjorling.me>2016-01-12 06:49:26 (GMT)
committerJens Axboe <axboe@fb.com>2016-01-12 15:21:16 (GMT)
commit556755e941837ebc4b4859dd7f74f2ed2dd00fc7 (patch)
tree20f1875b226cb702144feea5adf53e9b450b03fc
parentb262924be03d5d2ae735bc9a4b37eb2c613f61f8 (diff)
downloadlinux-556755e941837ebc4b4859dd7f74f2ed2dd00fc7.tar.xz
lightnvm: sectors first in ppa list
The Westlake controller requires that the PPA list has sectors defined sequentially. Currently, the PPA list is created with planes first, then sectors. Change this to sectors first, then planes. Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r--drivers/lightnvm/core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index fa1a052..0c8f42f 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -245,10 +245,10 @@ int nvm_set_rqd_ppalist(struct nvm_dev *dev, struct nvm_rq *rqd,
return -ENOMEM;
}
- for (i = 0; i < nr_ppas; i++) {
- for (pl_idx = 0; pl_idx < plane_cnt; pl_idx++) {
+ for (pl_idx = 0; pl_idx < plane_cnt; pl_idx++) {
+ for (i = 0; i < nr_ppas; i++) {
ppas[i].g.pl = pl_idx;
- rqd->ppa_list[(i * plane_cnt) + pl_idx] = ppas[i];
+ rqd->ppa_list[(pl_idx * nr_ppas) + i] = ppas[i];
}
}