Re: [PATCH] lightnvm: pblk: remove unnecessary drive version check

From: Matias BjÃrling
Date: Fri Aug 03 2018 - 08:55:36 EST


On 08/03/2018 02:39 PM, Matias BjÃrling wrote:
On 08/03/2018 02:18 PM, Javier Gonzalez wrote:
On 2 Aug 2018, at 22.58, Matias BjÃrling <mb@xxxxxxxxxxx> wrote:

The nvme driver checks for 1.2 and 2.0 compatibility. If an unsupported
version is reported, the device will not be initialized.

Signed-off-by: Matias BjÃrling <mb@xxxxxxxxxxx>
---
drivers/lightnvm/pblk-init.c | 8 --------
1 file changed, 8 deletions(-)

diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c
index 537e98f2b24a..e9e2fedff387 100644
--- a/drivers/lightnvm/pblk-init.c
+++ b/drivers/lightnvm/pblk-init.c
@@ -1202,14 +1202,6 @@ static void *pblk_init(struct nvm_tgt_dev *dev, struct gendisk *tdisk,
ÂÂÂÂpblk->state = PBLK_STATE_RUNNING;
ÂÂÂÂpblk->gc.gc_enabled = 0;

-ÂÂÂ if (!(geo->version == NVM_OCSSD_SPEC_12 ||
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ geo->version == NVM_OCSSD_SPEC_20)) {
-ÂÂÂÂÂÂÂ pblk_err(pblk, "OCSSD version not supported (%u)\n",
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ geo->version);
-ÂÂÂÂÂÂÂ kfree(pblk);
-ÂÂÂÂÂÂÂ return ERR_PTR(-EINVAL);
-ÂÂÂ }
-
ÂÂÂÂif (geo->version == NVM_OCSSD_SPEC_12 && geo->dom & NVM_RSP_L2P) {
ÂÂÂÂÂÂÂ pblk_err(pblk, "host-side L2P table not supported. (%x)\n",
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ geo->dom);
--
2.11.0

The same comment goes for this patch. pblk does support 2.0 and 1.2
today, but it is not guaranteed it will support a new revision straight
away. So I think that a check wither here or through the .capabilities I
proposed on the other patch is necessary.


Works for me. I'll send another patch that enables pblk target to tell which version it supports.

On second thought. The idea is that pblk will not have to think about 1.2/2.0. The core will expose a general address format, etc., such that pblk doesn't have to be complicated by that.

I am working on the various pieces and moving them to core. The patch may have gone out a bit early. I will send this again when the 1.2/2.0 conversions have been applied.