Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4931360imm; Tue, 19 Jun 2018 02:10:06 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJzyCCAeYMeCbpT7mpStE4e3yZ3zeYDXTz4VIUEsNAiCdfz7oknKypRLiylP+mmz2/LZSLj X-Received: by 2002:a63:7c03:: with SMTP id x3-v6mr14412075pgc.412.1529399406201; Tue, 19 Jun 2018 02:10:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529399406; cv=none; d=google.com; s=arc-20160816; b=SeQv8jcrjVJ15Rsw41cfqwt7Gh9hffZfD3sHJ90WgPT94m0LoljM9QIDj9cWljp+0b csJyEdNewsSGb5WP8BQQa1b1v14n4ZUQNxE8q7BpSndVfyuxWIfPZHLUb9GhRB/y3wpw lNcVuAbW2kauyHD60pQcUmb1arrgaXZHR1mhziL6+9RYN60iDXb8SA3nqLaACiTJnFa4 jPXx0BGqmnfMPLMcejsX07y0JXzG/TA/FPP5DyW+fC7059whPZc5WPPE1Nl0Mjl5z/l/ eEViHVU/LIyEtZBxTH7h0rcc7ZEwACjnUsWY2y8Y5Yf7q3Yq5AXxc55oHavRCnka0OaQ 2yEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=eSzDELogY49TVYILZ3s9BjeiVGknbjjA5dmkQ4yjYpg=; b=jccJgKUKT6mrgnXyx302cJGSKsV3I4+vvuCVTD1Rpsrd2dvsGsmMKC0AHNlmrf9URT go4fH4m6T9WXGLkD9VRTOx1J6Ujf5mJo+l/gWVw7+EvSvrbOBcO/fTdfU7AZ0p+Zv7yc ehhoyKQu8/8TmOxZ2YAYpjcjxgmGs+yqWB/cZW95DZNTL3NLKQIsnroqDlFJ7uTvdEA8 D4YDpR/zJZ+2mc9soCOvA2QiCPKmfVfkfwSMiwzsHbcBsYNhTuOJtfllYDOVxkJRkp2G RlgOV/8r2Q6ePEJCLvSoso9rxi68pzNyfrZy48+qpwe1oUhK+tKdcRp8eHWbK3VU7ayW GMkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@owltronix-com.20150623.gappssmtp.com header.s=20150623 header.b=lfGy6vKS; 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 z14-v6si13898091pgz.264.2018.06.19.02.09.52; Tue, 19 Jun 2018 02:10:06 -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=@owltronix-com.20150623.gappssmtp.com header.s=20150623 header.b=lfGy6vKS; 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 S1756653AbeFSJHk (ORCPT + 99 others); Tue, 19 Jun 2018 05:07:40 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:39832 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756608AbeFSJHi (ORCPT ); Tue, 19 Jun 2018 05:07:38 -0400 Received: by mail-wm0-f68.google.com with SMTP id p11-v6so20541627wmc.4 for ; Tue, 19 Jun 2018 02:07:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=owltronix-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=eSzDELogY49TVYILZ3s9BjeiVGknbjjA5dmkQ4yjYpg=; b=lfGy6vKSJwNdi+2zpVZ1Afv68yF3xIK+PRjf3ZS5ggv4Xg0I7am3QfDY5CDkgEtAvw eszDY6EBQOtosli6cUeN5koRIhNNIE0ZaSJFVLFSLKGQOpKym04ESHP09w9XZ36Fu5KW Y90KXoNM+ZkbgJKGN6TQ0OvjuRyQd7y2zsVkQNwpwJukh69/wSwBOQeYWqn5c673dkwd 52egkOlvosEZQRB69CAwB8g7q7O+n3CG3m07iHamKQts+/M9GDdsEChoJ8I9lhBvT/Ef T1RUjd/QngGyNjPPogq/UiyRbXThLyrzMRPvrp+KirKyEf+PQwYhjDJ5/hLIM/xVZX8c q6wQ== 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; bh=eSzDELogY49TVYILZ3s9BjeiVGknbjjA5dmkQ4yjYpg=; b=aWBGesh7xIpjP9qGEoy7b4XoU4Jg2vrQJcbbm2EImFJS3E8UEScuk0wM98siWTnJMP n1lT4veOFni7h8NoC3W/IxaV12fsSBOAZnHQZeTGYizWZ5zszULeaQpIpTU12Y7lRWIx CBdjPwrSpHXtpmr6wtlIWV8wHe2MHanR/6Bia4d+d5efLDdbdVb4RFWRuWMRgNpVUWqy ywKblCAoj/fg+2AL0vQVy4KeU7fDE/5XdA3Mz7mjHR9gbI35NVjg9LjE+PZl5xaEhgIC kOLmqTT3NRaVM2hPWCOFvUx+RU89S4MoXXsx1U6o+A2RIn/Tn/S7mLbCJ1LXyQFHUdfe LB8g== X-Gm-Message-State: APt69E1N5eAvDtMnm+Hei4NILuGZtvH5qRZVa7BWnCt88HNd3WU8NYQU XfFImrKrjrEzjfYbwMLBZ+mgqw== X-Received: by 2002:a50:abe5:: with SMTP id u92-v6mr14208861edc.43.1529399257622; Tue, 19 Jun 2018 02:07:37 -0700 (PDT) Received: from titan.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id f25-v6sm7902102edd.87.2018.06.19.02.07.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jun 2018 02:07:37 -0700 (PDT) From: Hans Holmberg To: Matias Bjorling Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Javier Gonzales , Hans Holmberg Subject: [PATCH] lightnvm: pblk: assume that chunks are closed on 1.2 devices Date: Tue, 19 Jun 2018 11:06:29 +0200 Message-Id: <1529399189-3239-1-git-send-email-hans.ml.holmberg@owltronix.com> X-Mailer: git-send-email 2.7.4 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 --- This patch applies on: ssh://github.com/OpenChannelSSD/linux branch for-4.19/core 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 aa24264..3b8aa4a 100644 --- a/drivers/lightnvm/pblk-init.c +++ b/drivers/lightnvm/pblk-init.c @@ -717,10 +717,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.7.4