Commit 4c575423 authored by Jan Glauber's avatar Jan Glauber Committed by Martin Schwidefsky

[S390] qdio: simplify error handling in irq handler

The check for the device status in qdio_establish_handle_irq()
had dead code. Remove the unused code and simplify the error
handling.
Signed-off-by: default avatarJan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent e45efa99
...@@ -881,42 +881,26 @@ static void qdio_handle_activate_check(struct ccw_device *cdev, ...@@ -881,42 +881,26 @@ static void qdio_handle_activate_check(struct ccw_device *cdev,
qdio_set_state(irq_ptr, QDIO_IRQ_STATE_STOPPED); qdio_set_state(irq_ptr, QDIO_IRQ_STATE_STOPPED);
} }
static int qdio_establish_check_errors(struct ccw_device *cdev, int cstat, static void qdio_establish_handle_irq(struct ccw_device *cdev, int cstat,
int dstat) int dstat)
{ {
struct qdio_irq *irq_ptr = cdev->private->qdio_data; struct qdio_irq *irq_ptr = cdev->private->qdio_data;
if (cstat || (dstat & ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END))) { DBF_DEV_EVENT(DBF_INFO, irq_ptr, "qest irq");
DBF_ERROR("EQ:ck con");
goto error;
}
if (!(dstat & DEV_STAT_DEV_END)) { if (cstat)
DBF_ERROR("EQ:no dev");
goto error; goto error;
} if (dstat & ~(DEV_STAT_DEV_END | DEV_STAT_CHN_END))
if (dstat & ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END)) {
DBF_ERROR("EQ: bad io");
goto error; goto error;
} if (!(dstat & DEV_STAT_DEV_END))
return 0; goto error;
qdio_set_state(irq_ptr, QDIO_IRQ_STATE_ESTABLISHED);
return;
error: error:
DBF_ERROR("%4x EQ:error", irq_ptr->schid.sch_no); DBF_ERROR("%4x EQ:error", irq_ptr->schid.sch_no);
DBF_ERROR("ds: %2x cs:%2x", dstat, cstat); DBF_ERROR("ds: %2x cs:%2x", dstat, cstat);
qdio_set_state(irq_ptr, QDIO_IRQ_STATE_ERR); qdio_set_state(irq_ptr, QDIO_IRQ_STATE_ERR);
return 1;
}
static void qdio_establish_handle_irq(struct ccw_device *cdev, int cstat,
int dstat)
{
struct qdio_irq *irq_ptr = cdev->private->qdio_data;
DBF_DEV_EVENT(DBF_INFO, irq_ptr, "qest irq");
if (!qdio_establish_check_errors(cdev, cstat, dstat))
qdio_set_state(irq_ptr, QDIO_IRQ_STATE_ESTABLISHED);
} }
/* qdio interrupt handler */ /* qdio interrupt handler */
...@@ -946,7 +930,6 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm, ...@@ -946,7 +930,6 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm,
} }
} }
qdio_irq_check_sense(irq_ptr, irb); qdio_irq_check_sense(irq_ptr, irb);
cstat = irb->scsw.cmd.cstat; cstat = irb->scsw.cmd.cstat;
dstat = irb->scsw.cmd.dstat; dstat = irb->scsw.cmd.dstat;
...@@ -954,22 +937,19 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm, ...@@ -954,22 +937,19 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm,
case QDIO_IRQ_STATE_INACTIVE: case QDIO_IRQ_STATE_INACTIVE:
qdio_establish_handle_irq(cdev, cstat, dstat); qdio_establish_handle_irq(cdev, cstat, dstat);
break; break;
case QDIO_IRQ_STATE_CLEANUP: case QDIO_IRQ_STATE_CLEANUP:
qdio_set_state(irq_ptr, QDIO_IRQ_STATE_INACTIVE); qdio_set_state(irq_ptr, QDIO_IRQ_STATE_INACTIVE);
break; break;
case QDIO_IRQ_STATE_ESTABLISHED: case QDIO_IRQ_STATE_ESTABLISHED:
case QDIO_IRQ_STATE_ACTIVE: case QDIO_IRQ_STATE_ACTIVE:
if (cstat & SCHN_STAT_PCI) { if (cstat & SCHN_STAT_PCI) {
qdio_int_handler_pci(irq_ptr); qdio_int_handler_pci(irq_ptr);
return; return;
} }
if ((cstat & ~SCHN_STAT_PCI) || dstat) { if (cstat || dstat)
qdio_handle_activate_check(cdev, intparm, cstat, qdio_handle_activate_check(cdev, intparm, cstat,
dstat); dstat);
break; break;
}
default: default:
WARN_ON(1); WARN_ON(1);
} }
......
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