* [PATCH v3] drm/msm/a6xx: Fix speed-bin detection vs probe-defer
@ 2022-11-15 15:46 Rob Clark
2022-11-17 10:57 ` Akhil P Oommen
0 siblings, 1 reply; 2+ messages in thread
From: Rob Clark @ 2022-11-15 15:46 UTC (permalink / raw)
To: dri-devel
Cc: freedreno, linux-arm-msm, Akhil P Oommen, Rob Clark,
Douglas Anderson, Rob Clark, Abhinav Kumar, Dmitry Baryshkov,
Sean Paul, David Airlie, Daniel Vetter, Chia-I Wu, Konrad Dybcio,
open list
From: Rob Clark <robdclark@chromium.org>
If we get an error (other than -ENOENT) we need to propagate that up the
stack. Otherwise if the nvmem driver hasn't probed yet, we'll end up
end up claiming that we support all the OPPs which is not likely to be
true (and on some generations impossible to be true, ie. if there are
conflicting OPPs).
v2: Update commit msg, gc unused label, etc
v3: Add previously missing \n's
Fixed: fe7952c629da ("drm/msm: Add speed-bin support to a618 gpu")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
---
drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
index 7fe60c65a1eb..ebe9599a8316 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
@@ -1931,7 +1931,7 @@ static u32 fuse_to_supp_hw(struct device *dev, struct adreno_rev rev, u32 fuse)
if (val == UINT_MAX) {
DRM_DEV_ERROR(dev,
- "missing support for speed-bin: %u. Some OPPs may not be supported by hardware",
+ "missing support for speed-bin: %u. Some OPPs may not be supported by hardware\n",
fuse);
return UINT_MAX;
}
@@ -1941,7 +1941,7 @@ static u32 fuse_to_supp_hw(struct device *dev, struct adreno_rev rev, u32 fuse)
static int a6xx_set_supported_hw(struct device *dev, struct adreno_rev rev)
{
- u32 supp_hw = UINT_MAX;
+ u32 supp_hw;
u32 speedbin;
int ret;
@@ -1953,15 +1953,13 @@ static int a6xx_set_supported_hw(struct device *dev, struct adreno_rev rev)
if (ret == -ENOENT) {
return 0;
} else if (ret) {
- DRM_DEV_ERROR(dev,
- "failed to read speed-bin (%d). Some OPPs may not be supported by hardware",
- ret);
- goto done;
+ dev_err_probe(dev, ret,
+ "failed to read speed-bin. Some OPPs may not be supported by hardware\n");
+ return ret;
}
supp_hw = fuse_to_supp_hw(dev, rev, speedbin);
-done:
ret = devm_pm_opp_set_supported_hw(dev, &supp_hw, 1);
if (ret)
return ret;
--
2.38.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v3] drm/msm/a6xx: Fix speed-bin detection vs probe-defer
2022-11-15 15:46 [PATCH v3] drm/msm/a6xx: Fix speed-bin detection vs probe-defer Rob Clark
@ 2022-11-17 10:57 ` Akhil P Oommen
0 siblings, 0 replies; 2+ messages in thread
From: Akhil P Oommen @ 2022-11-17 10:57 UTC (permalink / raw)
To: Rob Clark, dri-devel
Cc: freedreno, linux-arm-msm, Rob Clark, Douglas Anderson,
Abhinav Kumar, Dmitry Baryshkov, Sean Paul, David Airlie,
Daniel Vetter, Chia-I Wu, Konrad Dybcio, open list
On 11/15/2022 9:16 PM, Rob Clark wrote:
> From: Rob Clark <robdclark@chromium.org>
>
> If we get an error (other than -ENOENT) we need to propagate that up the
> stack. Otherwise if the nvmem driver hasn't probed yet, we'll end up
> end up claiming that we support all the OPPs which is not likely to be
> true (and on some generations impossible to be true, ie. if there are
> conflicting OPPs).
>
> v2: Update commit msg, gc unused label, etc
> v3: Add previously missing \n's
>
> Fixed: fe7952c629da ("drm/msm: Add speed-bin support to a618 gpu")
> Signed-off-by: Rob Clark <robdclark@chromium.org>
> Reviewed-by: Douglas Anderson <dianders@chromium.org>
> ---
> drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> index 7fe60c65a1eb..ebe9599a8316 100644
> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> @@ -1931,7 +1931,7 @@ static u32 fuse_to_supp_hw(struct device *dev, struct adreno_rev rev, u32 fuse)
>
> if (val == UINT_MAX) {
> DRM_DEV_ERROR(dev,
> - "missing support for speed-bin: %u. Some OPPs may not be supported by hardware",
> + "missing support for speed-bin: %u. Some OPPs may not be supported by hardware\n",
> fuse);
> return UINT_MAX;
> }
> @@ -1941,7 +1941,7 @@ static u32 fuse_to_supp_hw(struct device *dev, struct adreno_rev rev, u32 fuse)
>
> static int a6xx_set_supported_hw(struct device *dev, struct adreno_rev rev)
> {
> - u32 supp_hw = UINT_MAX;
> + u32 supp_hw;
> u32 speedbin;
> int ret;
>
> @@ -1953,15 +1953,13 @@ static int a6xx_set_supported_hw(struct device *dev, struct adreno_rev rev)
> if (ret == -ENOENT) {
> return 0;
> } else if (ret) {
> - DRM_DEV_ERROR(dev,
> - "failed to read speed-bin (%d). Some OPPs may not be supported by hardware",
> - ret);
> - goto done;
> + dev_err_probe(dev, ret,
> + "failed to read speed-bin. Some OPPs may not be supported by hardware\n");
> + return ret;
> }
>
> supp_hw = fuse_to_supp_hw(dev, rev, speedbin);
>
> -done:
> ret = devm_pm_opp_set_supported_hw(dev, &supp_hw, 1);
> if (ret)
> return ret;
Reviewed-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
-Akhil.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-11-17 11:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-15 15:46 [PATCH v3] drm/msm/a6xx: Fix speed-bin detection vs probe-defer Rob Clark
2022-11-17 10:57 ` Akhil P Oommen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox