From patchwork Thu Mar 29 22:05:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matias Bjorling X-Patchwork-Id: 10316497 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5B7A260383 for ; Thu, 29 Mar 2018 22:09:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4313C2A503 for ; Thu, 29 Mar 2018 22:09:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 330E02A534; Thu, 29 Mar 2018 22:09:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C92012A503 for ; Thu, 29 Mar 2018 22:09:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752219AbeC2WIs (ORCPT ); Thu, 29 Mar 2018 18:08:48 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:35973 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752749AbeC2WHj (ORCPT ); Thu, 29 Mar 2018 18:07:39 -0400 Received: by mail-lf0-f66.google.com with SMTP id z143-v6so10348970lff.3 for ; Thu, 29 Mar 2018 15:07:38 -0700 (PDT) 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=WjZXs8KwLEpJb2kQpM2UKy/lltzEMJPbA/UFptrohmY=; b=Yz2fRmN4W4aT9KvLvFTZ/aacEZbSmV6N5/6Mz3NFS8rLabEPBxAacXF1r6GdB30jJJ P2wgOWeCCKwtneJeej3VJpNTm/wM0RSAPvp85QPvbQeYv5//F27EweCPQIzcIq5+dDrz ygLl+0MoAtk25Iumiuk2mxiPPe1cRSAl+u0A26UcbqUxslObuguE+7AT3FUp9mEEWFQI O8msXy77jxu3LES+icPqulv/9bQ2IR4nqoLQcqZw+JAV6/epyD7sNHQ7S0/8Fvz7FFwu McuGL1pMlFVYtNUYgtQmtI7t33THw6T3KRB1kPzdUYr1TfIiEViWPwbztpW21Tzz1kRK SCFg== 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=WjZXs8KwLEpJb2kQpM2UKy/lltzEMJPbA/UFptrohmY=; b=thszYqloxRXjjRSbYYv5l9dIqUR885odCvRSbYRQ7Jr+nMY25/boRC5hATnph7GHNU 6PLMkFhIGsWtizquak5soGDf3hUJ3lij9rh7T4v/+NB3q1lS0NHWoPaAYDwHfxm68t2F sS9lHOoYRTmrnQK0X2xpfpDM1mPXuXI9D/1JyAB5W+l0Ho7dC9KrG4rmzWUsQ5LLLTm7 AyHx2RxNNMZkEft3THwRz7H3wLDCsvBTMWbbsasTQHJ1UwZHDJAYBb/a7USh5WlNza3y hyyIhSxIqsoqTDDL3a1WGB17A2cJnelaZZM1LUtVb05Lr6fPQqXDxEeJdNEuRQPF0W0D U98w== X-Gm-Message-State: AElRT7GnKMXWkFOVyCJPUEA4Bd8UTgaDLJ7nG9H2UK8Cjn9fgXJYrmLS N0/VRKpBqiqVu0ydZGfAE+2sJqIj X-Google-Smtp-Source: AIpwx48s6VrYWHLSDrQ1sY5mLcFsIq+i46lezsPdWTjrJZkT+lurgXD59Lt/krui2bq0Lv3Pb1qayg== X-Received: by 10.46.152.203 with SMTP id s11mr6331094ljj.92.1522361252567; Thu, 29 Mar 2018 15:07:32 -0700 (PDT) Received: from Macroninja.cnexlabs.com (x1-6-a4-08-f5-18-3c-3a.cpe.webspeed.dk. [188.176.29.198]) by smtp.gmail.com with ESMTPSA id i89-v6sm1365508lfk.12.2018.03.29.15.07.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Mar 2018 15:07:31 -0700 (PDT) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: axboe@fb.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, keith.busch@intel.com, javier@cnexlabs.com, =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [GIT PULL 31/37] lightnvm: pblk: check for supported version Date: Fri, 30 Mar 2018 00:05:18 +0200 Message-Id: <20180329220524.30363-32-mb@lightnvm.io> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180329220524.30363-1-mb@lightnvm.io> References: <20180329220524.30363-1-mb@lightnvm.io> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Javier González 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 Signed-off-by: Matias Bjørling --- 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 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); }