Skip to content

Commit b88c282

Browse files
u1f35candersson
authored andcommitted
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: Elliot Berman <[email protected]> Fixes: 57d3b81 ("firmware: qcom_scm: Remove thin wrappers") Cc: [email protected] Signed-off-by: Jonathan McDowell <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent 943c8a8 commit b88c282

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/firmware/qcom_scm.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ static int __qcom_scm_set_dload_mode(struct device *dev, bool enable)
391391

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

394-
return qcom_scm_call(__scm->dev, &desc, NULL);
394+
return qcom_scm_call_atomic(__scm->dev, &desc, NULL);
395395
}
396396

397397
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)
650650
int ret;
651651

652652

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

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

672-
673-
return qcom_scm_call(__scm->dev, &desc, NULL);
672+
return qcom_scm_call_atomic(__scm->dev, &desc, NULL);
674673
}
675674
EXPORT_SYMBOL(qcom_scm_io_writel);
676675

0 commit comments

Comments
 (0)