Commit c40284b3 authored by Harald Freudenberger's avatar Harald Freudenberger Committed by Vasily Gorbik

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: default avatarTony Krowiak <akrowiak@linux.ibm.com>
Reviewed-by: default avatarHolger Dengler <dengler@linux.ibm.com>
Signed-off-by: default avatarHarald Freudenberger <freude@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 01c89ab7
...@@ -200,13 +200,13 @@ static enum ap_sm_wait ap_sm_read(struct ap_queue *aq) ...@@ -200,13 +200,13 @@ static enum ap_sm_wait ap_sm_read(struct ap_queue *aq)
return AP_SM_WAIT_AGAIN; return AP_SM_WAIT_AGAIN;
} }
aq->sm_state = AP_SM_STATE_IDLE; aq->sm_state = AP_SM_STATE_IDLE;
return AP_SM_WAIT_NONE; break;
case AP_RESPONSE_NO_PENDING_REPLY: case AP_RESPONSE_NO_PENDING_REPLY:
if (aq->queue_count > 0) if (aq->queue_count > 0)
return status.irq_enabled ? return status.irq_enabled ?
AP_SM_WAIT_INTERRUPT : AP_SM_WAIT_HIGH_TIMEOUT; AP_SM_WAIT_INTERRUPT : AP_SM_WAIT_HIGH_TIMEOUT;
aq->sm_state = AP_SM_STATE_IDLE; aq->sm_state = AP_SM_STATE_IDLE;
return AP_SM_WAIT_NONE; break;
default: default:
aq->dev_state = AP_DEV_STATE_ERROR; aq->dev_state = AP_DEV_STATE_ERROR;
aq->last_err_rc = status.response_code; aq->last_err_rc = status.response_code;
...@@ -215,6 +215,16 @@ static enum ap_sm_wait ap_sm_read(struct ap_queue *aq) ...@@ -215,6 +215,16 @@ static enum ap_sm_wait ap_sm_read(struct ap_queue *aq)
AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid));
return AP_SM_WAIT_NONE; return AP_SM_WAIT_NONE;
} }
/* Check and maybe enable irq support (again) on this queue */
if (!status.irq_enabled && status.queue_empty) {
void *lsi_ptr = ap_airq_ptr();
if (lsi_ptr && ap_queue_enable_irq(aq, lsi_ptr) == 0) {
aq->sm_state = AP_SM_STATE_SETIRQ_WAIT;
return AP_SM_WAIT_AGAIN;
}
}
return AP_SM_WAIT_NONE;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment