Skip to content

Commit 680b7dd

Browse files
Tony Krowiakhcahca
authored andcommitted
s390/vfio-ap: no need to check the 'E' and 'I' bits in APQSW after TAPQ
After a ZAPQ is executed to reset a queue, if the queue is not empty or interrupts are still enabled, the vfio_ap driver will wait for the reset operation to complete by repeatedly executing the TAPQ instruction and checking the 'E' and 'I' bits in the APQSW to verify that the queue is empty and interrupts are disabled. This is unnecessary because it is sufficient to check only the response code in the APQSW. If the reset is still in progress, the response code will be 02; however, if the reset has completed successfully, the response code will be 00. Signed-off-by: Tony Krowiak <[email protected]> Acked-by: Janosch Frank <[email protected]> Tested-by: Viktor Mihajlovski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Heiko Carstens <[email protected]>
1 parent fdf0eaf commit 680b7dd

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

drivers/s390/crypto/vfio_ap_ops.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,19 +1608,10 @@ static int apq_status_check(int apqn, struct ap_queue_status *status)
16081608
{
16091609
switch (status->response_code) {
16101610
case AP_RESPONSE_NORMAL:
1611-
case AP_RESPONSE_RESET_IN_PROGRESS:
1612-
if (status->queue_empty && !status->irq_enabled)
1613-
return 0;
1614-
return -EBUSY;
16151611
case AP_RESPONSE_DECONFIGURED:
1616-
/*
1617-
* If the AP queue is deconfigured, any subsequent AP command
1618-
* targeting the queue will fail with the same response code. On the
1619-
* other hand, when an AP adapter is deconfigured, the associated
1620-
* queues are reset, so let's return a value indicating the reset
1621-
* for which we're waiting completed successfully.
1622-
*/
16231612
return 0;
1613+
case AP_RESPONSE_RESET_IN_PROGRESS:
1614+
return -EBUSY;
16241615
default:
16251616
WARN(true,
16261617
"failed to verify reset of queue %02x.%04x: TAPQ rc=%u\n",

0 commit comments

Comments
 (0)