Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp289140pxa; Wed, 5 Aug 2020 00:51:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxm+aYi+o2xoslfakbuiLFu3M/65O9lDmq7Yn73jqCV9kEoAFQLnLuZge9jXj3NPpeuCzup X-Received: by 2002:a17:906:1414:: with SMTP id p20mr1885771ejc.247.1596613902701; Wed, 05 Aug 2020 00:51:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596613902; cv=none; d=google.com; s=arc-20160816; b=dE2fx3Rjh7+KuE7Qpgwf9bmucHRCIC5p6SdGCQHNWUylpL0ZSVAuNZKB+qyOs+MOrZ P11qVVZswhCLwONQTrVvcvS7scJlKGtgjEYjdkMORKqRRtKPqoj0cOVohN+ChL8KITgR WBm4Vjg24xRnamcFiMCkeWc2Ayr3dakPcq57joE3g8ziMBQEkybl10dsdEC2nqYp+4ZF NDyvSH+uH3A/Te86cpmdpzbpeecpLTGcd+htVXGb+7MQhjEqX9rLFujNTLoynn85JKPI 7l5hFpzp/3IfWE4IKawfdf9DruLlYfUFke9DnMaApzgNL5BSBKuUfCP/WHwSjTGxtkN4 gLIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=gj5SkepGEW+lETvyOPuyK01bP55UQABNwY/RW5WoiJM=; b=MyMXkXpQ+4noqT6GO0H42/N0f/hKKl4OWxWDA1BBtpRbUNfN3wSIC3KxJflI2vCscg K0xt33IqirSQrDs5AoqBLKvGCQcEZAWM+6lCmO5W2dckokKanfC6Dh48gtqXZaSI2bDc bF7DeRVWXGCKarhhzKRtqQhgqOLqWsKPUqauYQp6iTopdPDGvyhUcN+OeGqK7xDxZAQc G72d3bt6e+sOKfQd55i/jD3+ir6bMWbEWX5A5HYXCNxmuZMo6JsreS4o7DLvB3uWZAE3 PBv8QCb3VloZBZ/HG5VCjQIFeujud88Wzijav2i0RlsXCa4wwhHzd4egjRg7dlrkkCoV xmZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v+JgvnM9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 23si785309edx.559.2020.08.05.00.51.20; Wed, 05 Aug 2020 00:51:42 -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=pass header.i=@linaro.org header.s=google header.b=v+JgvnM9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727867AbgHEHus (ORCPT + 99 others); Wed, 5 Aug 2020 03:50:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727054AbgHEHuo (ORCPT ); Wed, 5 Aug 2020 03:50:44 -0400 Received: from mail-ua1-x931.google.com (mail-ua1-x931.google.com [IPv6:2607:f8b0:4864:20::931]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C788BC06174A for ; Wed, 5 Aug 2020 00:50:43 -0700 (PDT) Received: by mail-ua1-x931.google.com with SMTP id 4so8897252uav.8 for ; Wed, 05 Aug 2020 00:50:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gj5SkepGEW+lETvyOPuyK01bP55UQABNwY/RW5WoiJM=; b=v+JgvnM94+n4xy56dO+7zH4S6cRMiq122hMjDr16960VGLHmZ9x7hZt+xMACqjtMBw 4YWQB/add8XR6DKbGkgxwf4IeWSfvDG97fXYpjsv6s8kkrCBjyk36UeyreoVlzByW5xo iuZgIy2LwS1heLM36TwLZzcz/31dH6/hWP9MEi+k1Ls/0EqN5O34n3CRJX8Ocvy/lFRs HXTyHJf8W2/InzSr1U/KB2k4Nlf6OkK27DZms+wt7Y/T20lVJycCuoHncYEVJkzfUzU0 KI1sxOOGmXICSsOF/eSse9NpXubA5u2xbfFPxElvM0HLwNwQySZOx2YM3JofFvAq//wo qb/w== 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; bh=gj5SkepGEW+lETvyOPuyK01bP55UQABNwY/RW5WoiJM=; b=cpsY8pgcK03KQfaJwH3ljfgW4sWZ9fwYd3JH0cSVLkaFH+/tEkdJVD029PT6lTiyxj coDMs805C6mF3YqGTHjmt30gQm0M4KFY6eKfJwBmfUFAj/Jim74xEsvmlxp0tLXeWRJb 5wpTRCk5m4shRmB0mKELOI2WnI8KircF9C1DsjqBxxxx4OQzOOhIMorf46Gdd+fmT/Dx 7ViEWWAe44PqLe3gt3+DhKGXvE4AR9qu+YX2mkhSJLN2x05cEShvrQGTvcBAiDK6nNg/ R0GSt3kT+R64BLMyYS0binn5/mRzLYPQPXCsYNxFVWsjRDYkTj2rEIIy6cSrb4WCh79Y cHvw== X-Gm-Message-State: AOAM533P+LA+e9AycE0TSb2lMREB1IRYBmkeE3y+L3epghmQAKrFCUqz 9nfZgme/T486hth81vUD0S3HGhGQH9PqikMCbFWoyg== X-Received: by 2002:ab0:1c14:: with SMTP id a20mr1150946uaj.129.1596613842255; Wed, 05 Aug 2020 00:50:42 -0700 (PDT) MIME-Version: 1.0 References: <4ecc41303f9232319cedf414fc466a8c4c0c6dc6.camel@ew.tq-group.com> In-Reply-To: <4ecc41303f9232319cedf414fc466a8c4c0c6dc6.camel@ew.tq-group.com> From: Ulf Hansson Date: Wed, 5 Aug 2020 09:50:06 +0200 Message-ID: Subject: Re: (EXT) Re: (EXT) Re: Consistent block device references for root= cmdline To: Matthias Schiffer Cc: Al Viro , Jens Axboe , Sascha Hauer , "linux-mmc@vger.kernel.org" , linux-block , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 29 Jul 2020 at 10:43, Matthias Schiffer wrote: > > On Tue, 2020-07-07 at 16:14 +0200, Ulf Hansson wrote: > > On Thu, 11 Jun 2020 at 13:20, Matthias Schiffer > > wrote: > > > > > > 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? > > > > Yes. The mmc_bus_type holds all cards - all discovered 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. > > > > Well, if we would pre-parse the DTB to look for all "mmc block > > aliases" and keep a mark of those ids as being reserved, then we > > should be able to cope with both 1) and 2). > > Hello Ulf, > > it seems to me like Sascha's patches from 2014 do precisely that: > > https://www.spinics.net/lists/linux-mmc/msg26587.html > https://www.spinics.net/lists/linux-mmc/msg26588.html > > I haven't looked into porting this to a modern kernel yet, but do you > think that the approach is sound? Yes, something along those lines. Kind regards Uffe