From patchwork Thu Mar 3 14:06:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matias_Bj=C3=B8rling?= X-Patchwork-Id: 8492881 X-Patchwork-Delegate: axboe@kernel.dk Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 492AC9F2F0 for ; Thu, 3 Mar 2016 14:07:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5DCD120225 for ; Thu, 3 Mar 2016 14:07:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3A8D8201BC for ; Thu, 3 Mar 2016 14:07:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754807AbcCCOHm (ORCPT ); Thu, 3 Mar 2016 09:07:42 -0500 Received: from mail-wm0-f48.google.com ([74.125.82.48]:33805 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757772AbcCCOHN (ORCPT ); Thu, 3 Mar 2016 09:07:13 -0500 Received: by mail-wm0-f48.google.com with SMTP id p65so36399695wmp.1 for ; Thu, 03 Mar 2016 06:07:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bjorling.me; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OhSNUz+v5APbN9N97fzLLLjPLelstIBVIbqBuqWpAe8=; b=dy3uc/wvruUoElKq5WJOmveR+R5sTKvpjJarjN7ijyoF6mguQVOtUZLIKN7adwsZ3u pc3Db2V/OPhXiB9hCJEDpGU8WvVcbrb6zrENl79o0xCSjw54YEFjVhshTfdpyLzFCTEz se0bUDcUC7+ERgacz1T7Eg7N3J+d7QNpoUvPo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OhSNUz+v5APbN9N97fzLLLjPLelstIBVIbqBuqWpAe8=; b=lYE/OrHh8VaDxEW5fpkofYZM/Jnk2QQpQFvegTXCsggwiDj3eln5sAItu/c25Kli8E dzaxG0JPcnU4seuo6uHRZIFQ94TbasekcuK/EiWPMxSG+t3ZlzOhR5RNz45wdgjBkNdL rcliCnldgJ2dPcHWAjN4c1fsd01tALVb9yd5Gr4T+Ms1qruNbPFvKE+Il9nhv2/LfB+B fJWHs8A3qbDUe3gSRGsM/iBU+AlpJ7bC41KclYyC6OOKeJukHFq+n/h3YjSCy+N3xL5d 8d3EfWywAi0+Y/QdwOZJVmdfXkFRg5DH7oOGkpyhYQUhJKGuv/x9CgC+RNp1ajKzzaqx 0rTg== X-Gm-Message-State: AD7BkJJ2kRyfGKF2icAjMigzsNR7znad6r13H/+O16IFswxFG+4E4mRK7DU9iaVN0LrGiw== X-Received: by 10.194.115.8 with SMTP id jk8mr3485716wjb.136.1457014031413; Thu, 03 Mar 2016 06:07:11 -0800 (PST) Received: from Macroninja.cnexlabs.com (6164198-cl69.boa.fiberby.dk. [193.106.164.198]) by smtp.gmail.com with ESMTPSA id 3sm9167367wmp.14.2016.03.03.06.07.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Mar 2016 06:07:10 -0800 (PST) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@fb.com Cc: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= , =?UTF-8?q?Javier=20Gonz=C3=A1lez?= , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 5/5] lightnvm: do not load L2P table if not supported Date: Thu, 3 Mar 2016 15:06:41 +0100 Message-Id: <1457014001-23561-6-git-send-email-m@bjorling.me> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1457014001-23561-1-git-send-email-m@bjorling.me> References: <1457014001-23561-1-git-send-email-m@bjorling.me> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Javier González An Open-Channel SSD can work on two modes: (i) hybrid mode, where the L2P table is maintained both by the host and by the device; and (ii) full host-based, where the L2P table is uniquely maintained by the host. In the advent of a new target implementing the full host-based mode, do not assume that the L2P table must be loaded on the generic media manager; check device properties loaded on the identify command instead. Signed-off-by: Javier González Moved into the following statement. Signed-off-by: Matias Bjørling --- drivers/lightnvm/gennvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/lightnvm/gennvm.c b/drivers/lightnvm/gennvm.c index 42c1c2a..72e124a 100644 --- a/drivers/lightnvm/gennvm.c +++ b/drivers/lightnvm/gennvm.c @@ -257,7 +257,7 @@ static int gennvm_blocks_init(struct nvm_dev *dev, struct gen_nvm *gn) } } - if (dev->ops->get_l2p_tbl) { + if ((dev->identity.dom & NVM_RSP_L2P) && dev->ops->get_l2p_tbl) { ret = dev->ops->get_l2p_tbl(dev, 0, dev->total_secs, gennvm_block_map, dev); if (ret) {