Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5398f60c authored by Dhaval Patel's avatar Dhaval Patel Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm: fix sde drm probe failure issues



SDE drm driver probe failure generate failure
warnings during bootup. This patch fixes the
probe failure handling in sde hardware catalog,
drv driver, kms driver, power handle and io util
modules.

Change-Id: Ic54eaf43962b9e1afd00bbe392920fcb608f8e59
Signed-off-by: default avatarDhaval Patel <pdhaval@codeaurora.org>
parent 20e0464b
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -306,11 +306,8 @@ static int msm_drm_uninit(struct device *dev)

	sde_dbg_destroy();

	sde_power_client_destroy(&priv->phandle, priv->pclient);
	sde_power_resource_deinit(pdev, &priv->phandle);

	component_unbind_all(dev, ddev);

	sde_power_client_destroy(&priv->phandle, priv->pclient);
	sde_power_resource_deinit(pdev, &priv->phandle);

	msm_mdss_destroy(ddev);
@@ -493,20 +490,20 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
	ret = sde_power_resource_init(pdev, &priv->phandle);
	if (ret) {
		pr_err("sde power resource init failed\n");
		goto fail;
		goto power_init_fail;
	}

	priv->pclient = sde_power_client_create(&priv->phandle, "sde");
	if (IS_ERR_OR_NULL(priv->pclient)) {
		pr_err("sde power client create failed\n");
		ret = -EINVAL;
		goto fail;
		goto power_client_fail;
	}

	/* Bind all our sub-components: */
	ret = msm_component_bind_all(dev, ddev);
	if (ret)
		return ret;
		goto bind_fail;

	ret = msm_init_vram(ddev);
	if (ret)
@@ -636,6 +633,12 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
fail:
	msm_drm_uninit(dev);
	return ret;
bind_fail:
	sde_power_client_destroy(&priv->phandle, priv->pclient);
power_client_fail:
	sde_power_resource_deinit(pdev, &priv->phandle);
power_init_fail:
	msm_mdss_destroy(ddev);
mdss_init_fail:
	kfree(priv);
priv_alloc_fail:
+6 −2
Original line number Diff line number Diff line
@@ -561,6 +561,7 @@ static int _validate_dt_entry(struct device_node *np,
				rc = -EINVAL;
			}
			*off_count = 0;
			memset(prop_count, 0, sizeof(int *) * prop_size);
			return rc;
		}
	}
@@ -629,7 +630,7 @@ static int _validate_dt_entry(struct device_node *np,
			rc = 0;
			prop_count[i] = 0;
		}
		if (!off_count && prop_count[i] < 0) {
		if (prop_count[i] < 0) {
			prop_count[i] = 0;
			if (sde_prop[i].is_mandatory) {
				SDE_ERROR("prop:%s count:%d is negative\n",
@@ -2292,6 +2293,8 @@ static int _sde_hardware_caps(struct sde_mdss_cfg *sde_cfg, uint32_t hw_rev)
	if (!sde_cfg)
		return -EINVAL;

	rc = sde_hardware_format_caps(sde_cfg, hw_rev);

	switch (hw_rev) {
	case SDE_HW_VER_170:
	case SDE_HW_VER_171:
@@ -2302,9 +2305,10 @@ static int _sde_hardware_caps(struct sde_mdss_cfg *sde_cfg, uint32_t hw_rev)
	case SDE_HW_VER_301:
	case SDE_HW_VER_400:
		/* update msm8998 and sdm845 target here */
		rc = sde_hardware_format_caps(sde_cfg, hw_rev);
		sde_cfg->has_wb_ubwc = true;
		break;
	default:
		break;
	}

	return rc;
+10 −1
Original line number Diff line number Diff line
@@ -861,7 +861,6 @@ static void _sde_kms_hw_destroy(struct sde_kms *sde_kms,
	/* safe to call these more than once during shutdown */
	_sde_debugfs_destroy(sde_kms);
	_sde_kms_mmu_destroy(sde_kms);
	sde_core_perf_destroy(&sde_kms->perf);

	if (sde_kms->catalog) {
		for (i = 0; i < sde_kms->catalog->vbif_count; i++) {
@@ -1143,6 +1142,8 @@ static int sde_kms_hw_init(struct msm_kms *kms)
	sde_kms->core_client = sde_power_client_create(&priv->phandle, "core");
	if (IS_ERR_OR_NULL(sde_kms->core_client)) {
		rc = PTR_ERR(sde_kms->core_client);
		if (!sde_kms->core_client)
			rc = -EINVAL;
		SDE_ERROR("sde power client create failed: %d\n", rc);
		sde_kms->core_client = NULL;
		goto error;
@@ -1162,6 +1163,8 @@ static int sde_kms_hw_init(struct msm_kms *kms)
	sde_kms->catalog = sde_hw_catalog_init(dev, sde_kms->core_rev);
	if (IS_ERR_OR_NULL(sde_kms->catalog)) {
		rc = PTR_ERR(sde_kms->catalog);
		if (!sde_kms->catalog)
			rc = -EINVAL;
		SDE_ERROR("catalog init failed: %d\n", rc);
		sde_kms->catalog = NULL;
		goto power_error;
@@ -1189,6 +1192,8 @@ static int sde_kms_hw_init(struct msm_kms *kms)
	sde_kms->hw_mdp = sde_rm_get_mdp(&sde_kms->rm);
	if (IS_ERR_OR_NULL(sde_kms->hw_mdp)) {
		rc = PTR_ERR(sde_kms->hw_mdp);
		if (!sde_kms->hw_mdp)
			rc = -EINVAL;
		SDE_ERROR("failed to get hw_mdp: %d\n", rc);
		sde_kms->hw_mdp = NULL;
		goto power_error;
@@ -1201,6 +1206,8 @@ static int sde_kms_hw_init(struct msm_kms *kms)
				sde_kms->vbif[vbif_idx], sde_kms->catalog);
		if (IS_ERR_OR_NULL(sde_kms->hw_vbif[vbif_idx])) {
			rc = PTR_ERR(sde_kms->hw_vbif[vbif_idx]);
			if (!sde_kms->hw_vbif[vbif_idx])
				rc = -EINVAL;
			SDE_ERROR("failed to init vbif %d: %d\n", vbif_idx, rc);
			sde_kms->hw_vbif[vbif_idx] = NULL;
			goto power_error;
@@ -1252,6 +1259,8 @@ static int sde_kms_hw_init(struct msm_kms *kms)
	sde_kms->hw_intr = sde_hw_intr_init(sde_kms->mmio, sde_kms->catalog);
	if (IS_ERR_OR_NULL(sde_kms->hw_intr)) {
		rc = PTR_ERR(sde_kms->hw_intr);
		if (!sde_kms->hw_intr)
			rc = -EINVAL;
		SDE_ERROR("hw_intr init failed: %d\n", rc);
		sde_kms->hw_intr = NULL;
		goto hw_intr_init_err;
+5 −1
Original line number Diff line number Diff line
@@ -355,7 +355,11 @@ int msm_dss_get_clk(struct device *dev, struct dss_clk *clk_arry, int num_clk)
	return rc;

error:
	msm_dss_put_clk(clk_arry, num_clk);
	for (i--; i >= 0; i--) {
		if (clk_arry[i].clk)
			clk_put(clk_arry[i].clk);
		clk_arry[i].clk = NULL;
	}

	return rc;
} /* msm_dss_get_clk */
+4 −0
Original line number Diff line number Diff line
@@ -470,6 +470,8 @@ static int sde_power_data_bus_parse(struct platform_device *pdev,
		if (IS_ERR_OR_NULL(pdbus->data_bus_scale_table)) {
			pr_err("reg bus handle parsing failed\n");
			rc = PTR_ERR(pdbus->data_bus_scale_table);
			if (!pdbus->data_bus_scale_table)
				rc = -EINVAL;
			goto end;
		}
		pdbus->data_bus_hdl = msm_bus_scale_register_client(
@@ -511,6 +513,8 @@ static int sde_power_reg_bus_parse(struct platform_device *pdev,
		if (IS_ERR_OR_NULL(bus_scale_table)) {
			pr_err("reg bus handle parsing failed\n");
			rc = PTR_ERR(bus_scale_table);
			if (!bus_scale_table)
				rc = -EINVAL;
			goto end;
		}
		phandle->reg_bus_hdl = msm_bus_scale_register_client(