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

Commit f5da0e24 authored by Xiaogang Cui's avatar Xiaogang Cui
Browse files

soc: qcom: dcc: update xpu probe logic to fix failure



TZ image which has registered SCM_SVC_DISABLE_XPU sevice maybe used by
none-dcc-xpu device. Update the xpu check logic to fix the probe
failure issue.

Change-Id: Id2b38d93e7c12648292546592144eda1e82d76be
Signed-off-by: default avatarXiaogang Cui <xiaogang@codeaurora.org>
parent 72ee5cb1
Loading
Loading
Loading
Loading
+14 −12
Original line number Diff line number Diff line
@@ -1233,19 +1233,21 @@ static int dcc_probe(struct platform_device *pdev)

	INIT_LIST_HEAD(&drvdata->config_head);
	drvdata->nr_config = 0;

	if (scm_is_call_available(SCM_SVC_MP, SCM_SVC_DISABLE_XPU) >  0)
		drvdata->xpu_scm_avail = 1;
	else
	drvdata->xpu_scm_avail = 0;

	if (drvdata->xpu_scm_avail) {
	res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
					   "dcc-xpu-base");
		if (!res)
			return -ENODEV;

	if (res) {
		if (scm_is_call_available(SCM_SVC_MP,
					  SCM_SVC_DISABLE_XPU) > 0) {
			drvdata->xpu_scm_avail = 1;
			drvdata->xpu_addr = res->start;
		} else {
			dev_err(dev, "scm call is not available\n");
			return -EINVAL;
		}
	} else {
		dev_info(dev, "DCC XPU is not specified\n");
	}

	ret = dcc_xpu_unlock(drvdata);