Linux USB
 help / color / mirror / Atom feed
* [PATCH] usb: typec: ucsi: Defer cros_ec_ucsi probe until EC is registered
@ 2026-12-03 22:45 Matt Davis
  2026-12-03 23:01 ` sashiko-bot
  2026-12-04  0:42 ` Jameson Thies
  0 siblings, 2 replies; 3+ messages in thread
From: Matt Davis @ 2026-12-03 22:45 UTC (permalink / raw)
  To: Abhishek Pandit-Subedi, Łukasz Bartosik, Jameson Thies,
	Andrei Kuchynski, Heikki Krogerus, Greg Kroah-Hartman,
	Benson Leung
  Cc: Guenter Roeck, chrome-platform, linux-usb, Matt Davis

When bound via OF or ACPI, cros_ec_ucsi can probe before the parent EC
driver sets drvdata or finishes cros_ec_register(). Defer probe until
the parent EC device is registered instead of failing with -ENODEV.

Fixes: 40b17a345d3f ("usb: typec: cros_ec_ucsi: Load driver from OF and ACPI definitions")
Signed-off-by: Matt Davis <mattedavis@google.com>
---
 drivers/usb/typec/ucsi/cros_ec_ucsi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/typec/ucsi/cros_ec_ucsi.c b/drivers/usb/typec/ucsi/cros_ec_ucsi.c
index 1a052524ed83..1e7bd832ad39 100644
--- a/drivers/usb/typec/ucsi/cros_ec_ucsi.c
+++ b/drivers/usb/typec/ucsi/cros_ec_ucsi.c
@@ -277,8 +277,8 @@ static int cros_ucsi_probe(struct platform_device *pdev)
 	else
 		udata->ec = ((struct cros_ec_dev *)dev_get_drvdata(dev->parent))->ec_dev;
 
-	if (!udata->ec)
-		return dev_err_probe(dev, -ENODEV, "couldn't find parent EC device\n");
+	if (!udata->ec || !cros_ec_device_registered(udata->ec))
+		return dev_err_probe(dev, -EPROBE_DEFER, "couldn't find parent EC device\n");
 
 	platform_set_drvdata(pdev, udata);
 
-- 
2.56.1.915.g69d5ec7298-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: typec: ucsi: Defer cros_ec_ucsi probe until EC is registered
  2026-12-03 22:45 [PATCH] usb: typec: ucsi: Defer cros_ec_ucsi probe until EC is registered Matt Davis
@ 2026-12-03 23:01 ` sashiko-bot
  2026-12-04  0:42 ` Jameson Thies
  1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-12-03 23:01 UTC (permalink / raw)
  To: Matt Davis; +Cc: linux-usb

> When bound via OF or ACPI, cros_ec_ucsi can probe before the parent EC
> driver sets drvdata or finishes cros_ec_register(). Defer probe until
> the parent EC device is registered instead of failing with -ENODEV.
> 
> Fixes: 40b17a345d3f ("usb: typec: cros_ec_ucsi: Load driver from OF and ACPI definitions")
> Signed-off-by: Matt Davis <mattedavis@google.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261203224544.3225503-1-mattedavis@google.com?part=1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: typec: ucsi: Defer cros_ec_ucsi probe until EC is registered
  2026-12-03 22:45 [PATCH] usb: typec: ucsi: Defer cros_ec_ucsi probe until EC is registered Matt Davis
  2026-12-03 23:01 ` sashiko-bot
@ 2026-12-04  0:42 ` Jameson Thies
  1 sibling, 0 replies; 3+ messages in thread
From: Jameson Thies @ 2026-12-04  0:42 UTC (permalink / raw)
  To: Matt Davis
  Cc: Abhishek Pandit-Subedi, Łukasz Bartosik, Andrei Kuchynski,
	Heikki Krogerus, Greg Kroah-Hartman, Benson Leung, Guenter Roeck,
	chrome-platform, linux-usb

On Thu, Dec 3, 2026 at 2:47 PM Matt Davis <mattedavis@google.com> wrote:
>
> When bound via OF or ACPI, cros_ec_ucsi can probe before the parent EC
> driver sets drvdata or finishes cros_ec_register(). Defer probe until
> the parent EC device is registered instead of failing with -ENODEV.
>
> Fixes: 40b17a345d3f ("usb: typec: cros_ec_ucsi: Load driver from OF and ACPI definitions")
> Signed-off-by: Matt Davis <mattedavis@google.com>

Reviewed-by: Jameson Thies <jthies@google.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-12-04  0:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 22:45 [PATCH] usb: typec: ucsi: Defer cros_ec_ucsi probe until EC is registered Matt Davis
2026-12-03 23:01 ` sashiko-bot
2026-12-04  0:42 ` Jameson Thies

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox