Commit b88c2828 authored by Jonathan McDowell's avatar Jonathan McDowell Committed by Bjorn Andersson
Browse files

firmware: qcom_scm: Fix legacy convention SCM accessors



The move to a combined driver for the QCOM SCM hardware changed the
io_writel and io_readl helpers to use non-atomic calls, despite the
commit message saying that atomic was a better option. This breaks these
helpers on hardware that uses the old legacy convention (access fails
with a -95 return code). Switch back to using the atomic calls.

Observed as a failure routing GPIO interrupts to the Apps processor on
an IPQ8064; fix is confirmed as correctly allowing the interrupts to be
routed and observed.

Reviewed-by: default avatarElliot Berman <eberman@codeaurora.org>
Fixes: 57d3b816 ("firmware: qcom_scm: Remove thin wrappers")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarJonathan McDowell <noodles@earth.li>
Link: https://lore.kernel.org/r/20200704172334.GA759@earth.li


Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent 943c8a80
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -391,7 +391,7 @@ static int __qcom_scm_set_dload_mode(struct device *dev, bool enable)

	desc.args[1] = enable ? QCOM_SCM_BOOT_SET_DLOAD_MODE : 0;

	return qcom_scm_call(__scm->dev, &desc, NULL);
	return qcom_scm_call_atomic(__scm->dev, &desc, NULL);
}

static void qcom_scm_set_download_mode(bool enable)
@@ -650,7 +650,7 @@ int qcom_scm_io_readl(phys_addr_t addr, unsigned int *val)
	int ret;


	ret = qcom_scm_call(__scm->dev, &desc, &res);
	ret = qcom_scm_call_atomic(__scm->dev, &desc, &res);
	if (ret >= 0)
		*val = res.result[0];

@@ -669,8 +669,7 @@ int qcom_scm_io_writel(phys_addr_t addr, unsigned int val)
		.owner = ARM_SMCCC_OWNER_SIP,
	};


	return qcom_scm_call(__scm->dev, &desc, NULL);
	return qcom_scm_call_atomic(__scm->dev, &desc, NULL);
}
EXPORT_SYMBOL(qcom_scm_io_writel);