Commit 52fa904e authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm-msm-fixes-2022-01-25' of https://gitlab.freedesktop.org/drm/msm into drm-fixes



A few msm fixes.
- parameter checks
- put_device balancing
- idle/suspend fixes

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
From: Rob Clark <robdclark@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGvAfsgtr==VM4wixAC_hSTuV=eNWXxX=BhZqQrbxHjKgg@mail.gmail.com
parents 2fd0e5fb 6aa89ae1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1560,6 +1560,8 @@ static int a6xx_pm_suspend(struct msm_gpu *gpu)
		for (i = 0; i < gpu->nr_rings; i++)
			a6xx_gpu->shadow[i] = 0;

	gpu->suspend_count++;

	return 0;
}

+18 −0
Original line number Diff line number Diff line
@@ -608,9 +608,27 @@ static int adreno_resume(struct device *dev)
	return gpu->funcs->pm_resume(gpu);
}

static int active_submits(struct msm_gpu *gpu)
{
	int active_submits;
	mutex_lock(&gpu->active_lock);
	active_submits = gpu->active_submits;
	mutex_unlock(&gpu->active_lock);
	return active_submits;
}

static int adreno_suspend(struct device *dev)
{
	struct msm_gpu *gpu = dev_to_gpu(dev);
	int remaining;

	remaining = wait_event_timeout(gpu->retire_event,
				       active_submits(gpu) == 0,
				       msecs_to_jiffies(1000));
	if (remaining == 0) {
		dev_err(dev, "Timeout waiting for GPU to suspend\n");
		return -EBUSY;
	}

	return gpu->funcs->pm_suspend(gpu);
}
+9 −2
Original line number Diff line number Diff line
@@ -26,9 +26,16 @@ static void dpu_setup_dspp_pcc(struct dpu_hw_dspp *ctx,
		struct dpu_hw_pcc_cfg *cfg)
{

	u32 base = ctx->cap->sblk->pcc.base;
	u32 base;

	if (!ctx || !base) {
	if (!ctx) {
		DRM_ERROR("invalid ctx %pK\n", ctx);
		return;
	}

	base = ctx->cap->sblk->pcc.base;

	if (!base) {
		DRM_ERROR("invalid ctx %pK pcc base 0x%x\n", ctx, base);
		return;
	}
+6 −1
Original line number Diff line number Diff line
@@ -40,7 +40,12 @@ static int dsi_get_phy(struct msm_dsi *msm_dsi)

	of_node_put(phy_node);

	if (!phy_pdev || !msm_dsi->phy) {
	if (!phy_pdev) {
		DRM_DEV_ERROR(&pdev->dev, "%s: phy driver is not ready\n", __func__);
		return -EPROBE_DEFER;
	}
	if (!msm_dsi->phy) {
		put_device(&phy_pdev->dev);
		DRM_DEV_ERROR(&pdev->dev, "%s: phy driver is not ready\n", __func__);
		return -EPROBE_DEFER;
	}
+3 −1
Original line number Diff line number Diff line
@@ -808,12 +808,14 @@ int msm_dsi_phy_enable(struct msm_dsi_phy *phy,
			struct msm_dsi_phy_clk_request *clk_req,
			struct msm_dsi_phy_shared_timings *shared_timings)
{
	struct device *dev = &phy->pdev->dev;
	struct device *dev;
	int ret;

	if (!phy || !phy->cfg->ops.enable)
		return -EINVAL;

	dev = &phy->pdev->dev;

	ret = dsi_phy_enable_resource(phy);
	if (ret) {
		DRM_DEV_ERROR(dev, "%s: resource enable failed, %d\n",
Loading