From patchwork Tue Jun 19 09:06:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Holmberg X-Patchwork-Id: 10473837 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 647E360230 for ; Tue, 19 Jun 2018 09:08:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5775B288F3 for ; Tue, 19 Jun 2018 09:08:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4915628B2D; Tue, 19 Jun 2018 09:08:13 +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 E6058288F3 for ; Tue, 19 Jun 2018 09:08:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756374AbeFSJHk (ORCPT ); Tue, 19 Jun 2018 05:07:40 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:40698 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756548AbeFSJHi (ORCPT ); Tue, 19 Jun 2018 05:07:38 -0400 Received: by mail-wm0-f68.google.com with SMTP id n5-v6so20534466wmc.5 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=JZcEk1U9ECVlA6AsF6XUCmjEZzikTM9Zs3ALvjaV/uC9GrMO7bsToze7YFdCB7Z+RD wJTKGcXpTWModBPTDhbzH7k8LFWCcG2QteNCNXcBO2FP9edCL4IPY6vqGIjFhSpHVBMP pxGth5U647fZED4DpzjVg5y8Cvna08lIjKuU9W46UcOk/ak922O5GUfQmzl/2+6HXTi2 gzDpBduyYFWKh1vc/AoQMtJ1PbelFuCAIGUkNiM9HQoJ3vVaehndvcj1m+orjQtsYZde VJaKz+cfAeUBJeandZAatt3InBmIOnhaIElq8orQi3mU3xVQjjRPD0VdqpR3pkUH+6MY Oe0w== X-Gm-Message-State: APt69E3QS+r6fsFLFqVBEVGJnVnRy7eaB/3AO/8wdRxToEmrohBKPcbX khudwcI270SZgeg23hTYcRq8HZwADIY= X-Google-Smtp-Source: ADUXVKIoWWpsGNKCQQ5GWzDOVWx0ayccMzI4w3lq/Ra+9+UYLQ25VTvNh2IG23Sv2QMmgS6qZXnUbQ== 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-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 --- 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;