From patchwork Sat Mar 26 16:33:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 554393 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:1248:0:0:0:0 with SMTP id z8csp6564174mag; Sat, 26 Mar 2022 09:34:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoP9Qm9p2d0NdMwFQNznj4lU61CtrPY8dAW0T3S1cirokuHDbkTgy5O0nINx81Rsei60dB X-Received: by 2002:a63:6e0b:0:b0:397:f965:64a7 with SMTP id j11-20020a636e0b000000b00397f96564a7mr3968049pgc.581.1648312475830; Sat, 26 Mar 2022 09:34:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648312475; cv=none; d=google.com; s=arc-20160816; b=c+/K/HUf+qqlY6vd5EFXkBU8nlc2YQ8mJ4uB3p74W/p9Y1fmq/1dnbx3dh6a9o+/iB Ns0kJoSzuMY+bDbVWMWWre1aRKqUtyLnMEJ26rF1bTxg4nWJW2xeOVGHf+Nrcco0wLi5 xf6jFzSfdgRRe6WGVz5eQAdJ/qk/WAAk+xahlB5GPwCUdHJiA8oSgXCd2sduuxKY3Zb0 Grc4KYgikrgplIcVTF+SzsqIIl1owmLZkveRvhYaRn+bPoGahUWQVPVo0AWV8atkr6rx 0OiB5VQHSRzPby4J+QTv2H4OWGZS6StYkW6784K5P4FPGbvDHPjjm/f1JpZLPjCmNtK/ zPbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:message-id:date:subject:cc:to:from:dkim-signature :dkim-signature; bh=v+7nZKE2mtDj/YWKLGdBtbjblC/woGh099/pYAXF904=; b=homKn/hZc3avJjpGz2bUUD54oxCLGoRWaTUNweldlSfxBiHBkHtjHA9uWZb6DO9xPI xuQXIyqqMj25d4FINAtqOIEJpOGWGO/EDU8vyXMTxhqAwl9T7IAiGwv3WNopMOtuiLFw qZwtV4EZnMZbOPFZhMAzW6T4ARSsuNbda6JRVAMmDBOP1iz7Xco7yKFSBZ3fwQPJnoiA nL+AsA0XXnmtut7B685+puyjLHXBjgwLjXx5SiRfttgqak9uWpZq0UenA8cRd3nTdc+t 1SMx3+GFT7nEcQl8oj3Ql0o5ddXYhh+Yh4LLRA6Weh8RGkWtwT/Ui5zrfqeCzk//OJ/6 CSVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=fUWRba5B; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=QGxDXKm9; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id i6-20020a170902c94600b00153bffd0af8si6518046pla.491.2022.03.26.09.34.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Mar 2022 09:34:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=fUWRba5B; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=QGxDXKm9; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=v+7nZKE2mtDj/YWKLGdBtbjblC/woGh099/pYAXF904=; b=fUWRba5Bo3yqUK cw4q0GD75RAwAR59GaKczl3GwUJX3uOhE3rObTPmcO7LYg6N/ASP5vyVMsbQFcPdeCwKRZD9/WaGn a3biMzC0s/aj956j48C9FfhRZ1jS/RqzaZVxWR9txamMEjANkNz2sz58UwqJLi+TwORaPpJwxdxvV V+rZ/Hf3uxcFsxyABLGaPhFIlE+5EUsWugRZyh16VmPAO3VNv3wM2MbEsmRoI/nLeXUkDsEmmcyGI 80FjTT6Fdb3LezRDg97s6hD/05yt5rTuIfpK46LZwUYPDYhS5Nblo+0pZf10pBHHjBfgwLxXhxV3/ qcuvsLDMGE4pEkSjuqyw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nY9Lv-004Y8q-C5; Sat, 26 Mar 2022 16:33:23 +0000 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nY9Lr-004Y7x-BI for linux-mtd@lists.infradead.org; Sat, 26 Mar 2022 16:33:20 +0000 Received: by mail-lj1-x233.google.com with SMTP id u3so13961472ljd.0 for ; Sat, 26 Mar 2022 09:33:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=b/o6cWXwPEfNmyBK8+mkZmSj3tnXxybCImM/tuFapz8=; b=QGxDXKm9i/Nj+8JlKctiGaLJzLxk5EdPrHap5dio8KMADv6YYFhF6JiJhtjIy5WWi6 +Namhw1f9d8Dv+jucxZdZvJ/21uF6WKw1jrPevBqqXXyMPHFx5lz0Owtl/yfAtV71j2B 9+pZd4aKhxbu5la5UajtcIkwTu8St3gLxJ1pOeQwA/ensD7+Nx4coN1jXMsiB54hVdLp gX99hd4z3rpIEj1Q1zdbGgCnL+R6kkVfXZngMK4GllGY5M7FUjCPYDJISz4O4ULkDlV1 Q17KcH5jyb0npzNTfZsoonXQayALOKjz0xD8XvBH6fLXo7HPyKR9oCagXRWBvV+/CbYt JttQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=b/o6cWXwPEfNmyBK8+mkZmSj3tnXxybCImM/tuFapz8=; b=ws3sPulcUHzy8ippnvgUZPCcK3jkogU5X3Nb/ur5Txi3qplyA1XqBJgLBz+4j57a1C nDSsxGeBF/ss5fGJNZv+tYXROU6ClOQql0KgaVmOqj3hF0PB2dDl+yz907Epb9PtDyna JIWr57vW+N06/sTJhxc/1u4LCwZRMROfWFi8JOdZX4W6vWXir5bwzbNCIQqa5XNPlPqw 1XC8f94ST3EPBdVKWuk6lnqzQu/iIFjc/cgLeyY75h+Ce4GZfuJGvwg3oBjf2M897jjn V02GXfnHfQqHFrAI5rae/JPvs8Btbm/DUXMHeG/3qccN+umIwXoI/bu9cwyr3WLWm2qJ cy6w== X-Gm-Message-State: AOAM5339wC5J+yRS0dtT2JOI13VSIM6UAQlVudx+y8upd+29YEHTUKkx iDdxlgV9GEn3sjQEdaRXVJoEbH6uZ1w= X-Received: by 2002:a05:651c:1783:b0:249:43a8:b6f9 with SMTP id bn3-20020a05651c178300b0024943a8b6f9mr12381110ljb.273.1648312392718; Sat, 26 Mar 2022 09:33:12 -0700 (PDT) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id w22-20020a2e9996000000b00249824260f8sm1073407lji.25.2022.03.26.09.33.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Mar 2022 09:33:12 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: linux-mtd@lists.infradead.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH] mtd: rawnand: print offset instead of page number for bad blocks Date: Sat, 26 Mar 2022 17:33:04 +0100 Message-Id: <20220326163304.30806-1-zajec5@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220326_093319_445291_CF67A071 X-CRM114-Status: GOOD ( 12.12 ) X-Spam-Score: 0.1 (/) X-Spam-Report: =?utf-8?q?Spam_detection_software=2C_running_on_the_system_?= =?utf-8?q?=22bombadil=2Einfradead=2Eorg=22=2C?= =?utf-8?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_original?= =?utf-8?q?_message_has_been_attached_to_this_so_you_can_view_it_or_label?= =?utf-8?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?utf-8?q?_the_administrator_of_that_system_for_details=2E?= =?utf-8?q?_?= =?utf-8?q?_Content_preview=3A__From=3A_Rafa=C3=85=C2=82_Mi=C3=85=C2=82ecki_T?= =?utf-8?q?his_makes_printed_info_consistent_with?= =?utf-8?q?_other_kernel_messages=2E_After_scanning_NAND_BBT_create=5Fbbt=28?= =?utf-8?q?=29_prints_offset?= =?utf-8?q?_of_each_bad_block=2E_This_change_makes_is_easy_to_verify_nand=5Fe?= =?utf-8?q?rase=5Fnand=28=29?= =?utf-8?b?IGZhaWx1cmUgcmVhc28gWy4uLl0g?= =?utf-8?q?_?= =?utf-8?q?_Content_analysis_details=3A___=280=2E1_points=2C_5=2E0_required?= =?utf-8?q?=29?= =?utf-8?q?_?= =?utf-8?q?_pts_rule_name______________description?= =?utf-8?q?_----_----------------------_-------------------------------------?= =?utf-8?q?-------------?= =?utf-8?q?_-0=2E0_RCVD=5FIN=5FDNSWL=5FNONE_____RBL=3A_Sender_listed_at_https?= =?utf-8?q?=3A//www=2Ednswl=2Eorg/=2C?= =?utf-8?q?_no_trust?= =?utf-8?b?IFsyYTAwOjE0NTA6NDg2NDoyMDowOjA6MDoyMzMgbGlzdGVkIGluXQ==?= =?utf-8?b?IFtsaXN0LmRuc3dsLm9yZ10=?= =?utf-8?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_record?= =?utf-8?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publish_an_?= =?utf-8?q?SPF_Record?= =?utf-8?q?_0=2E0_FREEMAIL=5FFROM__________Sender_email_is_commonly_abused_en?= =?utf-8?q?duser_mail?= =?utf-8?q?_provider?= =?utf-8?q?_=5Bzajec5=5Bat=5Dgmail=2Ecom=5D?= =?utf-8?q?_0=2E2_FREEMAIL=5FENVFROM=5FEND=5FDIGIT_Envelope-from_freemail_use?= =?utf-8?q?rname_ends?= =?utf-8?q?_in_digit?= =?utf-8?q?_=5Bzajec5=5Bat=5Dgmail=2Ecom=5D?= =?utf-8?q?_-0=2E1_DKIM=5FVALID=5FAU__________Message_has_a_valid_DKIM_or_DK_?= =?utf-8?q?signature_from?= =?utf-8?q?_author=27s_domain?= =?utf-8?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_valid_DK?= =?utf-8?q?IM_or_DK_signature?= =?utf-8?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_signature?= =?utf-8?q?=2C_not_necessarily?= =?utf-8?q?_valid?= =?utf-8?q?_-0=2E1_DKIM=5FVALID=5FEF__________Message_has_a_valid_DKIM_or_DK_?= =?utf-8?q?signature_from?= =?utf-8?q?_envelope-from_domain?= X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org From: Rafał Miłecki This makes printed info consistent with other kernel messages. After scanning NAND BBT create_bbt() prints offset of each bad block. This change makes is easy to verify nand_erase_nand() failure reason. Signed-off-by: Rafał Miłecki --- I noticed this inconsistency while using "flash_erase" tool. --- drivers/mtd/nand/raw/nand_base.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c index 284fff62ac49..6b67b7dfe7ce 100644 --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c @@ -4502,11 +4502,13 @@ int nand_erase_nand(struct nand_chip *chip, struct erase_info *instr, len = instr->len; while (len) { + loff_t ofs = (loff_t)page << chip->page_shift; + /* Check if we have a bad block, we do not erase bad blocks! */ if (nand_block_checkbad(chip, ((loff_t) page) << chip->page_shift, allowbbt)) { - pr_warn("%s: attempt to erase a bad block at page 0x%08x\n", - __func__, page); + pr_warn("%s: attempt to erase a bad block at 0x%08llx\n", + __func__, (unsigned long long)ofs); ret = -EIO; goto erase_exit; } @@ -4524,8 +4526,7 @@ int nand_erase_nand(struct nand_chip *chip, struct erase_info *instr, if (ret) { pr_debug("%s: failed erase, page 0x%08x\n", __func__, page); - instr->fail_addr = - ((loff_t)page << chip->page_shift); + instr->fail_addr = ofs; goto erase_exit; }