Received: by 10.223.185.116 with SMTP id b49csp481007wrg; Wed, 21 Feb 2018 01:31:25 -0800 (PST) X-Google-Smtp-Source: AH8x227OW7B93h6lJ7CkwdMqObKi9q5xYkCAmmvq8+d69jiXsbMz/Y7aQpWkjYga8+nKWUsJIrM/ X-Received: by 2002:a17:902:9009:: with SMTP id a9-v6mr2068710plp.272.1519205485380; Wed, 21 Feb 2018 01:31:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519205485; cv=none; d=google.com; s=arc-20160816; b=Z8O1Zq+bOVVgHteP70v3ov8HzeHpUjlDH+d9PsaB6CFNCeRN9UhmBSVMsPUX8bNIk/ yNxXl+ezlFI08trjavhm6E+e5yqbNZY/WJ2Pmbj7tLjOlCIx21YiF5N+udLfu/U2uLfC ujdSTgvakFk+hrmLJYmPM6ZkqBPmW/pJEGs1kup6hTEzJ0Z3UvaeBnZhM/ApDgdqpb+v IspoRBIBHqzF4ldQuIEXPNMzwANvdpkBlKQ1ZeDtXFT8E4hyRaxMjCYyA5c09h7gbzfl p5mb52ENGedeee7bDWcTn/Z0TmPIEVvtQMd8Ma1xd9xHtVp1dG8oXCQSGO+0REuD/zHJ 0DjQ== 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=3fgLEzEw9C5Xeld+vsfAyLjjhxc2P+hbrYmLNQUwJ5Q=; b=CduIdjB9mqEkzOHxjrFIB2KMmEDxV9BUj/9cSSAAO8+bEZdzMKDb/IXg3h1Dp+Q+1v NriUr3eA1Y+1VQKmNEcrj+6G64jVNe0QA1mk/5PejrpO8ZQx1xpRsD3IhbqfN5p6ZhMi DPZ1qhB+DDdbjw2wBWFLGY6g77HwMaVjJEbWbOqVsI7p+lYBuPHL0UkCE9FwPHysBHy9 LZM2a6FZHzOX1rs3HBYXHyxcbwfJXJ0IMffGFWt9NQGUpgrfBugOcRqvzK9cjTGuvx2T wJgy7hZUpx1C5W5UC7h5ei/XrtFbxf1WBQkhYUQWL4VTpuayMNs66vL2bqGNLr98YThJ VbGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=os3wr6uX; 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 m123si4568892pgm.698.2018.02.21.01.31.10; Wed, 21 Feb 2018 01:31:25 -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=os3wr6uX; 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 S932395AbeBUJaM (ORCPT + 99 others); Wed, 21 Feb 2018 04:30:12 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:40504 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753268AbeBUJ1W (ORCPT ); Wed, 21 Feb 2018 04:27:22 -0500 Received: by mail-wr0-f196.google.com with SMTP id o76so2433533wrb.7 for ; Wed, 21 Feb 2018 01:27:21 -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=3fgLEzEw9C5Xeld+vsfAyLjjhxc2P+hbrYmLNQUwJ5Q=; b=os3wr6uXoPTY7W3W06VpYfxzrElZB5cATBNsMwGEKohuCcHRl3x6c7RbvcejXg911o yiilKowzuMICO+2GMxo/VjiA3mDTpiYkkeavwjG8ZfuDzgcg+w6OyY5Og/dyRSMbjxaG 6kOhqjC00QaVAUWkN5zU2GGBMqOE5DeNlo+f/ohkq4nz0UrJ5z03PnVHjp3Nt+G70DlL mcuwd3SE+8uPyq4VAB5nlnGCkg0NDIdMnIGb5mmviCDgtfMPzbL3qIPp7NINFruhhaMX hgEj+Mdnj/TU35kEWVWAj+d7QF/9QYycp0V4TVDzQtTNfxAY5Z0sAGC3R/A9cJfx6ZxE 3IXw== 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=3fgLEzEw9C5Xeld+vsfAyLjjhxc2P+hbrYmLNQUwJ5Q=; b=hpRn1j97kvnMfw9h5UpuKuoHO0/qgVpj+Mek1OOvZVLeWcwCh7KusVLnt7LviBTZgW y+3MwFIDJY6qTotAoRY7ooPEr/79dfU+57emL96q4he57LzaqbwN53Qo+ELgOJRy4fHB GzIWR3rkCtutlldYufLQnlYfKQbZS0+l6EAH3PBz1y2UXz3R3YFsC0ISazjQBKIKyNqr hBNI2wL5d5fqbBgDr2TXztYDe3NUsO07Nj94HU94E4lV1N2aelJiNuOikt9p8mOBnRMN 2ZhSv9UxcU1T4xgN6KRgxOhn58hvykNjzM1rz913Yy4szPPdW0Y2lqhKCdRu1HyPzOxp kB/g== X-Gm-Message-State: APf1xPB0o8YwgkEvar1znLT5Afx24Mmde+HpcbW2jPE8ieCubV3JSeUD vlXqrMoZ7eaGrnM9qsEHg+gGDg== X-Received: by 10.80.182.245 with SMTP id f50mr4055551ede.157.1519205241081; Wed, 21 Feb 2018 01:27:21 -0800 (PST) Received: from uHalley.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id a17sm3389955eda.42.2018.02.21.01.27.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Feb 2018 01:27:20 -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 11/20] lightnvm: pblk: check for supported version Date: Wed, 21 Feb 2018 10:26:49 +0100 Message-Id: <1519205218-26994-12-git-send-email-javier@cnexlabs.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519205218-26994-1-git-send-email-javier@cnexlabs.com> References: <1519205218-26994-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 56b4afc27add..ec39800eea42 100644 --- a/drivers/lightnvm/pblk-init.c +++ b/drivers/lightnvm/pblk-init.c @@ -990,9 +990,15 @@ static void *pblk_init(struct nvm_tgt_dev *dev, struct gendisk *tdisk, struct pblk *pblk; int ret; - if (dev->geo.c.dom & NVM_RSP_L2P) { + if (geo->c.version != NVM_OCSSD_SPEC_12) { + pr_err("pblk: OCSSD version not supported (%u)\n", + geo->c.version); + return ERR_PTR(-EINVAL); + } + + if (geo->c.version == NVM_OCSSD_SPEC_12 && geo->c.dom & NVM_RSP_L2P) { pr_err("pblk: host-side L2P table not supported. (%x)\n", - dev->geo.c.dom); + geo->c.dom); return ERR_PTR(-EINVAL); } -- 2.7.4