From 4551c62631fce1bb0d75eee16b7f6963cace3d0c Mon Sep 17 00:00:00 2001 From: Marcelo Alcantara Date: Sun, 29 Nov 2026 17:39:08 +1000 Subject: [PATCH] accel/ane: t6021: bind quietly when firmware is absent for sync_state When the Apple Neural Engine firmware blob has not yet been installed, ane_t6021_fwload_check() logs an informational notice and returns -ENODEV. ane_rtclient_probe_inner() currently passes that -ENODEV to dev_err_probe() and fails probe(), which emits a spurious KERN_ERR boot message ("error -ENODEV: firmware preflight failed") and leaves the platform device unbound. Because the unbound device remains an unsatisfied fw_devlink consumer of its seven apple-pmgr-pwrstate power-domain suppliers, those domains stay stuck in "sync_state() pending due to 284000000.ane" indefinitely and keep boot-on domains pinned on. Return 0 from ane_rtclient_probe_inner() with drvdata left NULL when ane_t6021_fwload_check() reports -ENODEV, without touching hardware or registering /dev/accel, and guard NULL drvdata in the sleep PM, remove, and sysfs visibility callbacks. Signed-off-by: Marcelo Alcantara --- drivers/accel/ane/ane_t6021_rtclient_main.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/accel/ane/ane_t6021_rtclient_main.c b/drivers/accel/ane/ane_t6021_rtclient_main.c index 5ec41205d36e0..92e642ecdb4d4 100644 --- a/drivers/accel/ane/ane_t6021_rtclient_main.c +++ b/drivers/accel/ane/ane_t6021_rtclient_main.c @@ -3949,6 +3949,8 @@ static int __maybe_unused ane_rtclient_sleep_pm_suspend(struct device *dev) { if (ane_rtclient_is_platform(dev)) return ane_fw_platform_suspend(dev); + if (!dev_get_drvdata(dev)) + return 0; return ane_t6021_pm_suspend(ane_rtclient_get_sleep_pm(dev)); } @@ -3956,6 +3958,8 @@ static int __maybe_unused ane_rtclient_sleep_pm_resume(struct device *dev) { if (ane_rtclient_is_platform(dev)) return ane_fw_platform_resume(dev); + if (!dev_get_drvdata(dev)) + return 0; return ane_t6021_pm_resume(ane_rtclient_get_sleep_pm(dev)); } @@ -4012,6 +4016,15 @@ static int ane_rtclient_probe_inner(struct platform_device *pdev, } if (fw_start && ane_t6021_fwload_requested()) { ret = ane_t6021_fwload_check(dev); + /* + * Missing firmware is normal before omarchy-ane-firmware-fetch + * has run. ane_t6021_fwload_check() already logged an info + * note and touched no hardware; bind quietly with NULL drvdata + * so fw_devlink lets our PMGR power-domain suppliers reach + * sync_state() instead of keeping boot-on domains pinned on. + */ + if (ret == -ENODEV) + return 0; if (ret) return dev_err_probe(dev, ret, "firmware preflight failed\n"); } @@ -4503,6 +4516,8 @@ static void ane_rtclient_remove(struct platform_device *pdev) ane_fw_platform_remove(pdev); return; } + if (!ane) + return; if (READ_ONCE(ane_t6021_perf_ane) == ane) WRITE_ONCE(ane_t6021_perf_ane, NULL); @@ -4612,7 +4627,7 @@ static umode_t ane_t6021_stats_is_visible(struct kobject *kobj, const struct ane_t602x_soc *soc = of_device_get_match_data(dev); struct ane_rtclient *ane = dev_get_drvdata(dev); - if (soc->platform) + if (soc->platform || !ane) return 0; if (attr == &dev_attr_ane_stats.attr && !ane->stats_slots) return 0;