From patchwork Fri Jul 13 08:48:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matias Bjorling X-Patchwork-Id: 10522839 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 5A5C3602B3 for ; Fri, 13 Jul 2018 08:49:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C65029959 for ; Fri, 13 Jul 2018 08:49:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4031129971; Fri, 13 Jul 2018 08:49:58 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, 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 EB2BC29959 for ; Fri, 13 Jul 2018 08:49:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731500AbeGMJDc (ORCPT ); Fri, 13 Jul 2018 05:03:32 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:35763 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731427AbeGMJDb (ORCPT ); Fri, 13 Jul 2018 05:03:31 -0400 Received: by mail-pg1-f193.google.com with SMTP id e6-v6so4788619pgv.2 for ; Fri, 13 Jul 2018 01:49:52 -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=6qscSjtWfPmvy70VsJfMVHuNaMHwjwyBh8afKLuAFos=; b=O4P3S1h3Gq/yQzKo4gkRYHfCa78VdEQHUljoYpVeyaTLno0vMp+8mYwBOU9y/qlNyg T9z/c56L54kfyxuQAnZyc7QmTy2jzizTdXzRDeCNqn0aHz0A5KVk9bOgfOt8zDN0tMxZ YuhFghuFDOay3sYu7its1R4Q7BrqzZ+r1jfJBWBF4Hy3eFySqnXDf/iz8fI6Exgk0po2 coiWdrhHvRMx+NwiD2nuQzH6wmuxzdX6dh5L8Jp/eH9j+XtvnOQyrpSgPIDcG3GhVDvc xQN01eA4qM+qBgLZfoVxsxJAqHOzkm92v2XXejw9T+ZwKyQeZZxpx9zUhqbI8G6LvhGf deNA== 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=6qscSjtWfPmvy70VsJfMVHuNaMHwjwyBh8afKLuAFos=; b=i7Gxc8n6qevTcMDXvcJc78jamtKo0P8QZ8Qy4uuBgcyDxDUdXrIxVV2oICqjBb5wPz a1xTjHIzsRW9suRsQGc9SOFAHvCiVON9QN4OisbxFSbWHKec92X8NgE0RfKiEhFi9Bkj Q6MwyCI19l6gosfdx8V63Gj9CRNfpbbHcLsJ1qty5zN1Mz0IobJabqbFft4vI8yDfxmj vJry59kAsHX+8+1qr43gac1v0g66qQPEtusIHAvdXBgK8VjJFRBWC2oicrs2j9H889Nb qblCTcX75YBUXsI93nRDirJr+Fcm985xfyyyxeZvp9JZC52dZFUTV3nqKMUmputXGo6+ ARKQ== X-Gm-Message-State: AOUpUlE2q2+hNZMBzMJOG5r42n6al3WNPAUMjBveJLSkzXkcPiVL+JtS Vbd6GyiqFMUOCxfBWZTqNrBOFQ== X-Google-Smtp-Source: AAOMgpeqDNNqVp4eG2Hup4Hg2LwCG/vC+myT8Q08obfMVcLgj7UtX5WuFp3CUj/p1FNkRXfyfz5K3g== X-Received: by 2002:a63:2a0b:: with SMTP id q11-v6mr5243458pgq.36.1531471791621; Fri, 13 Jul 2018 01:49:51 -0700 (PDT) Received: from skyninja.hgst.com (rap-us.hgst.com. [199.255.44.250]) by smtp.gmail.com with ESMTPSA id d18-v6sm569357pgo.74.2018.07.13.01.49.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jul 2018 01:49:50 -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, bart.vanassche@wdc.com, hans.holmberg@cnexlabs.com, javier@cnexlabs.com, hlitz@ucsc.edu, igor.j.konopko@intel.com, marcin.dziegielewski@intel.com, =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [GIT PULL 10/10] lightnvm: pblk: assume that chunks are closed on 1.2 devices Date: Fri, 13 Jul 2018 10:48:45 +0200 Message-Id: <20180713084845.19511-11-mb@lightnvm.io> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180713084845.19511-1-mb@lightnvm.io> References: <20180713084845.19511-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: Hans Holmberg We can't know if a block is closed or not on 1.2 devices, so assume closed state to make sure that blocks are erased before writing. Fixes: 32ef9412c114 ("lightnvm: pblk: implement get log report chunk") Signed-off-by: Hans Holmberg Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-init.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c index d023ea6116bc..537e98f2b24a 100644 --- a/drivers/lightnvm/pblk-init.c +++ b/drivers/lightnvm/pblk-init.c @@ -719,10 +719,11 @@ static int pblk_setup_line_meta_12(struct pblk *pblk, struct pblk_line *line, /* * In 1.2 spec. chunk state is not persisted by the device. Thus - * some of the values are reset each time pblk is instantiated. + * some of the values are reset each time pblk is instantiated, + * so we have to assume that the block is closed. */ if (lun_bb_meta[line->id] == NVM_BLK_T_FREE) - chunk->state = NVM_CHK_ST_FREE; + chunk->state = NVM_CHK_ST_CLOSED; else chunk->state = NVM_CHK_ST_OFFLINE;