lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ+vNU0v8FXStXCfJUk5uJXiPuGGFLNW7aHOYfSoNJgu9qXHKw@mail.gmail.com>
Date:   Wed, 27 Mar 2019 10:37:19 -0700
From:   Tim Harvey <tharvey@...eworks.com>
To:     Russell King - ARM Linux admin <linux@...linux.org.uk>
Cc:     Måns Rullgård <mans@...sr.com>,
        Stefan Agner <stefan@...er.ch>, Marek Vasut <marex@...x.de>,
        Douglas Anderson <dianders@...omium.org>,
        Ulf Hansson <ulf.hansson@...aro.org>,
        Jaehoon Chung <jh80.chung@...sung.com>,
        shawn.lin@...k-chips.com, Adrian Hunter <adrian.hunter@...el.com>,
        Linux MMC List <linux-mmc@...r.kernel.org>,
        Brian Norris <computersforpeace@...il.com>,
        Dmitry Torokhov <dmitry.torokhov@...il.com>,
        Heiko Stuebner <heiko@...ech.de>,
        Jisheng Zhang <jszhang@...vell.com>,
        linux-rockchip@...ts.infradead.org,
        devicetree-spec@...r.kernel.org,
        Mark Rutland <mark.rutland@....com>,
        open list <linux-kernel@...r.kernel.org>,
        Venu Byravarasu IN <vbyravarasu@...dia.com>,
        Lars-Peter Clausen <lars@...afoo.de>, jonathanh@...dia.com,
        linux-arm-kernel@...ts.infradead.org, devicetree@...r.kernel.org,
        Pawel Moll <pawel.moll@....com>,
        Ian Campbell <ijc+devicetree@...lion.org.uk>,
        Grant Grundler <grundler@...omium.org>,
        Kumar Gala <galak@...eaurora.org>, lporzio@...ron.com,
        Rob Herring <robh+dt@...nel.org>,
        Chaotian Jing <chaotian.jing@...iatek.com>,
        Sergei Shtylyov <sergei.shtylyov@...entembedded.com>,
        sudeep.holla@....com, zhonghui.fu@...ux.intel.com,
        kirill.shutemov@...ux.intel.com
Subject: Re: [PATCH v2 0/4] Patches to allow consistent mmc / mmcblk numbering
 w/ device tree

On Sun, Mar 17, 2019 at 10:00 AM Russell King - ARM Linux admin
<linux@...linux.org.uk> wrote:
>
> On Sun, Mar 17, 2019 at 04:48:24PM +0000, Måns Rullgård wrote:
> > Stefan Agner <stefan@...er.ch> 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.
>
> SATA does not.  SCSI devices, whether they are disks, cdroms, tape
> drives or whatever have always been allocated dynamically in the
> order that they are discovered.
>
> Ethernet also does not, and davem remains opposed the idea of fixed
> allocation in the kernel.
>
> It's only a minority that demand fixed enumeration of devices.
>

Russell,

How does this case differ form defining a 'stdout-path' in the chosen
node of the device-tree [1] purposed to provide a path to the boot
console device among multiple UART's a board may have.

Again, I'm merely trying to overcome the fact that on one of my IMX6
boards usdhc2 registers as 'mmcblk0' and is an SDIO radio while usdhc3
registers as 'mmcblk1' and is the only 'bootable' device. I'm not all
that familiar with SDIO drivers... perhaps its completely wrong that
the IMX6 MMC driver is registering usdhc2 as a 'block device'?

Tim
[1] https://www.kernel.org/doc/Documentation/devicetree/bindings/chosen.txt

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ