On Mon, Oct 16, 2017 at 6:00 PM, Jordan Crouse <jcrouse@xxxxxxxxxxxxxx> wrote: > On Mon, Oct 16, 2017 at 11:27:47AM -0400, Rob Clark wrote: >> Previously, in an effort to defer initializing the gpu until firmware >> was available (ie. rootfs mounted), the gpu was not loaded at when the >> subdevice was bound. Which resulted that clks/etc were requested in a >> place that devm couldn't really help unwind if something failed. >> >> Instead move request_firmware() to gpu->hw_init() and construct the gpu >> earlier in adreno_bind(). To avoid the rest of the driver needing to >> be aware of a gpu that hasn't managed to load firmware and hw_init() >> yet, stash the gpu ptr in the adreno device's drvdata, and don't set >> priv->gpu() until hw_init() succeeds. >> >> Signed-off-by: Rob Clark <robdclark@xxxxxxxxx> >> --- >> drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 6 +-- >> drivers/gpu/drm/msm/adreno/adreno_device.c | 78 +++++++++++++++--------------- >> drivers/gpu/drm/msm/adreno/adreno_gpu.c | 45 +++++++++++------ >> drivers/gpu/drm/msm/msm_drv.c | 10 ---- >> 4 files changed, 74 insertions(+), 65 deletions(-) >> >> diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c >> index 17c59d839e6f..8df86d83d859 100644 >> --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c >> +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c >> @@ -536,13 +536,13 @@ static int a5xx_hw_init(struct msm_gpu *gpu) >> REG_A5XX_RBBM_SECVID_TSB_TRUSTED_BASE_HI, 0x00000000); >> gpu_write(gpu, REG_A5XX_RBBM_SECVID_TSB_TRUSTED_SIZE, 0x00000000); >> >> - /* Load the GPMU firmware before starting the HW init */ >> - a5xx_gpmu_ucode_init(gpu); >> - >> ret = adreno_hw_init(gpu); >> if (ret) >> return ret; >> >> + /* Load the GPMU firmware before starting the HW init */ > > You can delete this comment since it is no longer accurate. > thanks, got that locally in a fixup BR, -R >> + a5xx_gpmu_ucode_init(gpu); >> + >> ret = a5xx_ucode_init(gpu); >> if (ret) >> return ret; > > Jordan > > -- > The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, > a Linux Foundation Collaborative Project _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel