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: Xiaogang Cui <xiaogang@codeaurora.org>
Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
This commit is contained in:
Xiaogang Cui 2015-10-16 17:16:22 +08:00 committed by Jeevan Shriram
parent 8f4e416b1e
commit 65cfc1aa9c

View file

@ -1234,19 +1234,21 @@ static int dcc_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&drvdata->config_head);
drvdata->nr_config = 0;
drvdata->xpu_scm_avail = 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;
drvdata->xpu_addr = res->start;
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
"dcc-xpu-base");
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);