Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,15 @@ static int exit_ikg(struct sx_pk_acq_req *pkreq)
{

int status;
struct sx_pk_acq_req oldreq = *pkreq;

sx_pk_release_req(pkreq->req);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with this as a quick patch, but it is quite ugly. Would it not be better here to create a "sx_pk_change_req_cmd" function and then just reuse the same req with the new command instead of acquiring two of them? That would also be more generic so we can use that as a pattern in the other functions that have multiple command changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can update the previous PR (this) with your idea so we have a comparison

/* Acquiring just before releasing ensures that there is at least one user
* requesting asymmetric engine support. This is done to avoid powering
* down CRACEN before ongoing operations have finalized. This relies on
* recursive mutex locking.
*/
*pkreq = sx_pk_acquire_req(SX_PK_CMD_IK_EXIT);
sx_pk_release_req(oldreq.req);
pkreq->status = sx_pk_list_ik_inslots(pkreq->req, 0, NULL);
if (pkreq->status) {
return pkreq->status;
Expand Down