{"id":807025,"url":"http://patchwork.ozlabs.org/api/1.0/patches/807025/?format=json","project":{"id":3,"url":"http://patchwork.ozlabs.org/api/1.0/projects/3/?format=json","name":"Linux MTD development","link_name":"linux-mtd","list_id":"linux-mtd.lists.infradead.org","list_email":"linux-mtd@lists.infradead.org","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<1504001833-18097-3-git-send-email-LW@KARO-electronics.de>","date":"2017-08-29T10:17:13","name":"[2/2] mtd: nand: complain loudly when chip->bits_per_cell is not correctly initialized","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"732288523a8bd338803f16079018e6533367605d","submitter":{"id":2554,"url":"http://patchwork.ozlabs.org/api/1.0/people/2554/?format=json","name":"Lothar Waßmann","email":"LW@KARO-electronics.de"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-mtd/patch/1504001833-18097-3-git-send-email-LW@KARO-electronics.de/mbox/","series":[{"id":341,"url":"http://patchwork.ozlabs.org/api/1.0/series/341/?format=json","date":"2017-08-29T10:17:11","name":"mtd: nand: fix regression introduced by splitting off manufacturer dependent code","version":1,"mbox":"http://patchwork.ozlabs.org/series/341/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/807025/checks/","tags":{},"headers":{"Return-Path":"<linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org; spf=none (mailfrom)\n\tsmtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133;\n\thelo=bombadil.infradead.org;\n\tenvelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"WUqZjBeY\"; \n\tdkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhPkb1Wfgz9sNc\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 29 Aug 2017 20:19:19 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dmdc4-0002pb-4k; Tue, 29 Aug 2017 10:19:16 +0000","from smtprelay03.ispgateway.de ([80.67.31.41])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dmdas-00025r-Ow\n\tfor linux-mtd@lists.infradead.org; Tue, 29 Aug 2017 10:18:10 +0000","from [89.1.81.74] (helo=ipc1.ka-ro)\n\tby smtprelay03.ispgateway.de with esmtpsa\n\t(TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89)\n\t(envelope-from <LW@KARO-electronics.de>)\n\tid 1dmdaV-00078f-Kb; Tue, 29 Aug 2017 12:17:39 +0200","from lothar by ipc1.ka-ro with local (Exim 4.84_2 #2 (Debian))\n\tid 1dmdaV-0004in-6d; Tue, 29 Aug 2017 12:17:39 +0200"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:\n\tMessage-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=pzsPaKA/xATTklG6rP3RmIT25XKF/lsKimUVGVds3lk=;\n\tb=WUqZjBeY2uP4AQ\n\tjB8SSf3HiVnCf6YgCHT6DGBwe+ZDT+zLzyTI+/SEiaVYg1+gQ5Nw4kUel5XWOq5HzmXIESLysRc+K\n\tc0uh8UKAj9SR598aLKhOCFBYlpM91VaieOD6g3pvYJ42u+APq1phfrrQmoZQwgt350sPnvgeNmI9L\n\tROhRx4SV/DodWWwixUVObQ8ncsPadI54UHCdrvbyVKxosasGIe0z8QKwGQfvhOOob8o4XiMBswm66\n\tShKt7dVWgJolNB/bsfZBgGMEm9YVyFTOonNm+QSwDF8nARn+sUxUsItUdrggts6QRazdtZkHRVx2A\n\tYqgvZNYUZL0tc0+hFl0Q==;","From":"=?utf-8?q?Lothar_Wa=C3=9Fmann?= <LW@KARO-electronics.de>","To":"Boris Brezillon <boris.brezillon@free-electrons.com>,\n\tBrian Norris <computersforpeace@gmail.com>,\n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>,\n\tDavid Woodhouse <dwmw2@infradead.org>,\n\tMarek Vasut <marek.vasut@gmail.com>, \n\tRichard Weinberger <richard@nod.at>, linux-kernel@vger.kernel.org,\n\tlinux-mtd@lists.infradead.org","Subject":"[PATCH 2/2] mtd: nand: complain loudly when chip->bits_per_cell is\n\tnot correctly initialized","Date":"Tue, 29 Aug 2017 12:17:13 +0200","Message-Id":"<1504001833-18097-3-git-send-email-LW@KARO-electronics.de>","X-Mailer":"git-send-email 2.1.4","In-Reply-To":"<1504001833-18097-1-git-send-email-LW@KARO-electronics.de>","References":"<1504001833-18097-1-git-send-email-LW@KARO-electronics.de>","MIME-Version":"1.0","X-Df-Sender":"bHdAa2Fyby1lbGVjdHJvbmljcy5kZQ==","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170829_031803_374299_87169E76 ","X-CRM114-Status":"UNSURE (   9.31  )","X-CRM114-Notice":"Please train this message.","X-Spam-Score":"-2.6 (--)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-2.6 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/,\n\tlow trust [80.67.31.41 listed in list.dnswl.org]\n\t-0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)\n\t[80.67.31.41 listed in wl.mailspike.net]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-0.0 SPF_HELO_PASS          SPF: HELO matches SPF record\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders","X-BeenThere":"linux-mtd@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-mtd/>","List-Post":"<mailto:linux-mtd@lists.infradead.org>","List-Help":"<mailto:linux-mtd-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>","Cc":"=?utf-8?q?Lothar_Wa=C3=9Fmann?= <LW@KARO-electronics.de>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Sender":"\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>","Errors-To":"linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"},"content":"chip->bits_per_cell which is used to determine the NAND cell type\n(SLC/MLC) should always have a value != 0.\nComplain loudly if the value is 0 in nand_is_slc() to catch use before\ncorrect initialization.\n\nSigned-off-by: Lothar Waßmann <LW@KARO-electronics.de>\n---\n include/linux/mtd/rawnand.h | 2 ++\n 1 file changed, 2 insertions(+)","diff":"diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h\nindex 94feece..2b05f42 100644\n--- a/include/linux/mtd/rawnand.h\n+++ b/include/linux/mtd/rawnand.h\n@@ -1234,6 +1234,8 @@ int onfi_init_data_interface(struct nand_chip *chip,\n  */\n static inline bool nand_is_slc(struct nand_chip *chip)\n {\n+\tWARN(chip->bits_per_cell == 0,\n+\t     \"chip->bits_per_cell is used uninitialized\\n\");\n \treturn chip->bits_per_cell == 1;\n }\n \n","prefixes":["2/2"]}