All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] surface: aggregator: propagate -EPROBE_DEFER from ssam_irq_setup()
@ 2026-10-03  4:48 Janus
  2026-10-14 10:45 ` Ilpo Järvinen
  2026-10-24  5:49 ` [PATCH v2] " Wu Enqiang
  0 siblings, 2 replies; 8+ messages in thread
From: Janus @ 2026-10-03  4:48 UTC (permalink / raw)
  To: luzmaximilian; +Cc: platform-driver-x86, janus

From: janus <janussss@163.com>

gpiod_get() can fail with -EPROBE_DEFER when the GPIO controller
providing the "ssam_wakeup-int" GPIO has not been probed yet. The
current error path falls back to fwnode_irq_get(), which returns
-EINVAL because this device only declares GPIO resources. The probe
then fails hard and is never retried.

This leaves the SSAM controller down on devices like the Surface Pro 6
when probe ordering is unfavorable: dependent ACPI devices, e.g. the
battery with its _DEP on the SAN node, are never enumerated and battery
status is missing.

Return -EPROBE_DEFER directly so that the probe is deferred until the
GPIO controller becomes available

Signed-off-by: janus <janussss@163.com>
---
 drivers/platform/surface/aggregator/controller.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/platform/surface/aggregator/controller.c b/drivers/platform/surface/aggregator/controller.c
index 6a8430cb9..4f9f4595d 100644
--- a/drivers/platform/surface/aggregator/controller.c
+++ b/drivers/platform/surface/aggregator/controller.c
@@ -2755,6 +2755,8 @@ int ssam_irq_setup(struct ssam_controller *ctrl)
 
 	gpiod = gpiod_get(dev, "ssam_wakeup-int", GPIOD_ASIS);
 	if (IS_ERR(gpiod)) {
+		if (PTR_ERR(gpiod) == -EPROBE_DEFER)
+			return -EPROBE_DEFER;
 		irq = fwnode_irq_get(dev_fwnode(dev), 0);
 	} else {
 		irq = gpiod_to_irq(gpiod);
-- 
2.55.0


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

end of thread, other threads:[~2026-10-26 18:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-03  4:48 [PATCH] surface: aggregator: propagate -EPROBE_DEFER from ssam_irq_setup() Janus
2026-10-14 10:45 ` Ilpo Järvinen
2026-10-23 19:28   ` Chris Simpson
2026-10-26 10:42     ` Ilpo Järvinen
2026-10-26 18:23       ` Andy Shevchenko
2026-10-26 18:35       ` Chris Simpson
2026-10-26 18:40         ` Ilpo Järvinen
2026-10-24  5:49 ` [PATCH v2] " Wu Enqiang

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.