Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/panfrost: make devfreq optional again

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: f3617b449d0b ("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

authored by

Neil Armstrong and committed by
Rob Herring
1c3b526e be7d9f05

+12 -1
+12 -1
drivers/gpu/drm/panfrost/panfrost_devfreq.c
··· 140 140 return 0; 141 141 142 142 ret = dev_pm_opp_of_add_table(&pfdev->pdev->dev); 143 - if (ret) 143 + if (ret == -ENODEV) /* Optional, continue without devfreq */ 144 + return 0; 145 + else if (ret) 144 146 return ret; 145 147 146 148 panfrost_devfreq_reset(pfdev); ··· 172 170 { 173 171 int i; 174 172 173 + if (!pfdev->devfreq.devfreq) 174 + return; 175 + 175 176 panfrost_devfreq_reset(pfdev); 176 177 for (i = 0; i < NUM_JOB_SLOTS; i++) 177 178 pfdev->devfreq.slot[i].busy = false; ··· 184 179 185 180 void panfrost_devfreq_suspend(struct panfrost_device *pfdev) 186 181 { 182 + if (!pfdev->devfreq.devfreq) 183 + return; 184 + 187 185 devfreq_suspend_device(pfdev->devfreq.devfreq); 188 186 } 189 187 ··· 195 187 struct panfrost_devfreq_slot *devfreq_slot = &pfdev->devfreq.slot[slot]; 196 188 ktime_t now; 197 189 ktime_t last; 190 + 191 + if (!pfdev->devfreq.devfreq) 192 + return; 198 193 199 194 now = ktime_get(); 200 195 last = pfdev->devfreq.slot[slot].time_last_update;