From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andre Przywara Date: Thu, 20 May 2021 17:55:42 +0100 Subject: [BUG] Re: [PATCH v2 2/2] mmc: mmc-uclass: Use dev_seq() to read aliases node's index In-Reply-To: <189016b3-ce51-8ad7-d605-e3b664fec4e7@gmx.de> References: <20210325071848.27181-1-a-govindraju@ti.com> <20210325071848.27181-3-a-govindraju@ti.com> <189016b3-ce51-8ad7-d605-e3b664fec4e7@gmx.de> Message-ID: <20210520175542.0df4f635@slackpad.fritz.box> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, 20 May 2021 18:32:38 +0200 Heinrich Schuchardt wrote: Hi Heinrich, > On 25.03.21 08:18, Aswath Govindraju wrote: > > Use dev_seq() to read aliases node's index and pass it as device number > > for creating bulk device. > > > > Suggested-by: Grygorii Strashko > > Signed-off-by: Aswath Govindraju > > Reviewed-by: Jaehoon Chung > > Since this patch merged as commit 2243d19e5618122 SD cards on > orangepi_pc_defconfig are not detected anymore. > > => mmc rescan > MMC Device 0 not found > no mmc device at slot 0 > => Thanks for the report! This is a known issue, please join the discussion here: https://lists.denx.de/pipermail/u-boot/2021-April/447472.html I am in the middle of some patch to make fastboot detect the eMMC, which would render the need for this "mmc1 = &mmc2;" alias in our sunxi-u-boot.dtsi obsolete. Removing this line should restore the old probe order. However this is probably a bigger change (and affects other platforms), so this is not 2021.07 material anymore. I will push for this original patch of mine again (adding an mmc0 alias), once I have a proof of concept for the proper fastboot fix. As you figured, this is a serious user-visible regression, so we need to fix this. Cheers, Andre > > Best regards > > Heinrich > > > --- > > drivers/mmc/mmc-uclass.c | 12 +++++------- > > 1 file changed, 5 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c > > index 53eabc9e612d..d36aae367e7c 100644 > > --- a/drivers/mmc/mmc-uclass.c > > +++ b/drivers/mmc/mmc-uclass.c > > @@ -383,18 +383,16 @@ int mmc_bind(struct udevice *dev, struct mmc *mmc, const struct mmc_config *cfg) > > { > > struct blk_desc *bdesc; > > struct udevice *bdev; > > - int ret, devnum = -1; > > + int ret; > > > > if (!mmc_get_ops(dev)) > > return -ENOSYS; > > -#ifndef CONFIG_SPL_BUILD > > - /* Use the fixed index with aliase node's index */ > > - ret = dev_read_alias_seq(dev, &devnum); > > - debug("%s: alias ret=%d, devnum=%d\n", __func__, ret, devnum); > > -#endif > > + > > + /* Use the fixed index with aliases node's index */ > > + debug("%s: alias devnum=%d\n", __func__, dev_seq(dev)); > > > > ret = blk_create_devicef(dev, "mmc_blk", "blk", IF_TYPE_MMC, > > - devnum, 512, 0, &bdev); > > + dev_seq(dev), 512, 0, &bdev); > > if (ret) { > > debug("Cannot create block device\n"); > > return ret; > > >