diff options
author | Javier González <javier@cnexlabs.com> | 2018-03-30 00:05:18 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-03-29 17:29:09 -0600 |
commit | 7ad5039ee557f0a427a0768e43c28d0236d56ba3 (patch) | |
tree | 4097a44857433f188847b4b43cbe3c81d32ce1e2 | |
parent | a294c199455187d124b0760fa8f86c13cdaa4b25 (diff) | |
download | linux-7ad5039ee557f0a427a0768e43c28d0236d56ba3.tar.gz linux-7ad5039ee557f0a427a0768e43c28d0236d56ba3.tar.bz2 linux-7ad5039ee557f0a427a0768e43c28d0236d56ba3.zip |
lightnvm: pblk: check for supported version
At this point, only 1.2 spec is supported, thus check for it. Also,
since device-side L2P is only supported in the 1.2 spec, make sure to
only check its value under 1.2.
Signed-off-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <mb@lightnvm.io>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | drivers/lightnvm/pblk-init.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c index 4656d1ff81a6..34ff47705293 100644 --- a/drivers/lightnvm/pblk-init.c +++ b/drivers/lightnvm/pblk-init.c @@ -1016,9 +1016,15 @@ static void *pblk_init(struct nvm_tgt_dev *dev, struct gendisk *tdisk, struct pblk *pblk; int ret; - if (dev->geo.dom & NVM_RSP_L2P) { + if (geo->version != NVM_OCSSD_SPEC_12) { + pr_err("pblk: OCSSD version not supported (%u)\n", + geo->version); + return ERR_PTR(-EINVAL); + } + + if (geo->version == NVM_OCSSD_SPEC_12 && geo->dom & NVM_RSP_L2P) { pr_err("pblk: host-side L2P table not supported. (%x)\n", - dev->geo.dom); + geo->dom); return ERR_PTR(-EINVAL); } |