Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5557448img; Wed, 27 Mar 2019 10:38:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxB/o+xThxKrHRoywvn7vtr/3aSvNOykIBfT78gigwVhYM9twNz5wb9IoLRM1AHSPJtVpoK X-Received: by 2002:a17:902:7d81:: with SMTP id a1mr30565841plm.202.1553708309542; Wed, 27 Mar 2019 10:38:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553708309; cv=none; d=google.com; s=arc-20160816; b=B8QNxuPkExSu0VmUlXMOLPYvBPp0WqLfS0eAR2p0jNILx3HyjUWUQdJD2KpPTxQn+p wqiPzin7FfPwXEX66qk+LaSNc7uDbHgKtUUIjCCu+y5NyFGqyHHWE2bhwEtzgW+aQJyy IZDe5y9o0XfxP8BEcpYvhPYC8cO6vVxoJhUj3+7ZRAVv2pbr+BehB4+6C83Dyl/WObuR GGbs3liefSyhfE459btT9EXfBdjTBIkhAP5xOd+BzfDqMepOw8GKN7gaefueCw5szNtO haZg6VLBkVmfDds9ryjwMqCcuNV5Qxiv7YQBsEf5wOeZRVgQ0zgy661m9tgyZwuJDXSm 7jhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=MHtzCk4c8gbQhdwp6tnk+5zKIn/L9uyLq6Kmd7z613Q=; b=DGBYBcKlqDNUoWv3vv9be4qbRhCxjDXmRXDGyrsCt022krtUem7JxEcwdPj6OZo3wb IVjYmJSmgrgTAal4g5ODM+Uw7VfDH8Tot6P4an/0wobq12owy1wBOHSMkF9Fl5fElSjx CUUV4zdnZl25z1z9XmjPjjYs1/+DTcFToLIp9G+/OXxjG4xp12+dCGYv2awHylUJf4x9 maBivRghDeHrR0CH2YnbuMUriC6LzgF6bvghL70evfOQSYW+xoeXkZ0CHTVnwBugzxmc hq+eejxqy0M6jEG1B5dPdHK4CIgUTiFmYKME7VrGyJRqP7wHZDOuyThMDB7pJF9tqVdB LD8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gateworks-com.20150623.gappssmtp.com header.s=20150623 header.b=wDOJk5jH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y18si19085674plp.357.2019.03.27.10.38.14; Wed, 27 Mar 2019 10:38:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gateworks-com.20150623.gappssmtp.com header.s=20150623 header.b=wDOJk5jH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728094AbfC0Rhc (ORCPT + 99 others); Wed, 27 Mar 2019 13:37:32 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:52751 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727484AbfC0Rhc (ORCPT ); Wed, 27 Mar 2019 13:37:32 -0400 Received: by mail-wm1-f65.google.com with SMTP id a184so872941wma.2 for ; Wed, 27 Mar 2019 10:37:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gateworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=MHtzCk4c8gbQhdwp6tnk+5zKIn/L9uyLq6Kmd7z613Q=; b=wDOJk5jH5vnl60vOJRrzFPZ/KVRvUTLpbW0JGGCugPu99lX0eEVV7GoPEYAZw1zaaF OG6jco7647hFwSNvKEMRdCLZa0DrKRuMJwCT9tmj7zH7rWFRNzgsZUPcUdpj6n2+pWkf Txf+tSif1F1PhDMpiyfffsXhDpj6CTpAwz+2FYmuXaDIK+9u2/3kHx64Xzx5SXtUz3Xq kKzjokoYYP0xheITTyiYV91EdaNWqwj9hOvk0g/YkQLpiCi+ZyfaYd+b2crFxWJ9U+62 gV6L34JeR3nXUGuYUM+26baqQ+03ACIYZal91S0vdK0BzfsRz/OrEmkIMJLwvUYOgqme KH1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=MHtzCk4c8gbQhdwp6tnk+5zKIn/L9uyLq6Kmd7z613Q=; b=kbxkpF6NFQ+DiK4M0qKi6VhDaGh2usEcV9nUwSFOjCxdXFjgx1g2wGbJblsbkeRNEX +AYBi8WJJJ/Hiu1cuOn4GAwU7ko/FyHj39hlAKFz/uAUVahnPBWEsf/zGBYtbl8Yszk0 1WEl63f6tQeHO6vRp0NUFR3AuJchhK88MbdwwEWZ4BfMjo/y5pbyNB1iWvOng2PZC30T OSYB6He3J6R9M2B1fVyRfnKFjI+3mcKRGbgyBXxaDhZP4DBYTlx4TZhbXfngOeo8mWZL zJ++YrKdj1HSfysovu2AU4oSGVxMXURlGJk+vFt5TKfxfXFyd2jhyhmAj4/fsFssNNBl UMQw== X-Gm-Message-State: APjAAAXUAGMc26oyNC+au6nAn7vLOzsERgUhOFypsWw6injOZIbjCmtY f97JNIWNOueglxf3b2KF0zlXFvPpOT0h8NMquH+7GQ== X-Received: by 2002:a1c:5f08:: with SMTP id t8mr12528794wmb.65.1553708250098; Wed, 27 Mar 2019 10:37:30 -0700 (PDT) MIME-Version: 1.0 References: <1461951139-6109-1-git-send-email-dianders@chromium.org> <1fcd4dad-1e00-67cc-ac5d-24640ae34340@denx.de> <20190316153900.xqi55awrockovmsi@shell.armlinux.org.uk> <20190317165957.k6lxxaq3hbs2owqz@shell.armlinux.org.uk> In-Reply-To: <20190317165957.k6lxxaq3hbs2owqz@shell.armlinux.org.uk> From: Tim Harvey Date: Wed, 27 Mar 2019 10:37:19 -0700 Message-ID: Subject: Re: [PATCH v2 0/4] Patches to allow consistent mmc / mmcblk numbering w/ device tree To: Russell King - ARM Linux admin Cc: =?UTF-8?B?TcOlbnMgUnVsbGfDpXJk?= , Stefan Agner , Marek Vasut , Douglas Anderson , Ulf Hansson , Jaehoon Chung , shawn.lin@rock-chips.com, Adrian Hunter , Linux MMC List , Brian Norris , Dmitry Torokhov , Heiko Stuebner , Jisheng Zhang , linux-rockchip@lists.infradead.org, devicetree-spec@vger.kernel.org, Mark Rutland , open list , Venu Byravarasu IN , Lars-Peter Clausen , jonathanh@nvidia.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Pawel Moll , Ian Campbell , Grant Grundler , Kumar Gala , lporzio@micron.com, Rob Herring , Chaotian Jing , Sergei Shtylyov , sudeep.holla@arm.com, zhonghui.fu@linux.intel.com, kirill.shutemov@linux.intel.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 17, 2019 at 10:00 AM Russell King - ARM Linux admin wrote: > > On Sun, Mar 17, 2019 at 04:48:24PM +0000, M=C3=A5ns Rullg=C3=A5rd wrote: > > Stefan Agner writes: > > > > > On 16.03.2019 16:39, Russell King - ARM Linux admin wrote: > > >> On Sat, Mar 16, 2019 at 01:33:58PM +0100, Marek Vasut wrote: > > >>> If you have a FS or partition table there, it does. > > >>> If you don't, I agree ... that's a problem. > > >> > > >> eMMC boot partitions are called mmcblkXbootY, and unless you have mo= re > > >> than one eMMC device on the system, they can be found either by look= ing > > >> for /dev/mmcblk*boot* or by querying udev. The advantage of using u= dev > > >> is you can discover the physical device behind it by looking at DEVP= ATH, > > >> ID_PATH, etc, but you may not have that installed on an embedded dev= ice. > > >> > > >> However, as I say, just looking for /dev/mmcblk*boot* is sufficient = to > > >> find the eMMC boot partitions where there is just one eMMC device > > >> present (which seems to be the standard setup.) > > >> > > >>> > I don't care the slightest what the numbering is, as long as it i= s > > >>> > stable. On some hardware, with an unpatched kernel, the mmc devi= ce > > >>> > numbering changes depending on whether or not an SD card is inser= ted on > > >>> > boot. Getting rid of that behaviour is really all I want. > > >>> > > >>> Agreed, that would be an improvement. > > >> > > >> The mmc device numbering was tied to the mmc host numbering a while = back > > >> and the order that the hosts are probed should be completely indepen= dent > > >> of whether a card is inserted or not: > > >> > > >> snprintf(md->disk->disk_name, sizeof(md->disk->disk_name), > > >> "mmcblk%u%s", card->host->index, subname ? subname = : ""); > > >> > > >> snprintf(rpmb_name, sizeof(rpmb_name), > > >> "mmcblk%u%s", card->host->index, subname ? subname = : ""); > > >> > > >> I suspect that Mans is quoting something from the dim and distant pa= st > > >> to confuse the issue - as shown above, it is now dependent on the ho= st > > >> numbering order not the order in which cards are inserted. > > > > > > Commit 9aaf3437aa72 ("mmc: block: Use the mmc host device index as th= e > > > mmcblk device index") which came in with v4.6 enables constant mmc bl= ock > > > device numbering. I can confirm that it works nicely, and it improved > > > the situation a lot. > > > > That's the answer I was looking for. I guess we can drop these patches > > from our kernels then. > > > > > That being said, we still use a patch downstream which allows > > > renumbering using an alias. We deal with a bunch of different boards > > > with different SoC's. I have a couple of SD cards with various rootfs > > > and use internal eMMC boot quite often as well. Remembering which boa= rd > > > uses which numbering is a pain. Maintaining a patch is just easier... > > > Furthermore, U-Boot allows reordering and all boards I deal with use = mmc > > > 0 for the internal eMMC. The aliases allow consistency. > > > > Since pretty much every other device type supports renumbering with DT > > aliases, it would make sense to do this for mmc as well. > > SATA does not. SCSI devices, whether they are disks, cdroms, tape > drives or whatever have always been allocated dynamically in the > order that they are discovered. > > Ethernet also does not, and davem remains opposed the idea of fixed > allocation in the kernel. > > It's only a minority that demand fixed enumeration of devices. > Russell, How does this case differ form defining a 'stdout-path' in the chosen node of the device-tree [1] purposed to provide a path to the boot console device among multiple UART's a board may have. Again, I'm merely trying to overcome the fact that on one of my IMX6 boards usdhc2 registers as 'mmcblk0' and is an SDIO radio while usdhc3 registers as 'mmcblk1' and is the only 'bootable' device. I'm not all that familiar with SDIO drivers... perhaps its completely wrong that the IMX6 MMC driver is registering usdhc2 as a 'block device'? Tim [1] https://www.kernel.org/doc/Documentation/devicetree/bindings/chosen.txt