Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1222895ybg; Thu, 11 Jun 2020 04:23:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2323RyyV3dvN1VVd85bTk763yCo+pUzYT6rAZcXdqp6/pr5EOjiaqc/MxulrD7QzOlZDA X-Received: by 2002:aa7:c609:: with SMTP id h9mr6294767edq.155.1591874581019; Thu, 11 Jun 2020 04:23:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591874581; cv=none; d=google.com; s=arc-20160816; b=AhQgyFl/LjY3eLjd7BKgFQw0fVFZ+tqDmhhfmjoLV23hZuawCIKj8NQyS+km1iU2AU yoRlDKVu3Xaxv5GidNxrYpYHaib5pUTfFgLKZFhWZ52F+9XZ+RMIJr4CH7qXpzXUQA4+ GN1EwQbYkZNWGXDy9Gsf1r+yY4Hqq5aJlxuXdUl4eZSkjzWed8xK3Y1OLwmR+B0xjFtB 8mr1N7tuP0GG8CWzn7k/8yy9U5Hc3d6s+B4PClJopApxVh/e3XqQ5wl7/cAUUHVdF7o2 aaCP2VGRZAJqJ7QoXD7XNvEGCWpIfrjLpUp75f9OooncQCznVtocY/Ow4YhrSUW1ygFB cYHQ== 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 :references:in-reply-to:date:cc:to:from:subject:message-id :ironport-sdr:dkim-signature:ironport-sdr; bh=fc8RS+aeOeJRLw2UAd2OS2UThmwYDNumFzP1Uh95WNg=; b=ZY3B/J5JQ9d0kffIK0fG0M421pzoG2fUzRhTsJvN7V3g9s7SJNcwNa/uWfTZQ0vz5j ofBB6O4mEt1/bN94wr1NtVNtY8TzXqmXiBv7rdd5mVKZEqQrd+WKeQEw49SswkZcU6CW Gutxs78MN01wwrWNSPcprUNFXUnhaM4WTNHqO8O4802h2VPftzmE/5YAQ1LgNFRRHIRn tYyHt+hTlwuC/czRndHFpTrORhhfygTGnmfFqm+uxtHW/xcnD7Ne6PCeA+7BFY4hM4N7 ri1+fG7g+/bwhkaZgo4O0R3D7kFihRQpoYs58PZ8ERm3XSomL/EtpOVbk10goSL9It+w BoxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@tq-group.com header.s=key1 header.b=Il3HXSPN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx19si1430150edb.395.2020.06.11.04.22.38; Thu, 11 Jun 2020 04:23:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@tq-group.com header.s=key1 header.b=Il3HXSPN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728046AbgFKLUj (ORCPT + 99 others); Thu, 11 Jun 2020 07:20:39 -0400 Received: from mx1.tq-group.com ([62.157.118.193]:49594 "EHLO mx1.tq-group.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727931AbgFKLUh (ORCPT ); Thu, 11 Jun 2020 07:20:37 -0400 IronPort-SDR: TRlUY6Sbw6GBO2PUyaGsRLL3BOYH+iccJ/vi5DyPw98yEi1khuYV639z6MOp84Sr21bmx45RjB gp6VmhXap1miX9P7tf2DvnMcqxNirTE/I+UZmCWGLnv9bXRE70ZHn2HB8A15QhywkPkFCsyjW8 aufMr285bDtat7ldY3kXFMJWCG9t7p3beR3EtCmZMiqcN/pEnEaED3qt44tckgMwCbdiWnbc59 T75Feji9NfFv1Mdl9KW3dCXn4d8YM6BsYjEu+s7ZSzJXpmOPzsdb3GQJKsc05Vy3jk1QaZrX76 omQ= X-IronPort-AV: E=Sophos;i="5.73,499,1583190000"; d="scan'208";a="12649134" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 11 Jun 2020 13:20:32 +0200 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Thu, 11 Jun 2020 13:20:32 +0200 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Thu, 11 Jun 2020 13:20:32 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1591874432; x=1623410432; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=ucvXkYYt7tPx+/jxBJ3kWXHMAb4QHM7JJ1bBSklbroU=; b=Il3HXSPNoqV4h0Bj6C4G2Lm30B0tUYye7yhBpn5+WhKmA5CPxJna4CkA lgYqgnNadti+7d+Dumorl3GKD5+WZQVuyNWIxmLDXZRtWAXpWyvYbbHpj ZvJjRrzhej4SkCS7sf54+uobL0ZrenXPbr/Nlgj4k01WohruK4hOs0ywd 7Yss3U7CqeeSq/J99M5jTol0b0S4BemWlntfqJwrhkC38YFPj0wyxGw1T 5tjpW2y3J91AlU7erYhbD0zMJHoamZFbp9S4w4ya0CesrvFEs4m9XkNvL 2i0msZN2GnqlUBfUNEjueQfm68NvYdh3pwQxiMKkMS1iUr2DBC6cT5zLN g==; IronPort-SDR: id5UekctAs1cKGw03oHNfmPm++wv/9AyR2WgCFVEMSiQV/BSVf09oUtHs3gFYtLoZJqmDQqnPu HILsQ4+zt9AcZ/1XgHoDER8CPGZIgpWX3wF/t3oBtt5UQT8IKqKijeQwpKqi11T8xnKBkxdxdC ymkHY4KOIqUmQST00l72Csp9ld9tWfYmMq03jNT5s/3bW7S16KNle6dnUce2DT7dSF1g2PfPon 5BX4ui8Yeau6S0RU5NH2ChJ8500RtM2XdxAraSWZQgAkDGVcREmJ0GApYZaPGgK5e9W9XDwKJ/ Ybc= X-IronPort-AV: E=Sophos;i="5.73,499,1583190000"; d="scan'208";a="12649133" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 11 Jun 2020 13:20:32 +0200 Received: from schifferm-ubuntu4.tq-net.de (schifferm-ubuntu4.tq-net.de [10.117.49.26]) by vtuxmail01.tq-net.de (Postfix) with ESMTPA id B3679280065; Thu, 11 Jun 2020 13:20:33 +0200 (CEST) Message-ID: Subject: Re: (EXT) Re: Consistent block device references for root= cmdline From: Matthias Schiffer To: Ulf Hansson Cc: Al Viro , Jens Axboe , Sascha Hauer , "linux-mmc@vger.kernel.org" , linux-block , Linux Kernel Mailing List Date: Thu, 11 Jun 2020 13:20:30 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-06-10 at 16:52 +0200, Ulf Hansson wrote: > On Wed, 10 Jun 2020 at 15:15, Matthias Schiffer > wrote: > > > > Hello all, > > > > there have been numerous attempts to make the numbering of mmcblk > > devices consistent, mostly by using aliases from the DTS ([1], [2], > > [3]), but all have been (rightfully) rejected. Unless I have > > overlooked > > a more recent development, no attempts for a different solution > > were > > made. > > According to aliases attempts, I think those have failed, mainly > because of two reasons. > > 1. Arguments stating that LABELs/UUIDs are variable alternatives. > This > isn't the case, which I think was also concluded from the several > earlier discussions. > 2. Patches that tried adding support for mmc aliases, were not > correctly coded. More precisely, what needs to be addressed is that > the mmc core also preserves the same ids to be set for the host class > as the block device, mmc[n] must correspond to mmcblk[n]. > > > > > As far as I can tell, the core of the issue seems to be the > > following: > > > > The existing solutions like LABELs and UUIDs are viable > > alternatives in > > many cases, but in particular on embedded systems, this is not > > quite > > sufficient: In addition to the problem that more knowledge about > > the > > system to boot is required in the bootloader, this approach fails > > completely when the same firmware image exists on multiple devices, > > for > > example on an eMMC and an SD card - not an entirely uncommon > > situation > > during the development of embedded systems. > > > > With udev, I can refer to a specific partition using a path like > > /dev/disk/by-path/platform-2194000.usdhc-part2. In [4] it was > > proposed > > to add a way to refer to a device path/phandle from the kernel > > command > > line. Has there been any progress on this proposal? > > Lots of time during the years I have been approached, both publicly > and offlist, about whether it would be possible to add support for > "consistent" mmcblk devices. To me, I am fine with the aliases > approach, as long as it gets implemented correctly. It seems the principal technical problem is the one described here: https://www.spinics.net/lists/linux-mmc/msg26602.html I don't see any way to solve this completely, as there seem to be two fundamentally conflicting requirements: 1) If a mounted SD card is replaced, it must be assigned a new /dev/mmcblkN 2) /dev/mmcblkN should always match the configured alias IDs What is the reason we need 1) - is it possible to have multiple eMMCs or SD cards on a single bus, with detection at runtime? Otherwise I'd expect this to be handled like other drives with removable media (CD, floppy), with static device assignment. If we can't give up on 1) for some reason, we'll have to accept that we can't guarantee 2) unconditionally. As far as I can tell, the patches provided by Sascha and others did that in a reasonable way: The aliases would work in most cases - in particular for the first assignment on boot, which is required to find the correct rootfs. > > > > > Kind regards, > > Matthias > > > > > > [1] https://patchwork.kernel.org/patch/8685711/ > > [2] https://lore.kernel.org/patchwork/cover/674381/ > > [3] https://www.spinics.net/lists/linux-mmc/msg26586.html > > [4] https://www.spinics.net/lists/linux-mmc/msg26708.html > > > > Kind regards > Uffe