Skip to content

Commit f6d1918

Browse files
committed
drm/msm/a6xx: Fix speed-bin detection vs probe-defer
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 Fixes: fe7952c ("drm/msm: Add speed-bin support to a618 gpu") Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Reviewed-by: Akhil P Oommen <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/511690/ Link: https://lore.kernel.org/r/[email protected]
1 parent c901a8c commit f6d1918

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

drivers/gpu/drm/msm/adreno/a6xx_gpu.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,7 +1906,7 @@ static u32 fuse_to_supp_hw(struct device *dev, struct adreno_rev rev, u32 fuse)
19061906

19071907
if (val == UINT_MAX) {
19081908
DRM_DEV_ERROR(dev,
1909-
"missing support for speed-bin: %u. Some OPPs may not be supported by hardware",
1909+
"missing support for speed-bin: %u. Some OPPs may not be supported by hardware\n",
19101910
fuse);
19111911
return UINT_MAX;
19121912
}
@@ -1916,7 +1916,7 @@ static u32 fuse_to_supp_hw(struct device *dev, struct adreno_rev rev, u32 fuse)
19161916

19171917
static int a6xx_set_supported_hw(struct device *dev, struct adreno_rev rev)
19181918
{
1919-
u32 supp_hw = UINT_MAX;
1919+
u32 supp_hw;
19201920
u32 speedbin;
19211921
int ret;
19221922

@@ -1928,15 +1928,13 @@ static int a6xx_set_supported_hw(struct device *dev, struct adreno_rev rev)
19281928
if (ret == -ENOENT) {
19291929
return 0;
19301930
} else if (ret) {
1931-
DRM_DEV_ERROR(dev,
1932-
"failed to read speed-bin (%d). Some OPPs may not be supported by hardware",
1933-
ret);
1934-
goto done;
1931+
dev_err_probe(dev, ret,
1932+
"failed to read speed-bin. Some OPPs may not be supported by hardware\n");
1933+
return ret;
19351934
}
19361935

19371936
supp_hw = fuse_to_supp_hw(dev, rev, speedbin);
19381937

1939-
done:
19401938
ret = devm_pm_opp_set_supported_hw(dev, &supp_hw, 1);
19411939
if (ret)
19421940
return ret;

0 commit comments

Comments
 (0)