Received: by 2002:ac0:950e:0:0:0:0:0 with SMTP id f14csp1301229imc; Sun, 17 Mar 2019 09:50:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxfsY54jt5y8xrMXBjRr9x3OPIodKES8nE0F8l92+oyVD0RQkhWcFm8LeLqSxdNMAqqCoOU X-Received: by 2002:a63:2c87:: with SMTP id s129mr13480022pgs.311.1552841450929; Sun, 17 Mar 2019 09:50:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552841450; cv=none; d=google.com; s=arc-20160816; b=eWIz9jZRKrYiS4MKoi9BmRysxGxOL5Q6j6AA+Jpq2JN7D7muPR4pAMDCk+WPZ1v8Kv Hjg9OJHjL9tqAtnozQwSFfnLbnf2llLUAklHTapnAmPfnwE8fAQ+2uElghMLt+j02ehn WbMKcD/jBPV2d7gMilfz6Sf1+AFLTBe6WhColYFrnDXxBlE/1iuG04F8EACuPpEaZOr/ OhA5nOggbEhA5r/XUoU6x6xlHE/xUkazBPpVVRl1YdRiRIrOCAkdLySBiJgL9NuN31Gp 1nr3U7dcoA11Y/RhLrYKoCLccnkIgh/KavBn3qFssdJJ5wX4XxG0R/kGMBew4Ac+2rLq rKow== 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:mime-version :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from; bh=bSpZsRABAFKAjYRBXZA+PpduCQr6w24hNJQGT6ayv6Y=; b=BKB6x5PZRhemM+JpLOdMjZCz8Bo7vpP5ZZic6FZrRtZ8PNwVLWXHOnW6FXawW/Y0mm uiYvBHet812G+rPr/E+NAsmxz+l9uyTZqDkOxaQShn33B9Hsiwm5cjciUwHeJXc1Tqao DnUNuCQbovfiJlp0hZYIUnkFa//HyW/El5AW9yqWtYN9xXHhT2QcTfMjn9ymp3FqMObs A7fK/1sPVWQP829FjZPneeZGFnKAZ7+U978y0nH+dO6W5z+gxA4AOCfDZQS3Q2eLMT6+ nDjWCZofGbG3AQZz7nAC6CZghMtIAYkWcSEnwkxCKBzuTOTnBAuwVL00cX1JTvFMTk96 2+QA== ARC-Authentication-Results: i=1; mx.google.com; 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 12si7794899plb.335.2019.03.17.09.50.35; Sun, 17 Mar 2019 09:50:50 -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; 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 S1726888AbfCQQs2 convert rfc822-to-8bit (ORCPT + 99 others); Sun, 17 Mar 2019 12:48:28 -0400 Received: from unicorn.mansr.com ([81.2.72.234]:47416 "EHLO unicorn.mansr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726493AbfCQQs1 (ORCPT ); Sun, 17 Mar 2019 12:48:27 -0400 Received: by unicorn.mansr.com (Postfix, from userid 51770) id EEB1915060; Sun, 17 Mar 2019 16:48:24 +0000 (GMT) From: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= To: Stefan Agner Cc: Russell King - ARM Linux admin , 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 References: <1461951139-6109-1-git-send-email-dianders@chromium.org> <1fcd4dad-1e00-67cc-ac5d-24640ae34340@denx.de> <20190316153900.xqi55awrockovmsi@shell.armlinux.org.uk> Date: Sun, 17 Mar 2019 16:48:24 +0000 In-Reply-To: (Stefan Agner's message of "Sun, 17 Mar 2019 16:05:14 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- M?ns Rullg?rd