Skip to content

Commit c40284b

Browse files
hfreudeVasily Gorbik
authored andcommitted
s390/ap: re-enable interrupt for AP queues
This patch introduces some code lines which check for interrupt support enabled on an AP queue after a reply has been received. This invocation has been chosen as there is a good chance to have the queue empty at that time. As the enablement of the irq imples a state machine change the queue should not have any pending requests or unreceived replies. Reviewed-by: Tony Krowiak <[email protected]> Reviewed-by: Holger Dengler <[email protected]> Signed-off-by: Harald Freudenberger <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
1 parent 01c89ab commit c40284b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

drivers/s390/crypto/ap_queue.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,13 @@ static enum ap_sm_wait ap_sm_read(struct ap_queue *aq)
200200
return AP_SM_WAIT_AGAIN;
201201
}
202202
aq->sm_state = AP_SM_STATE_IDLE;
203-
return AP_SM_WAIT_NONE;
203+
break;
204204
case AP_RESPONSE_NO_PENDING_REPLY:
205205
if (aq->queue_count > 0)
206206
return status.irq_enabled ?
207207
AP_SM_WAIT_INTERRUPT : AP_SM_WAIT_HIGH_TIMEOUT;
208208
aq->sm_state = AP_SM_STATE_IDLE;
209-
return AP_SM_WAIT_NONE;
209+
break;
210210
default:
211211
aq->dev_state = AP_DEV_STATE_ERROR;
212212
aq->last_err_rc = status.response_code;
@@ -215,6 +215,16 @@ static enum ap_sm_wait ap_sm_read(struct ap_queue *aq)
215215
AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid));
216216
return AP_SM_WAIT_NONE;
217217
}
218+
/* Check and maybe enable irq support (again) on this queue */
219+
if (!status.irq_enabled && status.queue_empty) {
220+
void *lsi_ptr = ap_airq_ptr();
221+
222+
if (lsi_ptr && ap_queue_enable_irq(aq, lsi_ptr) == 0) {
223+
aq->sm_state = AP_SM_STATE_SETIRQ_WAIT;
224+
return AP_SM_WAIT_AGAIN;
225+
}
226+
}
227+
return AP_SM_WAIT_NONE;
218228
}
219229

220230
/**

0 commit comments

Comments
 (0)