Received: by 2002:ac0:950e:0:0:0:0:0 with SMTP id f14csp1242073imc; Sun, 17 Mar 2019 08:08:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqyRVVpHlExasPEkJcPykBg9lbOcyZLVeAoI1yuCAeqgCzULvy8lwn1Q2RNZ0EDWLOZhvlyE X-Received: by 2002:a65:50c4:: with SMTP id s4mr13182614pgp.33.1552835334899; Sun, 17 Mar 2019 08:08:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552835334; cv=none; d=google.com; s=arc-20160816; b=GkI2m8BByw2U7qoieahj1UKccIMvyFek2DWB+kppZiXi438SUUvodhNObKzcVnZWOq nm9Z3uSWghvyudsgkgf312lF6YtU4SqCkmeFPcrtQPn7bUhzOPAmJgh/tc7QnfwupE+I 4TpM4OVEmwlWQH62IcfalpeSHOZHOweLZPZMZQYoveM6j/0Z8jb6HLeqyDLOszqylyLq K+Jin0mKI7uS559G154HTkxv94Rc+nlHVeAiFulCO32QlRrJT84Cxi/6VpsFhWWUqKtl tg0RFEnXGX+Afozque/+ORzsRKllw6U+7S4tDx7kBr/qfc82bo1sSJYzpTPkp5Nm0N05 PVQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=aTFARbxGgUnGdBTdGFzJcGORmSzLrU3aqVGd+shVha0=; b=cGAu/BKYP++z/sc45w6Q55w4DmcaSe8Cji3qANnyXvdlgOu6Y/xJeqYtu200h5CKWW iQq1HkahWVuNfQntiyn2nYyKNNK6Ogdr8vhNzk6Vsd/iAJUhTzzAtgcIPEi0FTWeX8fG xVi7LDmO8aklBSPuwUdb8g3GMcIbD+ScgZpoCQ0UWi95ERfdKPYeXP9rf3rcbzfnjFHF 95DgftbyoXMp1c/FLag3y488T4pP2S9mCm0zRz6Q/eV3fSZPXz/cy1APs9L//Dgb7JK1 Iqb+PGCa8iCdeByDzObHI9rCMWzS86A4UEo8APIZ3inYC2UOrJqt980mz23YTLWVAQlZ ZL1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=i+EK5p36; 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 p6si6882592pga.151.2019.03.17.08.08.28; Sun, 17 Mar 2019 08:08:54 -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=@agner.ch header.s=dkim header.b=i+EK5p36; 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 S1727364AbfCQPFT (ORCPT + 99 others); Sun, 17 Mar 2019 11:05:19 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:54658 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726802AbfCQPFT (ORCPT ); Sun, 17 Mar 2019 11:05:19 -0400 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 4A1775C2373; Sun, 17 Mar 2019 16:05:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1552835115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aTFARbxGgUnGdBTdGFzJcGORmSzLrU3aqVGd+shVha0=; b=i+EK5p36bYXbmTY/YB8sk1sW6cWJ2VKK7qnxgKbXn3rpp93NKtVmk1M/Dpe+N2kxvawtSb AEL/gbFdbd+LRh8b1xPKtETPYS6xbP5By32MeOkga1GLs9VgLjP9gTR4XNFi5AfEmuvNhT Dx+OGsVWlRoMvoAekAu8Yj2rjyBn1bE= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Sun, 17 Mar 2019 16:05:14 +0100 From: Stefan Agner To: Russell King - ARM Linux admin , Marek Vasut Cc: =?UTF-8?Q?M=C3=A5ns_Rullg=C3=A5rd?= , 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 In-Reply-To: <20190316153900.xqi55awrockovmsi@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> Message-ID: X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/1.3.7 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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. -- Stefan