Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp538535imm; Fri, 13 Jul 2018 01:51:12 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdX373C6wV01mZtNU/+oPYjCWmg08xu1jUmEZ5TxxEmb2B0G1qcIkTLulVX+rACGOlNI8Iw X-Received: by 2002:a17:902:4203:: with SMTP id g3-v6mr5424728pld.315.1531471872103; Fri, 13 Jul 2018 01:51:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531471872; cv=none; d=google.com; s=arc-20160816; b=uKZDAMfEYnQCKDOKPZezHN6PirKQRSgI9AmDeKY79cn4KA3Kvco/qFBXFBPmnksIdn I9pf22L5U4kUkEk6CGXwZblEq21Whf9xIAg2SMRUjNYAuxjJSe0L8CLEexQLe4LZafOQ Iu0OGKYh3JYZri/uVbmr/P78+WUfZZNDDLH1Hj/hGzqlg7awhALJwN2pQYvyVRV66myk TAz0p5K7T/8qqizyyLzh7YXPcBqUj4/8cCaCKuiVaQP3Sch2XwL4o8nm414fQwYbXeo3 k8KwmFGQ6uHqYQiMCQG0H0DRWoytttci9axcy5sILG9JtuQMDL0QSSrTWZESLYHjMpX+ Hsuw== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=6qscSjtWfPmvy70VsJfMVHuNaMHwjwyBh8afKLuAFos=; b=MK+zxSA8sCwwuCpuMl+Paw1lDf6Jk0Oz9eQqEDvU5xgyqsYS1An3ejEta8yLWjcnhC hdjHmN9jP5dmoUVNsF0ta6JmY7opx2ec5cMqXS7HSkuHA94p+RPZ2qp2VGFciR92NPae 29xudojK//2/98zXgqc9CUQFO9zwQ+7RimuCNFYeAWHDY0RM9b5Jy7le8ETZgJH5RDqB ZOtG4XslFh8McO/pUp7Rx52Y/0H/TDamOEtnz2j8oa8fuh0zqSxAgPoE47T5GxMjFxB+ aJbn6wBejTv9JzC25BNFwKbtLuUgwky3L96bsdpcYYXsFnb1dOEIMQLpIGRLJu5Ay32H Z/dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=O4P3S1h3; 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 r28-v6si23044630pgk.458.2018.07.13.01.50.57; Fri, 13 Jul 2018 01:51:12 -0700 (PDT) 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=O4P3S1h3; 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 S1731552AbeGMJDc (ORCPT + 99 others); Fri, 13 Jul 2018 05:03:32 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:34292 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730848AbeGMJDb (ORCPT ); Fri, 13 Jul 2018 05:03:31 -0400 Received: by mail-pg1-f195.google.com with SMTP id y5-v6so4786862pgv.1 for ; Fri, 13 Jul 2018 01:49:51 -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=Hdy4A4DcpflnSLiPIr53j7AFwpp+kabrt3sfi4WjnaCtsynVVW/lIM2UAnAXRG6kuC hLQqD/CyMtRqyMnnFW9W1RoJMMj7r0NcEWtTcedliIOI37MjbQOrmPURUzLJ2K/9cjzL aXi3QZJHdjWpAwnP41ulpUUUi/DPVyt8wtS+QogZCu2e7whTX9CNYklLK6DPrmpgT7Lj +raw/NrvZLKdoAr0OOT18PqlubYSFxvQ4Qi/xLqqUg2mRJTUqAczl9ThhQSp10udUHjF IEIv2nZxBxGlYD36mPlJuELmmYP5VQaOcmtv+SLBgGkSb+F19n2s2IvwidQ0LnNNDheb ssHw== X-Gm-Message-State: AOUpUlHQvPI5KZoMW5QNuocVh3us3m47+1L9lQGL+Mr07a5ZHlmaPrRv kUb8Td+b8w3IifoZxBU386AtVA== 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.11.0