From patchwork Fri Dec 4 06:48:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Schocher X-Patchwork-Id: 552578 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id BF2DD14029C for ; Fri, 4 Dec 2015 17:51:38 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a4kB4-0004Jd-Ko; Fri, 04 Dec 2015 06:49:10 +0000 Received: from mail-out.m-online.net ([212.18.0.9]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a4kB2-0004HJ-6i for linux-mtd@lists.infradead.org; Fri, 04 Dec 2015 06:49:09 +0000 Received: from mail.nefkom.net (unknown [192.168.8.184]) by mail-out.m-online.net (Postfix) with ESMTP id 3pBl494h7mz3hjMp; Fri, 4 Dec 2015 07:48:41 +0100 (CET) X-Auth-Info: kJS05y4REjB7JLp0PCJBcMLooT0CMY0bOZRM+xmglbY= Received: from localhost.localdomain (87.97.39.142.pool.invitel.hu [87.97.39.142]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-auth.mnet-online.de (Postfix) with ESMTPSA id 3pBl48394WzvdWS; Fri, 4 Dec 2015 07:48:40 +0100 (CET) To: Frans Klaver From: Heiko Schocher Subject: mtd, nand, omap2: parse cmdline partition fail Message-ID: <56613747.8040907@denx.de> Date: Fri, 4 Dec 2015 07:48:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151203_224908_635350_41A4DAE2 X-CRM114-Status: GOOD ( 14.60 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [212.18.0.9 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [212.18.0.9 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: hs@denx.de Cc: Boris BREZILLON , "Stahl Martin \(Helbling Technik\)" , linux-kernel@vger.kernel.org, Pekon Gupta , linux-mtd@lists.infradead.org, Nicholas Mc Guire , Brian Norris , David Woodhouse , Stefano Babic , Roger Quadros Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Hello Frans, I just tried current mainline kernel: commit 2255702db4014d1c69d6037ed7bdad2d2e271985 Merge: 9e5d25e c86576e Author: Linus Torvalds Date: Mon Nov 30 16:06:44 2015 -0800 Merge tag 'mn10300-for-linus-v4.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging on an am3517 based board (mainlining soon). And with your commit: commit 853f1c58c4b2: mtd: nand: omap2: show parent device structure in sysfs MTD partitions from cmdline are not longer detected: [ 2.087305] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xcc [ 2.094097] nand: Micron MT29F4G16ABADAWP [ 2.098303] nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64 [ 2.106296] nand: WARNING: MT29F4G16ABADAWP: the ECC used on your system is too weak compared to the one required by the NAND chip [ 2.118674] MT29F4G16ABADAWP: 'partitions' subnode not found on /ocp/gpmc@6e000000/nand@0,0. Trying to parse direct subnodes as partitions. [...] before this patch it worked: [ 2.307444] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xcc [ 2.314092] nand: Micron MT29F4G16ABADAWP [ 2.318348] nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64 [ 2.326331] nand: WARNING: omap2-nand.0: the ECC used on your system is too weak compared to the one required by the NAND chip [ 2.338336] 5 cmdlinepart partitions found on MTD device omap2-nand.0 [ 2.345129] Creating 5 MTD partitions on "omap2-nand.0": [ 2.350704] 0x000000000000-0x000000080000 : "MLO" [ 2.366877] 0x000000080000-0x000000180000 : "u-boot" [ 2.379179] 0x000000180000-0x0000001c0000 : "env1" [ 2.390627] 0x0000001c0000-0x000000200000 : "env2" [ 2.402255] 0x000000200000-0x000020000000 : "common_data" Reason is taht the mtd->name has changed from "omap2-nand.0" to the nand chip name ... If I revert this part from the patch It works again ... So the question is, is it intended to change the "mtd->name"? But wondering, if there are two or more identical nand chips in the system, they will have the same mtd->name ... which seems buggy to me... bye, Heiko diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index 93f664c..28dcf66 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c @@ -1685,6 +1685,7 @@ static int omap_nand_probe(struct platform_device *pdev) info->ecc_opt = pdata->ecc_opt; mtd = &info->mtd; mtd->priv = &info->nand; + mtd->name = dev_name(&pdev->dev); mtd->dev.parent = &pdev->dev; nand_chip = &info->nand; nand_chip->ecc.priv = NULL;