* [PATCH] drm/msm/gpu: Check the status of registration to PM QoS
@ 2024-10-18 11:18 Lukasz Luba
2024-10-18 12:02 ` Dmitry Baryshkov
0 siblings, 1 reply; 3+ messages in thread
From: Lukasz Luba @ 2024-10-18 11:18 UTC (permalink / raw)
To: linux-kernel, linux-arm-msm, dri-devel, freedreno
Cc: robdclark, sean, konradybcio, quic_abhinavk, dmitry.baryshkov,
marijn.suijten, airlied
There is a need to check the returned value of the registration function.
In case of returned error, print that and stop the init process.
Fixes: 7c0ffcd40b16 ("drm/msm/gpu: Respect PM QoS constraints")
Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
---
drivers/gpu/drm/msm/msm_gpu_devfreq.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/msm/msm_gpu_devfreq.c b/drivers/gpu/drm/msm/msm_gpu_devfreq.c
index ea70c1c32d940..6970b0f7f457c 100644
--- a/drivers/gpu/drm/msm/msm_gpu_devfreq.c
+++ b/drivers/gpu/drm/msm/msm_gpu_devfreq.c
@@ -140,6 +140,7 @@ void msm_devfreq_init(struct msm_gpu *gpu)
{
struct msm_gpu_devfreq *df = &gpu->devfreq;
struct msm_drm_private *priv = gpu->dev->dev_private;
+ int ret;
/* We need target support to do devfreq */
if (!gpu->funcs->gpu_busy)
@@ -156,8 +157,12 @@ void msm_devfreq_init(struct msm_gpu *gpu)
mutex_init(&df->lock);
- dev_pm_qos_add_request(&gpu->pdev->dev, &df->boost_freq,
- DEV_PM_QOS_MIN_FREQUENCY, 0);
+ ret = dev_pm_qos_add_request(&gpu->pdev->dev, &df->boost_freq,
+ DEV_PM_QOS_MIN_FREQUENCY, 0);
+ if (ret < 0) {
+ DRM_DEV_ERROR(&gpu->pdev->dev, "Couldn't initialize QoS\n");
+ return;
+ }
msm_devfreq_profile.initial_freq = gpu->fast_rate;
--
2.46.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] drm/msm/gpu: Check the status of registration to PM QoS
2024-10-18 11:18 [PATCH] drm/msm/gpu: Check the status of registration to PM QoS Lukasz Luba
@ 2024-10-18 12:02 ` Dmitry Baryshkov
2024-10-18 14:20 ` Lukasz Luba
0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Baryshkov @ 2024-10-18 12:02 UTC (permalink / raw)
To: Lukasz Luba
Cc: linux-kernel, linux-arm-msm, dri-devel, freedreno, robdclark,
sean, konradybcio, quic_abhinavk, marijn.suijten, airlied
On Fri, Oct 18, 2024 at 12:18:11PM +0100, Lukasz Luba wrote:
> There is a need to check the returned value of the registration function.
Why?
> In case of returned error, print that and stop the init process.
>
> Fixes: 7c0ffcd40b16 ("drm/msm/gpu: Respect PM QoS constraints")
> Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
> ---
> drivers/gpu/drm/msm/msm_gpu_devfreq.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] drm/msm/gpu: Check the status of registration to PM QoS
2024-10-18 12:02 ` Dmitry Baryshkov
@ 2024-10-18 14:20 ` Lukasz Luba
0 siblings, 0 replies; 3+ messages in thread
From: Lukasz Luba @ 2024-10-18 14:20 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: linux-kernel, linux-arm-msm, dri-devel, freedreno, robdclark,
sean, konradybcio, quic_abhinavk, marijn.suijten, airlied
On 10/18/24 13:02, Dmitry Baryshkov wrote:
> On Fri, Oct 18, 2024 at 12:18:11PM +0100, Lukasz Luba wrote:
>> There is a need to check the returned value of the registration function.
>
> Why?
The question can be:
why this driver doesn't check errors from frameworks during the
registration?
Is it a generic practice in that code (I hope not)?
When you check the API doc you will see that this fwk can fail and
return some error and the other functions in driver shouldn't
assume blindly that it was OK.
All other places in the kernel check that return value from
the PM QoS framework.
>
>> In case of returned error, print that and stop the init process.
>>
>> Fixes: 7c0ffcd40b16 ("drm/msm/gpu: Respect PM QoS constraints")
>> Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
>> ---
>> drivers/gpu/drm/msm/msm_gpu_devfreq.c | 9 +++++++--
>> 1 file changed, 7 insertions(+), 2 deletions(-)
>>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-18 14:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-18 11:18 [PATCH] drm/msm/gpu: Check the status of registration to PM QoS Lukasz Luba
2024-10-18 12:02 ` Dmitry Baryshkov
2024-10-18 14:20 ` Lukasz Luba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®