Received: by 2002:ac0:950e:0:0:0:0:0 with SMTP id f14csp1306900imc; Sun, 17 Mar 2019 10:01:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/g+M5h8KrCNCIK20k4G1gsAki366fgeMPYQ2AYDHRhj5Aqq30onbM81PECIOD228b4iVS X-Received: by 2002:a62:484:: with SMTP id 126mr14802878pfe.91.1552842112001; Sun, 17 Mar 2019 10:01:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552842111; cv=none; d=google.com; s=arc-20160816; b=zm+l+BvzHqqISn7j9wMviJX7b34uzF1bPzELUIhiTu4dACa4Ckf5C+qay5AzQ2QJUp ExqdbxkyRKlILAZcnEzhZplLBOzN82TAZcQAp/0IBknphulKkzi7/zJODHh+eVp8SUtc a9GhhRVkywA1/POp06T+88wdLWm1uhqMPS18ZjuMJJ0mPMYERfY2yK8PzWEAuAeIxHCu DHxuK4VU+rE60mtzl2TSbSTWKEkWydIErvjaOGF98iwOcd4EVTaBTwVm5dKnMKDC9boH AWoZ/DJuYXrR2/VWjaflJaxr5mkCr0YIE2L5tqCvI4SpzAyHoFN4Pvqz8MmRcTd0981F UlOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=FSAHrdPEAHTZL69tb6V0q+pfq60h0JvTht2TfMk67Oc=; b=ISDKnr8t4jSc3JqdeTTvLXUxXCmbEAZ7sJPjAVo0X6GBUc3HP1zcH5PvLvODDS73hB 3ryFqLLXeD/GdHckxYylHotoC+iXbhkrCmX9un2t0JafsQ12erB5rfEDJKKg6DBlrtN2 VMAZY61xi5ZgucQOHOE1G7s4gvwoO8Oj8Y8o8uL2gI3Edq10y3Ecjhh5JcNbzVE+gM7A RRr8NeKGI+vzViBJhFg1mtso1rKiyiR8VImxYl7HXUMMJxs3RrVS8W7/qhCzaJ4kz0+q DAUsbeFdVErb/LGrvi85AgS+qr4vo4kVhXrfwaR0EBMHD0mUC3TEtjyeD7OKpyD3rAXz 4xfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=uCQOJL+6; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g132si7460152pfc.240.2019.03.17.10.01.35; Sun, 17 Mar 2019 10:01:51 -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=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=uCQOJL+6; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726744AbfCQRAt (ORCPT + 99 others); Sun, 17 Mar 2019 13:00:49 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:39298 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725946AbfCQRAs (ORCPT ); Sun, 17 Mar 2019 13:00:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=FSAHrdPEAHTZL69tb6V0q+pfq60h0JvTht2TfMk67Oc=; b=uCQOJL+6HkCJNBuEbr7nwcYjf e8e872+Q/2YbIoL4ShlOfUhlvieEzcNLLjqndJqvX7A8AxGsG05/ZHWGPpBFJdu2Qg4pVZMNc8EFX AkWnI9iP/1xrpdTnDaHx/Mu//BQZGf63mARWuCiyK3fGo9EjFJ7dA1gc6mYeS63BQeIyOgkYJAgE7 lBgXX0g6abrhKiod2vSRZmMYxGEwMwtdw1OGOoYtMj6aUdXlEW7JNmGLgAGMolkbEb65zfWa3jcMg MI3e+k1vf0TGd3urpT9xa7pwJYh6sWOexSMDemSzGGsd4zJ0eZQDH8OJlriltpDdB2isViI0nsSv7 1uS6OPl0Q==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:51776) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1h5Z8w-0002SM-Qf; Sun, 17 Mar 2019 17:00:15 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.89) (envelope-from ) id 1h5Z8f-00050X-Cl; Sun, 17 Mar 2019 16:59:57 +0000 Date: Sun, 17 Mar 2019 16:59:57 +0000 From: Russell King - ARM Linux admin To: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= Cc: Stefan Agner , Marek Vasut , Tim Harvey , 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 , vbyravarasu@nvidia.com, Lars-Peter Clausen , jonathanh@nvidia.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Pawel Moll , Ian Campbell , grundler@chromium.org, Kumar Gala , lporzio@micron.com, Rob Herring , chaotian.jing@mediatek.com, Sergei Shtylyov , sudeep.holla@arm.com, zhonghui.fu@linux.intel.com, kirill.shutemov@linux.intel.com Subject: Re: [PATCH v2 0/4] Patches to allow consistent mmc / mmcblk numbering w/ device tree Message-ID: <20190317165957.k6lxxaq3hbs2owqz@shell.armlinux.org.uk> References: <1461951139-6109-1-git-send-email-dianders@chromium.org> <1fcd4dad-1e00-67cc-ac5d-24640ae34340@denx.de> <20190316153900.xqi55awrockovmsi@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) 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 04:48:24PM +0000, M?ns Rullg?rd 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 more > >> than one eMMC device on the system, they can be found either by looking > >> for /dev/mmcblk*boot* or by querying udev. The advantage of using udev > >> is you can discover the physical device behind it by looking at DEVPATH, > >> ID_PATH, etc, but you may not have that installed on an embedded device. > >> > >> 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 is > >>> > stable. On some hardware, with an unpatched kernel, the mmc device > >>> > numbering changes depending on whether or not an SD card is inserted 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 independent > >> 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 past > >> to confuse the issue - as shown above, it is now dependent on the host > >> numbering order not the order in which cards are inserted. > > > > Commit 9aaf3437aa72 ("mmc: block: Use the mmc host device index as the > > mmcblk device index") which came in with v4.6 enables constant mmc block > > 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 board > > 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. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up