summaryrefslogtreecommitdiff
path: root/drivers/crypto/ccp
diff options
context:
space:
mode:
authorMario Limonciello <mario.limonciello@amd.com>2023-04-03 13:32:12 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2023-04-14 18:59:34 +0800
commita19c61b06585f71c4dc1303fe6a3af79dfe33678 (patch)
tree3001f49fb0c6567fc7745d99d3c80dec3c992c4b /drivers/crypto/ccp
parente0358dedff4ff432318665927d45f4786c34ed52 (diff)
crypto: ccp - Return doorbell status code as an argument
If the doorbell failed to ring we return -EIO, but the caller can't determine why it failed. Pass the reason for the failure in an argument for caller to investigate. Suggested-by: Mark Hasemeyer <markhas@chromium.org> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Mark Hasemeyer <markhas@chromium.org> Tested-by: Mark Hasemeyer <markhas@chromium.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/ccp')
-rw-r--r--drivers/crypto/ccp/platform-access.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/crypto/ccp/platform-access.c b/drivers/crypto/ccp/platform-access.c
index 1cc154a1c6ab..48f59ae91692 100644
--- a/drivers/crypto/ccp/platform-access.c
+++ b/drivers/crypto/ccp/platform-access.c
@@ -132,7 +132,7 @@ unlock:
}
EXPORT_SYMBOL_GPL(psp_send_platform_access_msg);
-int psp_ring_platform_doorbell(int msg)
+int psp_ring_platform_doorbell(int msg, u32 *result)
{
struct psp_device *psp = psp_get_master_device();
struct psp_platform_access_device *pa_dev;
@@ -164,6 +164,8 @@ int psp_ring_platform_doorbell(int msg)
val = FIELD_GET(PSP_CMDRESP_STS, ioread32(cmd));
if (val) {
+ if (result)
+ *result = val;
ret = -EIO;
goto unlock;
}