Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753879AbcCBPVl (ORCPT ); Wed, 2 Mar 2016 10:21:41 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:34007 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751004AbcCBPVj (ORCPT ); Wed, 2 Mar 2016 10:21:39 -0500 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-kernel@vger.kernel.org, linux-block@vger.kernel.org, =?UTF-8?q?Javier=20Gonz=C3=A1lez?= Subject: [PATCH] lightnvm: do not load L2P table if not supported Date: Wed, 2 Mar 2016 16:21:34 +0100 Message-Id: <1456932094-9808-1-git-send-email-javier@javigon.com> X-Mailer: git-send-email 2.5.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1050 Lines: 30 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. The current rrpc target operates on hybrid mode. 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 --- drivers/lightnvm/gennvm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/lightnvm/gennvm.c b/drivers/lightnvm/gennvm.c index 42c1c2a..0625d42 100644 --- a/drivers/lightnvm/gennvm.c +++ b/drivers/lightnvm/gennvm.c @@ -257,6 +257,9 @@ static int gennvm_blocks_init(struct nvm_dev *dev, struct gen_nvm *gn) } } + if (!(dev->identity.dom & NVM_RSP_L2P)) + return 0; + if (dev->ops->get_l2p_tbl) { ret = dev->ops->get_l2p_tbl(dev, 0, dev->total_secs, gennvm_block_map, dev); -- 2.5.0