Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion drivers/accel/ane/ane_t6021_rtclient_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3949,13 +3949,17 @@ 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));
}

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));
}

Expand Down Expand Up @@ -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");
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
Loading