Commit bc615dea authored by Holger Dengler's avatar Holger Dengler Committed by Martin Schwidefsky

[S390] ap: Setup processing for messages in request queue.

Setup timer for processing messages in request queue, if sending an AP
message returns with reason code AP_RESPONSE_RESET_IN_PROGRESS.
Signed-off-by: default avatarHolger Dengler <hd@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 96603b50
...@@ -1271,18 +1271,16 @@ ap_config_timeout(unsigned long ptr) ...@@ -1271,18 +1271,16 @@ ap_config_timeout(unsigned long ptr)
} }
/** /**
* ap_schedule_poll_timer(): Schedule poll timer. * __ap_schedule_poll_timer(): Schedule poll timer.
* *
* Set up the timer to run the poll tasklet * Set up the timer to run the poll tasklet
*/ */
static inline void ap_schedule_poll_timer(void) static inline void __ap_schedule_poll_timer(void)
{ {
ktime_t hr_time; ktime_t hr_time;
spin_lock_bh(&ap_poll_timer_lock); spin_lock_bh(&ap_poll_timer_lock);
if (ap_using_interrupts() || ap_suspend_flag) if (hrtimer_is_queued(&ap_poll_timer) || ap_suspend_flag)
goto out;
if (hrtimer_is_queued(&ap_poll_timer))
goto out; goto out;
if (ktime_to_ns(hrtimer_expires_remaining(&ap_poll_timer)) <= 0) { if (ktime_to_ns(hrtimer_expires_remaining(&ap_poll_timer)) <= 0) {
hr_time = ktime_set(0, poll_timeout); hr_time = ktime_set(0, poll_timeout);
...@@ -1293,6 +1291,18 @@ static inline void ap_schedule_poll_timer(void) ...@@ -1293,6 +1291,18 @@ static inline void ap_schedule_poll_timer(void)
spin_unlock_bh(&ap_poll_timer_lock); spin_unlock_bh(&ap_poll_timer_lock);
} }
/**
* ap_schedule_poll_timer(): Schedule poll timer.
*
* Set up the timer to run the poll tasklet
*/
static inline void ap_schedule_poll_timer(void)
{
if (ap_using_interrupts())
return;
__ap_schedule_poll_timer();
}
/** /**
* ap_poll_read(): Receive pending reply messages from an AP device. * ap_poll_read(): Receive pending reply messages from an AP device.
* @ap_dev: pointer to the AP device * @ap_dev: pointer to the AP device
...@@ -1374,8 +1384,9 @@ static int ap_poll_write(struct ap_device *ap_dev, unsigned long *flags) ...@@ -1374,8 +1384,9 @@ static int ap_poll_write(struct ap_device *ap_dev, unsigned long *flags)
*flags |= 1; *flags |= 1;
*flags |= 2; *flags |= 2;
break; break;
case AP_RESPONSE_Q_FULL:
case AP_RESPONSE_RESET_IN_PROGRESS: case AP_RESPONSE_RESET_IN_PROGRESS:
__ap_schedule_poll_timer();
case AP_RESPONSE_Q_FULL:
*flags |= 2; *flags |= 2;
break; break;
case AP_RESPONSE_MESSAGE_TOO_BIG: case AP_RESPONSE_MESSAGE_TOO_BIG:
......
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