Skip to content

Commit 9a5a668

Browse files
gcabidduherbertx
authored andcommitted
crypto: qat - add delay before polling mailbox
The mailbox CSR register has a write latency and requires a delay before being read. This patch replaces readl_poll_timeout with read_poll_timeout that allows to sleep before read. The initial sleep was removed when the mailbox poll loop was replaced with readl_poll_timeout. Fixes: a79d471 ("crypto: qat - update timeout logic in put admin msg") Signed-off-by: Giovanni Cabiddu <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 9123e3a commit 9a5a668

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/crypto/qat/qat_common/adf_admin.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,10 @@ static int adf_put_admin_msg_sync(struct adf_accel_dev *accel_dev, u32 ae,
131131
memcpy(admin->virt_addr + offset, in, ADF_ADMINMSG_LEN);
132132
ADF_CSR_WR(mailbox, mb_offset, 1);
133133

134-
ret = readl_poll_timeout(mailbox + mb_offset, status,
135-
status == 0, ADF_ADMIN_POLL_DELAY_US,
136-
ADF_ADMIN_POLL_TIMEOUT_US);
134+
ret = read_poll_timeout(ADF_CSR_RD, status, status == 0,
135+
ADF_ADMIN_POLL_DELAY_US,
136+
ADF_ADMIN_POLL_TIMEOUT_US, true,
137+
mailbox, mb_offset);
137138
if (ret < 0) {
138139
/* Response timeout */
139140
dev_err(&GET_DEV(accel_dev),

0 commit comments

Comments
 (0)