All of lore.kernel.org
 help / color / mirror / Atom feed
From: Francesco Dolcini <francesco@dolcini.it>
To: Mehmet Fide <mehmet.fide@gmail.com>,
	Marek Vasut <marek.vasut+usb@mailbox.org>
Cc: Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>,
	Fabio Estevam <festevam@gmail.com>,
	Stefan Agner <stefan@agner.ch>,
	Francesco Dolcini <francesco@dolcini.it>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	u-boot@lists.u-boot-project.org, mehmet.fide@screeningeagle.com
Subject: Re: [REGRESSION] [PATCH v9 1/9] fdtdec: match an alias to its stem only when the number follows it
Date: Sun, 22 Nov 2026 20:53:02 +0100	[thread overview]
Message-ID: <20261122195302.GA432275@francesco-nb> (raw)
In-Reply-To: <20261023111559.4081795-2-mehmet.fide@gmail.com>

Hello Mehmet, Marek,

On Fri, Oct 23, 2026 at 01:15:51PM +0200, Mehmet Fide wrote:
> From: Mehmet Fide <mehmet.fide@screeningeagle.com>
> 
> fdtdec_get_alias_seq() and fdtdec_get_alias_highest_id() compare the
> alias name with the stem by strncmp() over the length of the stem, so
> every alias that starts with the stem counts. On a Colibri VF50 the
> aliases usbphy0 and usbphy1 matched the "usb" stem, the two USB
> controllers were given the sequence numbers 2 and 3, and ehci-vf
> indexed its two-entry tables with them. The live tree disagrees: there
> of_alias_scan() splits an alias into the stem and the number and
> of_alias_get_id() compares the stem exactly.
> 
> Match an alias only when the stem is followed by its number, as the
> live tree does. A test covers both lookups with the sandbox aliases,
> where "test" is a prefix of testbus3 and of the testfdt aliases.
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Signed-off-by: Mehmet Fide <mehmet.fide@screeningeagle.com>

This commit seems (74b14db48a8e in main) to break USB on all i.MX6Q/DL/UL/ULL
boards without CONFIG_PHY, USB gadget included, so fastboot and SDP from
U-Boot do not work anymore. We noticed it because uuu recovery stopped
working on Apalis iMX6, Colibri iMX6 and Colibri iMX6ULL, while Colibri
iMX7 with the same U-Boot is fine.

ehci-mx6 takes the port number from the alias of the USB PHY node, but
looks it up with the "usb" stem:

	ret = fdtdec_get_alias_seq(blob, dev->uclass->uc_drv->name,
				   phy_off, &devnump);

The only aliases pointing to the PHY nodes are usbphy0/usbphy1, so this
worked only thanks to the prefix match you removed. Now it returns
-ENOENT and the EHCI probe fails.

Following patch diff is compile-tested only. And the analysis is from
claude, so take it with the appropriate caution.

Francesco

-- >8 --
 drivers/usb/host/ehci-mx6.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c
index 25907f22612f..93b0d75633f6 100644
--- a/drivers/usb/host/ehci-mx6.c
+++ b/drivers/usb/host/ehci-mx6.c
@@ -609,8 +609,7 @@ static int mx6_parse_dt_addrs(struct udevice *dev)
 #if defined(CONFIG_MX6)
 	int anatop_off, ret, devnump;

-	ret = fdtdec_get_alias_seq(blob, dev->uclass->uc_drv->name,
-				   phy_off, &devnump);
+	ret = fdtdec_get_alias_seq(blob, "usbphy", phy_off, &devnump);
 	if (ret < 0)
 		return ret;
 	priv->portnr = devnump;


  reply	other threads:[~2026-11-22 19:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-23 11:15 [PATCH v9 0/9] usb: ehci-vf: make the USB host port usable Mehmet Fide
2026-10-23 11:15 ` [PATCH v9 1/9] fdtdec: match an alias to its stem only when the number follows it Mehmet Fide
2026-11-22 19:53   ` Francesco Dolcini [this message]
2026-11-22 20:51     ` [PATCH] usb: ehci-mx6: look up the port number with the usbphy alias Mehmet Fide
2026-11-23  9:31       ` Emanuele Ghidoli
2026-11-22 20:52     ` [REGRESSION] [PATCH v9 1/9] fdtdec: match an alias to its stem only when the number follows it Mehmet Fide
2026-10-23 11:15 ` [PATCH v9 2/9] usb: ehci-vf: take the controller index from the device tree Mehmet Fide
2026-10-23 11:15 ` [PATCH v9 3/9] usb: ehci-vf: remove the code path for a build without DM_USB Mehmet Fide
2026-10-23 11:15 ` [PATCH v9 4/9] usb: ehci-vf: drop the empty bind hook Mehmet Fide
2026-10-23 11:15 ` [PATCH v9 5/9] usb: ehci-vf: use usb_get_dr_mode() Mehmet Fide
2026-10-23 11:15 ` [PATCH v9 6/9] usb: ehci-vf: request the ID detect gpio through the device Mehmet Fide
2026-10-23 11:15 ` [PATCH v9 7/9] usb: ehci-vf: take the register bases from the device tree Mehmet Fide
2026-10-23 14:23   ` Marek Vasut
2026-10-23 14:35     ` Mehmet Fide
2026-10-23 19:34       ` Marek Vasut
2026-10-23 11:15 ` [PATCH v9 8/9] usb: ehci-vf: sort the includes Mehmet Fide
2026-10-23 13:49   ` Marek Vasut
2026-10-23 11:15 ` [PATCH v9 9/9] usb: ehci-vf: enable the vbus supply of the port Mehmet Fide
2026-11-14 15:24 ` [PATCH v9 0/9] usb: ehci-vf: make the USB host port usable Mehmet Fide
2026-11-15 14:21   ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261122195302.GA432275@francesco-nb \
    --to=francesco@dolcini.it \
    --cc=festevam@gmail.com \
    --cc=krzk@kernel.org \
    --cc=marek.vasut+usb@mailbox.org \
    --cc=mehmet.fide@gmail.com \
    --cc=mehmet.fide@screeningeagle.com \
    --cc=sjg@chromium.org \
    --cc=stefan@agner.ch \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.u-boot-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.