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

Configure Feed

Select the types of activity you want to include in your feed.

drm/msm/adreno: Assign msm_gpu->pdev earlier to avoid nullptrs

There are some cases, such as the one uncovered by Commit 46d4efcccc68
("drm/msm/a6xx: Avoid a nullptr dereference when speedbin setting fails")
where

msm_gpu_cleanup() : platform_set_drvdata(gpu->pdev, NULL);

is called on gpu->pdev == NULL, as the GPU device has not been fully
initialized yet.

Turns out that there's more than just the aforementioned path that
causes this to happen (e.g. the case when there's speedbin data in the
catalog, but opp-supported-hw is missing in DT).

Assigning msm_gpu->pdev earlier seems like the least painful solution
to this, therefore do so.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/602742/
Signed-off-by: Rob Clark <robdclark@chromium.org>

authored by

Konrad Dybcio and committed by
Rob Clark
16007768 e1936691

+1 -1
+1
drivers/gpu/drm/msm/adreno/adreno_gpu.c
··· 1087 1087 adreno_gpu->chip_id = config->chip_id; 1088 1088 1089 1089 gpu->allow_relocs = config->info->family < ADRENO_6XX_GEN1; 1090 + gpu->pdev = pdev; 1090 1091 1091 1092 /* Only handle the core clock when GMU is not in use (or is absent). */ 1092 1093 if (adreno_has_gmu_wrapper(adreno_gpu) ||
-1
drivers/gpu/drm/msm/msm_gpu.c
··· 931 931 if (IS_ERR(gpu->gpu_cx)) 932 932 gpu->gpu_cx = NULL; 933 933 934 - gpu->pdev = pdev; 935 934 platform_set_drvdata(pdev, &gpu->adreno_smmu); 936 935 937 936 msm_devfreq_init(gpu);