Received: by 10.223.185.116 with SMTP id b49csp1624906wrg; Wed, 21 Feb 2018 23:49:55 -0800 (PST) X-Google-Smtp-Source: AH8x2272F2/bLK0qnPa4y4nE6fVI8wz2avBtnYeHevP21swS68LqWbpRF/54kpKU/q2mWmap+ukr X-Received: by 2002:a17:902:a9ca:: with SMTP id b10-v6mr5834310plr.223.1519285795341; Wed, 21 Feb 2018 23:49:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519285795; cv=none; d=google.com; s=arc-20160816; b=aT33Wjri5GbOKK+YCMg5PU+7q5Jtft6/olB5Ywk3U4jslpht/lWuQcQ/Wd4a4up2Pv GKOuLuVPn1GPscuh3tjeiCcSHySdkkmnnTur3sa8Pgk87tvVxQPmqbUpuy9Jmu4AVaIc 2TMNEO8/HNj4oxq5zQWim8gKkdi80iU1kFuPsOoBvn31RgS94KOIYItVyFTZNmNzf0zZ SWAksyIABeoHuUop8z+y51sZ9eZudIdPhA+4qEVbgKLXHGs5SuSEZ4r/yBRkV2sICBj/ 02cAa7zh6zsY+px1OlSdgNl2r0UjAxbU7DBq+Cqq2e8Qquan3Kga/x8GJOGh5llqRNsd 5f5g== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=EjHcFGxU7tkCm+Qj8H7xN+LnkvFojn8XdvZTScvenlg=; b=dNyE7TTVnUVx6DvOl2K6wQRhllMOUyF7+HKj8FptLy4vcpphQ9Ewx5vZbj2XjCzxwx YxfDX0Y+S5Tf5bSr4HT5UPs6qU8WFmImm1N/lzyjtj78oPv4zlWn6icyur86usdWfMaH U9VmJPr4E6FivbrhAIsmTOAJYr6LAGiHp6StlZQMeyCFSOWCmpIdiqrpl8iM5L74frwy m88xiXi7iNPuE+h0bcf7x8jo6tiB8xLJns/7gClRG2TeCg+UohiKu9pO6ysr1nyA+s+W SAQ4HnLn83D78MhXtv0Re/kBt8WmIoi5uM3C8MiWF4AIQQ5lXc6MeDvGAOl2+UEhj8A/ EcoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=IGQFcKk4; 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 g17si3062296pfj.154.2018.02.21.23.49.40; Wed, 21 Feb 2018 23:49:55 -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=IGQFcKk4; 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 S1752716AbeBVHsd (ORCPT + 99 others); Thu, 22 Feb 2018 02:48:33 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:43589 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751657AbeBVHsb (ORCPT ); Thu, 22 Feb 2018 02:48:31 -0500 Received: by mail-lf0-f66.google.com with SMTP id q69so6047084lfi.10 for ; Wed, 21 Feb 2018 23:48:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=EjHcFGxU7tkCm+Qj8H7xN+LnkvFojn8XdvZTScvenlg=; b=IGQFcKk4r4ezQJA6vbFlEgwQDnjzlPw8NBYeSZocwhbbZWDVlTQyHubG1g1cVfcORK /fCpsOOzPZ7+RsdV73iu3Njvr8YYVlqiu5tjmh8z2f7MTeEzBJFNQSQOL7jOdM0SKIdK rzoGkZNNDn717R9ElzkD2JsN3l/GTayCn5cBTlJ/3Jnedefw9F70Ui1TR4UHPpV9OJlY WVMPXaQH26YOl+U1obGaVCrSk6rVQ2Sia6HEnlPocOQ3NpNUe7jmKSnIcOlqJcOfPi4+ W1nHq6MOh0/e2flgrBAhWn4TxIGFrHPnbU+sT4SuD15VIsIgIMHJsT2l/teQjD3jNoom /oVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=EjHcFGxU7tkCm+Qj8H7xN+LnkvFojn8XdvZTScvenlg=; b=PKi59tosmjHC71Owk3Hv++UJIb0Hz2yw6lUp6HXWMDjXhlIARDvT03kN69kHfs/mi/ JD0bauorvJOvpXlcy8SztQSmQVQNGtHA9xOyefsUWY+RIJb+OODFCF6tRyHYUyHa7J16 Mt6AGnAlhFwzw0kA3/gpKCInTFsa7VTJhqQsqlu3bWXn1nhNWpwyJB4aFgPG7VaQzail pAL7pqirjJHQ78dRVqHC3mgbxyqnP3H3nkfvUFRytTHDNcFnhNtHDQJRaNUfEF1sBNDx 0DPQ3w38NHTt3oem6RkjdWV/S9nEjcKOGv/1MaqEKeORz/1Q5GvQkf6kkKf3uK3uQFly Nz8w== X-Gm-Message-State: APf1xPA/uajg4/K2t54BjDRFkuj3jBaJtHnHnoehDbvtv4ezuSm8pUVG q2OlP2mJZsQbY5GaglSqIZcLrg== X-Received: by 10.46.32.11 with SMTP id g11mr4129378ljg.75.1519285709544; Wed, 21 Feb 2018 23:48:29 -0800 (PST) Received: from [192.168.0.10] (x1-6-a4-08-f5-18-3c-3a.cpe.webspeed.dk. [188.176.29.198]) by smtp.googlemail.com with ESMTPSA id n2sm4193041ljb.3.2018.02.21.23.48.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 23:48:28 -0800 (PST) Subject: Re: [PATCH 11/20] lightnvm: pblk: check for supported version To: =?UTF-8?Q?Javier_Gonz=c3=a1lez?= Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, =?UTF-8?Q?Javier_Gonz=c3=a1lez?= References: <1519205218-26994-1-git-send-email-javier@cnexlabs.com> <1519205218-26994-12-git-send-email-javier@cnexlabs.com> From: =?UTF-8?Q?Matias_Bj=c3=b8rling?= Message-ID: <4b1cc74a-5f7a-2f43-e1ff-5f31445ad709@lightnvm.io> Date: Thu, 22 Feb 2018 08:48:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1519205218-26994-12-git-send-email-javier@cnexlabs.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/21/2018 10:26 AM, Javier González wrote: > 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); > } > > Looks good to me. I'll pick up when rebased.