From patchwork Tue May 2 00:04:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 757356 X-Patchwork-Delegate: computersforpeace@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wH1lS2V92z9sNF for ; Tue, 2 May 2017 10:05:40 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="d7DcMgRY"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PIpdnFX4"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=DAhfy+lK3XzRdjBjjVqvy2lzYnqobGKNNXqS8cCk+3k=; b=d7DcMgRYiNWuBt5dSY3rk123aQ miK4Rln1RdGDn3+UyJQ2SJ42U2VQJ2rQtQQMIvPrt44+3AWNczjxvFcoV68BDUnRnCjvIEKL9FP85 k+vD8nFPiLmPTRSPzGK1Wp7I1h0WNB0qpYvA2irkezvitKP0oscL9fp/I0iyWoi46oVlaNahBlS6N yARjzHySQa38LzMIsp5b31KX5dfTAvwHesP85UXbQHeppgqTwkM0s9OL8LXu4NtZQiWudkj6pIyRK pVR+/T7Aj3az0hmLJ045EH7WHr9hoNWDq+48s0+N8cLkllVvSEoNUXf5pSoBYMcWKwuoHFwTrhto9 5xXNszbA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d5LJy-00028h-E7; Tue, 02 May 2017 00:05:38 +0000 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d5LJm-0001uM-4m for linux-mtd@lists.infradead.org; Tue, 02 May 2017 00:05:27 +0000 Received: by mail-pf0-x243.google.com with SMTP id g23so29729249pfj.1 for ; Mon, 01 May 2017 17:05:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ccYzQRRKCDGyxi10vSrrilKCE881nHoX/bSW73O/ISs=; b=PIpdnFX4CKl0rCoivuOqeA9q8lk5VNy/uvX5Xn1HcJ6CZuXWIhk9FZsEKjph/ZislK ujktHCPn8LVpz8JmoZ0MvwbO02FPvmMwFQwScdMQbj+Lvasj9VwMMjM4x+Sqb5Fo4vlH uVV6d0qYVjTROVdLzrabEKGX3eJBnpfRCyAyQalSE4VgCGOnQGsOupgVrrUSFWXOmbyD 5jgLhpaNbA1tcCyxuYioKQZqNRgw4DR10J02PkRk2b2FioPBw/V1ZnWZdV8yByXijlyZ XVhwu9vE3AVezdlVaWx0Z2Z8c0d5gILHjmXX7MmbJqA45YSIr53XCPiASFnF+A5Vb6lX bg6A== 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; bh=ccYzQRRKCDGyxi10vSrrilKCE881nHoX/bSW73O/ISs=; b=MaazSUPlmPSpVHQDRi5mnWbsNT0kGo6wIx6c62IobvrUp7tWHsDkqwRWeDTP/IegxJ P/PX9bcWSUw94rLWCO6wzEsiSONqoJg2wqIYqC0oeSoraWL/3SlJjP+F2fiSLD2Tk1J0 fBCvErzFFsUh6Qpu7pkoY/VTgqoRfHJC9IxCdcUIe9ynqpg9CsuUN2TRhMgh+BWWmw9e D9Rh15Crkhkm+EOZlQsnIpPr0U3tyjouq00IhmwIhFiP7L9RJA+f8J/x+Sr1QZ+rEgoc c0hOLwYT+V2Vt3nUxds8qUHu44oIPHWsJLyaNSxy6Egy75Wm047MAf7tPXJNN89S78Od irVA== X-Gm-Message-State: AN3rC/52Y+XuwqKKmIjVqHasUVcuER6zsNCvmoNUKbyw0GRGxIwaBYNh vruCPCisdUNUfA== X-Received: by 10.84.232.197 with SMTP id x5mr36553438plm.85.1493683509472; Mon, 01 May 2017 17:05:09 -0700 (PDT) Received: from ban.mtv.corp.google.com ([172.22.64.120]) by smtp.gmail.com with ESMTPSA id g22sm26756413pfd.22.2017.05.01.17.05.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 May 2017 17:05:08 -0700 (PDT) From: Brian Norris To: , Boris Brezillon Subject: [PATCH] mtd: nand: samsung: warn about un-parseable ECC info Date: Mon, 1 May 2017 17:04:55 -0700 Message-Id: <20170502000455.13240-6-computersforpeace@gmail.com> X-Mailer: git-send-email 2.13.0.rc1.294.g07d810a77f-goog In-Reply-To: <20170502000455.13240-1-computersforpeace@gmail.com> References: <20170502000455.13240-1-computersforpeace@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170501_170526_216331_E9C16658 X-CRM114-Status: UNSURE ( 9.09 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:400e:c00:0:0:0:243 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (computersforpeace[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cyrille Pitchen , Richard Weinberger , Hans de Goede , Brian Norris , Marek Vasut MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org We don't handle cases larger than 7. We probably shouldn't pretend we know the ECC step size in this case, and it's probably also good to WARN() like we do in many other similar cases. Cc: Hans de Goede Fixes: 8fc82d456e40 ("mtd: nand: samsung: Retrieve ECC requirements from extended ID") Signed-off-by: Brian Norris Acked-by: Boris Brezillon --- Compile tested only drivers/mtd/nand/nand_samsung.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mtd/nand/nand_samsung.c b/drivers/mtd/nand/nand_samsung.c index 9cfc4035a420..1e0755997762 100644 --- a/drivers/mtd/nand/nand_samsung.c +++ b/drivers/mtd/nand/nand_samsung.c @@ -84,6 +84,9 @@ static void samsung_nand_decode_id(struct nand_chip *chip) case 7: chip->ecc_strength_ds = 60; break; + default: + WARN(1, "Could not decode ECC info"); + chip->ecc_step_ds = 0; } } } else {