Received: by 2002:ac0:950e:0:0:0:0:0 with SMTP id f14csp55423imc; Fri, 15 Mar 2019 14:53:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwMhs58Bo3MoDcF0INjNioIrks4o1z1JKD/2XZqGJMiv593ZMLB/1n1pw6J1+anWlQDrDxq X-Received: by 2002:a17:902:d894:: with SMTP id b20mr6574374plz.318.1552686817294; Fri, 15 Mar 2019 14:53:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552686817; cv=none; d=google.com; s=arc-20160816; b=QHWkWUl3VEzCOj1Fv+kq1UijhEpwNWDYIMhlxQFZvJfWUylSq3phHV+oH0NnEbRPu1 IP5ga9G3E3N5rH/Sbna/99sP88ybKQc4+AMrwr3NwakU8kg2geHpqqkJIKPLgoJ4mL+W k6OElBbAKsV5TKqV8tyM4LH9BfQc7hlugwGvYo6/YKknD+qJ3XmySQ9BxlIVCRsfmzuQ gYgnp3TUAy/gnYUSkUWIKAvz6CuAWBmwMj9Nyy0ifboOq8KH2ESWFDBo2CSv+SoHEt3N HRu8QMriZORLJUHYr3/r8IJ92Y7BctiN/plWWU5ON8HgBbirs+e2CiukpLccE4jlijp/ Ev5A== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Jk5leCOS/Mw4F1Qb3pxp/rPRbBsAN9mIty/axtt5WbU=; b=1KYI5DRG+OuHH0uuC44BEwWTY94I/MTUJdoj0e4KCsmNlAWuNUMKmxasau90obyMk1 lzPUplDaMjvzTxf+feonC1/6k04Rh4q4M/0rSLq93Ai4P3F1326oNErerZu6QZKQlqAS fbBLta6JjcLtPTbC/1BzPCQjhvJaEhbX9NutxN5mvSka4jubf2STEjB6vTuToMzqi0Aa 3WWQ5N6eGSmR/ByguqVE4W/+HxT/YyyohmxqV+oeIS1+oXc5tluTaJ1jLvxmt+0DQFnz PJPBoBZA4dm3hxlDqeOukGH4wpsVBll/etLKeb+hCupmb3A+EJ6sT702+wrkFiuRUvH0 299A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gateworks-com.20150623.gappssmtp.com header.s=20150623 header.b=wKdJ6Dm2; 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 37si2776273plq.275.2019.03.15.14.53.21; Fri, 15 Mar 2019 14:53:37 -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=@gateworks-com.20150623.gappssmtp.com header.s=20150623 header.b=wKdJ6Dm2; 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 S1726671AbfCOVwa (ORCPT + 99 others); Fri, 15 Mar 2019 17:52:30 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:38110 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726193AbfCOVwa (ORCPT ); Fri, 15 Mar 2019 17:52:30 -0400 Received: by mail-wr1-f65.google.com with SMTP id g12so11072560wrm.5 for ; Fri, 15 Mar 2019 14:52:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gateworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Jk5leCOS/Mw4F1Qb3pxp/rPRbBsAN9mIty/axtt5WbU=; b=wKdJ6Dm2+DxzO2aDnPhK8CloOrBCsB1ELQ4ZBHV91YjOVv1lMdbkV0wWiTCbpq2C7Q bgI5TIbojDT9KR6cAqj7df1VwGBWORVOFI+QkBriGt6wdyMpci8DiOq99C9IqkRU6ITB PDjAVGPnd31avU/tSrqMe+9+5M84lroSwIX02PwJT0vTsnWpy03v0OkMBkG1zbY9Mrmq QGmj/xVAdBV20LCV7LNwINnmppEWr6UBAFCM3leGS+J94HKAP6TtKk5CbvGgHCNCQ5dl Rw2XBLwlflw2duYRBThDo2liaZdHX62LT5SsFVWFs1MqzbSdCmhdyeolJGubeLBJDy4s xJ/g== 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:content-transfer-encoding; bh=Jk5leCOS/Mw4F1Qb3pxp/rPRbBsAN9mIty/axtt5WbU=; b=ohsfxAtiMnyAAy0nPAxLZWPnbQ8qNrqjLQ86xMgwEhMbfh5K9ZCt4E9f2kS9w/o8Fz xwK/bpwlYVFyzspbZ6XFTNouHitHWxO+CuCaB6n+9l4ktrj9uZcN6/904yMpTNbhzN7/ YjVfzPCMf3qFu3+PdWkK2YKA4lKNCVW/Kfmuinw/SRXVhGE8V0BQw4pwcyEfOdA404B/ E4Zcf2lnxC+rZ5P9egVjma/hSIawmqX5ARDSQI4ydMsqw85epyTmH6Y401Odkl4q1Zc7 YEFs8ckuG7jdO4kAqoN7jRfKRt/EiQ2sk10kNLJIPIYQfBHxQERb8sMIroxRHksmV2bY L/lA== X-Gm-Message-State: APjAAAX22lubmzjGADVwPnN/3m14+LSkwzEQD9NbHO6nrvYyYwjSw7km jhhSVxbhEJE5nDqtfcIBdsCsNH0TjwrgBjDl8EnogQ== X-Received: by 2002:a5d:690d:: with SMTP id t13mr3690760wru.135.1552686747969; Fri, 15 Mar 2019 14:52:27 -0700 (PDT) MIME-Version: 1.0 References: <1461951139-6109-1-git-send-email-dianders@chromium.org> In-Reply-To: From: Tim Harvey Date: Fri, 15 Mar 2019 14:52:10 -0700 Message-ID: Subject: Re: [PATCH v2 0/4] Patches to allow consistent mmc / mmcblk numbering w/ device tree To: =?UTF-8?B?TcOlbnMgUnVsbGfDpXJk?= , Marek Vasut Cc: Douglas Anderson , Ulf Hansson , Jaehoon Chung , shawn.lin@rock-chips.com, Adrian Hunter , stefan@agner.ch, 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 , Russell King - ARM Linux , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tim Harvey - Principal Software EngineerGateworks Corporation - http://www.gateworks.com/3026 S. Higuera St. San Luis Obispo CA 93401805-781-2000 On Tue, Mar 5, 2019 at 4:39 AM M=C3=A5ns Rullg=C3=A5rd wro= te: > > Douglas Anderson writes: > > > This series picks patches from various different places to produce what > > I consider the best solution to getting consistent mmc and mmcblk > > ordering. > > > > Why consistent ordering and why not just use UUIDs? IMHO consistent > > ordering solves a few different problems: > > > > 1. For poor, feeble-minded humans like me, have sane numbering for > > devices helps a lot. When grepping through dmesg it's terribly hand= y > > if a given SDMMC device has a consistent number. I know that I can > > do "dmesg | grep mmc0" or "dmesg | grep mmcblk0" to find info about > > the eMMC. I know that I can do "dmesg | grep mmc1" to find info > > about the SD card slot. I don't want it to matter which one probed > > first, I don't want it to matter if I'm working on a variant of the > > hardware that has the SD card slot disabled, and I don't want to car= e > > what my boot device was. Worrying about what device number I got > > increases my cognitive load. > > > > 2. There are cases where it's not trivially easy during development to > > use the UUID. Specifically I work a lot with coreboot / depthcharge > > as a BIOS. When configured properly, that BIOS has a nice feature t= o > > allow you to fetch the kernel and kernel command line from TFTP by > > pressing Ctrl-N. In this particular case the BIOS doesn't actually > > know which disk I'd like for my root filesystem, so it's not so easy > > for it to put the right UUID into the command line. For this > > purpose, knowing that "mmcblk0" will always refer to eMMC is handy. > > > > Changes in v2: > > - Rebased atop mmc-next > > - Stat dynamic allocation after fixed allocation; thanks Wolfram! > > - rk3288 patch new for v2 > > > > Douglas Anderson (1): > > ARM: dts: rockchip: Add mmc aliases for rk3288 platform > > > > Jaehoon Chung (1): > > Documentation: mmc: Document mmc aliases > > > > Stefan Agner (2): > > mmc: read mmc alias from device tree > > mmc: use SD/MMC host ID for block device name ID > > > > Documentation/devicetree/bindings/mmc/mmc.txt | 11 +++++++++++ > > arch/arm/boot/dts/rk3288.dtsi | 4 ++++ > > drivers/mmc/card/block.c | 2 +- > > drivers/mmc/core/host.c | 17 ++++++++++++++++- > > 4 files changed, 32 insertions(+), 2 deletions(-) > > Did anyone ever come up with an acceptable solution for this? After > three years, I'm getting tired of rebasing these patches onto every new > kernel. > > UUIDs or similar are NOT an option for multiple reasons: > > - We have two rootfs partitions for ping-pong updates, so simply > referring to "the thing with ID foo" doesn't work. > > - Installing said updates needs direct access the device/partition, > which may not even have a filesystem. > > - The u-boot environment is stored in an eMMC "boot" partition, and > userspace needs to know where to find it. > > I'm sure I'm not the only one in a similar situation. > > Russel, feel free to shout abuse at me. I don't care, but it makes you > look stupid. > Completely agree here - we need a dt solution that allows us to specify ordering. I support a variety of IMX6 boards where for PCB routing reasons the bootable MMC device is not always the first sdhc (sometimes the first one is an SDIO radio for example). It seems ridiculous that I can't handle this with: aliases { mmc0 =3D &usdhc3; /* MMC boot device */ mmc1 =3D &usdhc2; /* SDIO radio */ }; I see the imx6q-dhcom-som added in 52c7a088badd665a09ca9307ffa91e88d5686a7d re-defines the default imx6qdl.dtsi mmc0-mmc3 aiases but I don't see any handling of this in code anywhere - am I missing something? Marek, why did you change the alias ordering for imx6q-dhcom-som.dtsi? (maybe your carrying around a patch to make this useful?) + aliases { + mmc0 =3D &usdhc2; + mmc1 =3D &usdhc3; + mmc2 =3D &usdhc4; + mmc3 =3D &usdhc1; + }; Regards, Tim