Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 33744
b: refs/heads/master
c: 7b7db1b
h: refs/heads/master
v: v3
  • Loading branch information
Stefan Bader authored and Martin Schwidefsky committed Aug 30, 2006
1 parent 8d69430 commit e19d484
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3b88508a31a77eb3487154922e1eff282dc1d863
refs/heads/master: 7b7db1b59563aebe2f4d2ba850468afb2c87c82a
27 changes: 21 additions & 6 deletions trunk/drivers/s390/cio/device_pgid.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@
#include "device.h"
#include "ioasm.h"

/*
* Helper function called from interrupt context to decide whether an
* operation should be tried again.
*/
static int __ccw_device_should_retry(struct scsw *scsw)
{
/* CC is only valid if start function bit is set. */
if ((scsw->fctl & SCSW_FCTL_START_FUNC) && scsw->cc == 1)
return 1;
/* No more activity. For sense and set PGID we stubbornly try again. */
if (!scsw->actl)
return 1;
return 0;
}

/*
* Start Sense Path Group ID helper function. Used in ccw_device_recog
* and ccw_device_sense_pgid.
Expand Down Expand Up @@ -155,10 +170,10 @@ ccw_device_sense_pgid_irq(struct ccw_device *cdev, enum dev_event dev_event)
int ret;

irb = (struct irb *) __LC_IRB;
/* Retry sense pgid for cc=1. */

if (irb->scsw.stctl ==
(SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) {
if (irb->scsw.cc == 1) {
if (__ccw_device_should_retry(&irb->scsw)) {
ret = __ccw_device_sense_pgid_start(cdev);
if (ret && ret != -EBUSY)
ccw_device_sense_pgid_done(cdev, ret);
Expand Down Expand Up @@ -391,10 +406,10 @@ ccw_device_verify_irq(struct ccw_device *cdev, enum dev_event dev_event)
int ret;

irb = (struct irb *) __LC_IRB;
/* Retry set pgid for cc=1. */

if (irb->scsw.stctl ==
(SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) {
if (irb->scsw.cc == 1)
if (__ccw_device_should_retry(&irb->scsw))
__ccw_device_verify_start(cdev);
return;
}
Expand Down Expand Up @@ -494,10 +509,10 @@ ccw_device_disband_irq(struct ccw_device *cdev, enum dev_event dev_event)
int ret;

irb = (struct irb *) __LC_IRB;
/* Retry set pgid for cc=1. */

if (irb->scsw.stctl ==
(SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) {
if (irb->scsw.cc == 1)
if (__ccw_device_should_retry(&irb->scsw))
__ccw_device_disband_start(cdev);
return;
}
Expand Down

0 comments on commit e19d484

Please sign in to comment.