Skip to content

Commit

Permalink
drm/panfrost: make devfreq optional again
Browse files Browse the repository at this point in the history
Devfreq runtime usage was made mandatory, thus making panfrost fail to probe
on Amlogic S912 SoCs missing the "operating-points-v2" property.
Make it optional again, leaving PM_DEVFREQ selected by default.

Fixes: f3617b4 ("drm/panfrost: Select devfreq")
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190605150233.32722-1-narmstrong@baylibre.com
  • Loading branch information
Neil Armstrong authored and Rob Herring committed Jun 10, 2019
1 parent be7d9f0 commit 1c3b526
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion drivers/gpu/drm/panfrost/panfrost_devfreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev)
return 0;

ret = dev_pm_opp_of_add_table(&pfdev->pdev->dev);
if (ret)
if (ret == -ENODEV) /* Optional, continue without devfreq */
return 0;
else if (ret)
return ret;

panfrost_devfreq_reset(pfdev);
Expand Down Expand Up @@ -170,6 +172,9 @@ void panfrost_devfreq_resume(struct panfrost_device *pfdev)
{
int i;

if (!pfdev->devfreq.devfreq)
return;

panfrost_devfreq_reset(pfdev);
for (i = 0; i < NUM_JOB_SLOTS; i++)
pfdev->devfreq.slot[i].busy = false;
Expand All @@ -179,6 +184,9 @@ void panfrost_devfreq_resume(struct panfrost_device *pfdev)

void panfrost_devfreq_suspend(struct panfrost_device *pfdev)
{
if (!pfdev->devfreq.devfreq)
return;

devfreq_suspend_device(pfdev->devfreq.devfreq);
}

Expand All @@ -188,6 +196,9 @@ static void panfrost_devfreq_update_utilization(struct panfrost_device *pfdev, i
ktime_t now;
ktime_t last;

if (!pfdev->devfreq.devfreq)
return;

now = ktime_get();
last = pfdev->devfreq.slot[slot].time_last_update;

Expand Down

0 comments on commit 1c3b526

Please sign in to comment.