Received: by 10.223.185.116 with SMTP id b49csp6425556wrg; Wed, 28 Feb 2018 09:11:27 -0800 (PST) X-Google-Smtp-Source: AH8x224dQdWL6JoJ8KoAneMzUVqi5JFog9cGSn0dBga7ZcYUDjo6nSLApyqBnRTeoJFV8BCAjERj X-Received: by 10.101.93.82 with SMTP id e18mr14593583pgt.371.1519837887876; Wed, 28 Feb 2018 09:11:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519837887; cv=none; d=google.com; s=arc-20160816; b=Lv7ZvEoZExWqLRzRHVwvruc57sB/7zmAkiJmaIc/RC3FGfAgYqkvIvNixDVqiSzeQY I2I9YiVKeSH6NjlrWlh+Kwan+bXAmWMzEOWWdK1hWjj8TLgnW5LeNWurjP0sfXmjl/O0 ZG1umHoHlTnGxWYJ6iXu5IRYXVEMac0CekFBgTom5YcMv2nLGAaBxATiUgoAMe6Kwjsm pWKFj0FcdxQ9goxTtbM55iYjoq0aJefc0ZJS66tXh+LO1qrPNnBJ8iPSTwH5jX+I8peP O+wbnkX/Ml9f0GhQYzw6V+1AqyC+o7D+S+tWcR2hqrxf3xAAumlObxAO9GvremzrXJdU CS3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=eWbYRfjiLmB92VlMnPYAeyvU55QGOTkw/KgsWQ9RiSY=; b=d+KNsGk2I0fKyvtdzslssDsIjC7O7zAb4oMFE+X2z+swKZTD4C/WplnhwVdXFIPXJ5 52uoB5VoKC5PBKBcY0gXA+lVHp4i1cJ6bdC68ooHxQlhRgfVtN2VEGZWeo0cEexw0Fjr GJWT7M49m2OhEipxQpCtYb9YwgdZginIGaCjG2YZTX3DVNvPvdqBOJ4cU7kD7vgQo1s4 IUTG9JrTdRWWlCb4Nsj8lE5dCtHs1P93hOyoQ57LmNQumjO6S7J8bLTJXA1Wh7CGUQnJ 8zNAfLFJ4i+9uRFd3vPk9gah4ZBkOFHT8+QJx5IlUDxgH7N01Y3TtArXDZc4wcaHR8qh 1olQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=ZjrtDiMp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5si1232944pgv.476.2018.02.28.09.11.12; Wed, 28 Feb 2018 09:11:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=ZjrtDiMp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933379AbeB1RJr (ORCPT + 99 others); Wed, 28 Feb 2018 12:09:47 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:51746 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933621AbeB1Pt7 (ORCPT ); Wed, 28 Feb 2018 10:49:59 -0500 Received: by mail-wm0-f68.google.com with SMTP id h21so5905451wmd.1 for ; Wed, 28 Feb 2018 07:49:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eWbYRfjiLmB92VlMnPYAeyvU55QGOTkw/KgsWQ9RiSY=; b=ZjrtDiMpjIB8GqMA+MRGOxF0nn2I1O3lGyST2MignJi2RmiYP6V6nb37k64jRYQsgm 5NZN6kqwIxeROaWSCHT4NTp7COgWR3HTINERZPGnp0v8tZ1PGxhJ+bz0Kch9rxKLlVeY J5pCBDBY21WqkAJ38bzc81CdbGxXtJzTcXegIQDweniGyqZq/fYzHsIyMbvh6LawWxTd SNfWF/xF3cAxALkyh3eHU60OJGW64dERVxuGgFG+UcNK6cuqYbeOCk5C7x3l9cFdvswT 2q0n+DRcZXbzWaM3fKXGPH6S9JbDlE6MU1uPGlXdZTUdeCYu6qgsWPAmc4KIHusKI4nw yj9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eWbYRfjiLmB92VlMnPYAeyvU55QGOTkw/KgsWQ9RiSY=; b=soCbqV9keGGyMgW0yUQVhDneiXplblcV4hh/1H5+jM+DpUNaesZO/qGa/xkMunDRbw bnCM1JtsjnczSw12CO3azQkKBZKpIccDW/L/sBSTPI0U70nGWHDdUR1JHMt7D6HgnshP oMTRJq+MkWFOYwSSeTTbNgbqb2i7y8bmhJUJNFYknn0/hFliLhV0BPtFKwhUgvPgX1Q4 3FRYmQAmUTIpZqk6gRX2i1kOVlrWeZhUyj5PiI0Bu0RgmbIpRQSib/b2tXWDCGNGSn3B uMiF3OemTdLqr8bwqrJlYTrjv5LDSOdx7JjGiFWP9RFDPgFlGYS+871mnwW9vIJ5uWFd ceHQ== X-Gm-Message-State: APf1xPBGHSAeuLATI4K0LxzNFX8ejNoBhSvAex0wetxkGWSlQe8zHloc LY1PVi0QTdRIRWmmbZi2KYcvLQ== X-Received: by 10.80.180.186 with SMTP id w55mr11440108edd.184.1519832998803; Wed, 28 Feb 2018 07:49:58 -0800 (PST) Received: from uHalley.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id n2sm1953056edb.62.2018.02.28.07.49.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Feb 2018 07:49:58 -0800 (PST) From: "=?UTF-8?q?Javier=20Gonz=C3=A1lez?=" X-Google-Original-From: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= To: mb@lightnvm.io Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, =?UTF-8?q?Javier=20Gonz=C3=A1lez?= Subject: [PATCH 10/15] lightnvm: pblk: check for supported version Date: Wed, 28 Feb 2018 16:49:30 +0100 Message-Id: <1519832975-25432-11-git-send-email-javier@cnexlabs.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519832975-25432-1-git-send-email-javier@cnexlabs.com> References: <1519832975-25432-1-git-send-email-javier@cnexlabs.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/lightnvm/pblk-init.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c index 11424beb214c..b67b5b11ae16 100644 --- a/drivers/lightnvm/pblk-init.c +++ b/drivers/lightnvm/pblk-init.c @@ -991,9 +991,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); } -- 2.7.4