From patchwork Thu Oct 25 23:38:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Zhoujie Wu X-Patchwork-Id: 10656813 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BB83413BF for ; Thu, 25 Oct 2018 23:36:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACB0E2C29D for ; Thu, 25 Oct 2018 23:36:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E53C2C57C; Thu, 25 Oct 2018 23:36:00 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham 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 417902C29D for ; Thu, 25 Oct 2018 23:36:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727567AbeJZIKh (ORCPT ); Fri, 26 Oct 2018 04:10:37 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:47836 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727511AbeJZIKh (ORCPT ); Fri, 26 Oct 2018 04:10:37 -0400 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.23/8.16.0.23) with SMTP id w9PNZsun017758; Thu, 25 Oct 2018 16:35:55 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=pfpt0818; bh=XB+eCas+C/3PdJg8bUM9QSxvmPCCCzK6fDNYzuDXs/Y=; b=C2RlNoTNU7PvhxsEcHvZyddOvL43eZ3x80cNzbpvf+uA9FQ1RVvxTv1dNoiU1SBJwpIa T2u80i+BjHE+Vbp9wrb53Wt+Z23VzjVZNRaa/lROd49PY0W34kXYDvyhcM/8XljpIUP0 mopKdk5wEdPwKW23xHREPD6ryoM6kFy9R/AG63Oz8WTb5kgz0rlWeYDRc6iyoWULj1cZ MfeHJ6JzIwP2OUaNFEIMuzw5MDqs5I7NZ1dHiszvRzu1zP7tseXyrI7l/6JnvZ95dIb4 B4es8rHBsTBdo8bS+ixJR+hLWBNoaxYfw9gMslp9GKR3kvplwZKiV7qtCeHXaGEJP9Ta tw== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 2nb3xcvf7q-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 25 Oct 2018 16:35:55 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 25 Oct 2018 16:35:41 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 25 Oct 2018 16:35:41 -0700 Received: from an-git01.marvell.com (unknown [10.80.127.149]) by maili.marvell.com (Postfix) with ESMTP id BA9C43F703F; Thu, 25 Oct 2018 16:35:41 -0700 (PDT) From: Zhoujie Wu To: , , CC: , Zhoujie Wu Subject: [PATCH v2] lightnvm: pblk: ignore the smeta oob area scan Date: Thu, 25 Oct 2018 16:38:26 -0700 Message-ID: <1540510706-32603-1-git-send-email-zjwu@marvell.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-10-25_12:,, signatures=0 X-Proofpoint-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810250195 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 The smeta area l2p mapping is empty, and actually the recovery procedure only need to restore data sector's l2p mapping. So ignore the smeta oob scan. Signed-off-by: Zhoujie Wu Reviewed-by: Javier González Reviewed-by: Hans Holmberg --- v2: Modified based on suggestion from Hans. The smeta may not start from paddr 0 if the first block is bad. Use pblk_line_smeta_start to calculate the smeta start address. drivers/lightnvm/pblk-recovery.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c index 5740b75..0fbd30e 100644 --- a/drivers/lightnvm/pblk-recovery.c +++ b/drivers/lightnvm/pblk-recovery.c @@ -334,6 +334,7 @@ static int pblk_recov_scan_oob(struct pblk *pblk, struct pblk_line *line, struct pblk_recov_alloc p) { struct nvm_tgt_dev *dev = pblk->dev; + struct pblk_line_meta *lm = &pblk->lm; struct nvm_geo *geo = &dev->geo; struct ppa_addr *ppa_list; struct pblk_sec_meta *meta_list; @@ -342,12 +343,12 @@ static int pblk_recov_scan_oob(struct pblk *pblk, struct pblk_line *line, void *data; dma_addr_t dma_ppa_list, dma_meta_list; __le64 *lba_list; - u64 paddr = 0; + u64 paddr = pblk_line_smeta_start(pblk, line) + lm->smeta_sec; bool padded = false; int rq_ppas, rq_len; int i, j; int ret; - u64 left_ppas = pblk_sec_in_open_line(pblk, line); + u64 left_ppas = pblk_sec_in_open_line(pblk, line) - lm->smeta_sec; if (pblk_line_wp_is_unbalanced(pblk, line)) pblk_warn(pblk, "recovering unbalanced line (%d)\n", line->id);