From: Wenwei Tao <ww.tao0320@gmail.com>
To: mb@lightnvm.io
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] lightnvm: calculate device values correctly
Date: Sun, 22 Nov 2015 21:51:18 +0800 [thread overview]
Message-ID: <1448200278-10272-1-git-send-email-ww.tao0320@gmail.com> (raw)
In the original calculation, the relationships among
block, plane and lun was confusing, refine it on the
basis of Open-channelSSDInterfaceSpecification.
Signed-off-by: Wenwei Tao <ww.tao0320@gmail.com>
---
drivers/lightnvm/core.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index f659e60..1864b94 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -174,8 +174,8 @@ static int nvm_core_init(struct nvm_dev *dev)
dev->nr_chnls = grp->num_ch;
dev->luns_per_chnl = grp->num_lun;
dev->pgs_per_blk = grp->num_pg;
- dev->blks_per_lun = grp->num_blk;
dev->nr_planes = grp->num_pln;
+ dev->blks_per_lun = grp->num_blk * grp->num_pln;
dev->sec_size = grp->csecs;
dev->oob_size = grp->sos;
dev->sec_per_pg = grp->fpg_sz / grp->csecs;
@@ -191,13 +191,12 @@ static int nvm_core_init(struct nvm_dev *dev)
dev->plane_mode = NVM_PLANE_QUAD;
/* calculated values */
- dev->sec_per_pl = dev->sec_per_pg * dev->nr_planes;
- dev->sec_per_blk = dev->sec_per_pl * dev->pgs_per_blk;
+ dev->sec_per_blk = dev->sec_per_pg * dev->pgs_per_blk;
+ dev->sec_per_pl = dev->sec_per_blk * grp->num_blk;
dev->sec_per_lun = dev->sec_per_blk * dev->blks_per_lun;
dev->nr_luns = dev->luns_per_chnl * dev->nr_chnls;
- dev->total_blocks = dev->nr_planes *
- dev->blks_per_lun *
+ dev->total_blocks = dev->blks_per_lun *
dev->luns_per_chnl *
dev->nr_chnls;
dev->total_pages = dev->total_blocks * dev->pgs_per_blk;
--
1.9.1
next reply other threads:[~2015-11-22 13:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-22 13:51 Wenwei Tao [this message]
2015-11-22 14:05 ` Wenwei Tao
2015-11-22 18:34 ` Matias
2015-11-23 2:26 ` Wenwei Tao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1448200278-10272-1-git-send-email-ww.tao0320@gmail.com \
--to=ww.tao0320@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mb@lightnvm.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®