Skip to content

Commit a19c61b

Browse files
superm1herbertx
authored andcommitted
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 <[email protected]> Signed-off-by: Mario Limonciello <[email protected]> Reviewed-by: Mark Hasemeyer <[email protected]> Tested-by: Mark Hasemeyer <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent e0358de commit a19c61b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

drivers/crypto/ccp/platform-access.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ int psp_send_platform_access_msg(enum psp_platform_access_msg msg,
132132
}
133133
EXPORT_SYMBOL_GPL(psp_send_platform_access_msg);
134134

135-
int psp_ring_platform_doorbell(int msg)
135+
int psp_ring_platform_doorbell(int msg, u32 *result)
136136
{
137137
struct psp_device *psp = psp_get_master_device();
138138
struct psp_platform_access_device *pa_dev;
@@ -164,6 +164,8 @@ int psp_ring_platform_doorbell(int msg)
164164

165165
val = FIELD_GET(PSP_CMDRESP_STS, ioread32(cmd));
166166
if (val) {
167+
if (result)
168+
*result = val;
167169
ret = -EIO;
168170
goto unlock;
169171
}

include/linux/psp-platform-access.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ int psp_send_platform_access_msg(enum psp_platform_access_msg, struct psp_reques
4545
* -%EBUSY: mailbox in recovery or in use
4646
* -%ENODEV: driver not bound with PSP device
4747
* -%ETIMEDOUT: request timed out
48-
* -%EIO: unknown error (see kernel log)
48+
* -%EIO: error will be stored in result argument
4949
*/
50-
int psp_ring_platform_doorbell(int msg);
50+
int psp_ring_platform_doorbell(int msg, u32 *result);
5151

5252
/**
5353
* psp_check_platform_access_status() - Checks whether platform features is ready

0 commit comments

Comments
 (0)