Commit 0c74ed6f authored by David Jeffery's avatar David Jeffery Committed by James Bottomley

[PATCH] ips 2.5 driver update [1/4] irq return update

This is the proper way to report if the interrupt
was from a serveraid or not.

David Jeffery

 ips.c |   29 ++++++++++++++++-------------
 ips.h |    6 +++++-
 2 files changed, 21 insertions(+), 14 deletions(-)
parent a25cb1fc
...@@ -449,8 +449,8 @@ static void ips_chkstatus(ips_ha_t *, IPS_STATUS *); ...@@ -449,8 +449,8 @@ static void ips_chkstatus(ips_ha_t *, IPS_STATUS *);
static void ips_enable_int_copperhead(ips_ha_t *); static void ips_enable_int_copperhead(ips_ha_t *);
static void ips_enable_int_copperhead_memio(ips_ha_t *); static void ips_enable_int_copperhead_memio(ips_ha_t *);
static void ips_enable_int_morpheus(ips_ha_t *); static void ips_enable_int_morpheus(ips_ha_t *);
static void ips_intr_copperhead(ips_ha_t *); static int ips_intr_copperhead(ips_ha_t *);
static void ips_intr_morpheus(ips_ha_t *); static int ips_intr_morpheus(ips_ha_t *);
static void ips_next(ips_ha_t *, int); static void ips_next(ips_ha_t *, int);
static void ipsintr_blocking(ips_ha_t *, struct ips_scb *); static void ipsintr_blocking(ips_ha_t *, struct ips_scb *);
static void ipsintr_done(ips_ha_t *, struct ips_scb *); static void ipsintr_done(ips_ha_t *, struct ips_scb *);
...@@ -1292,6 +1292,7 @@ do_ipsintr(int irq, void *dev_id, struct pt_regs *regs) { ...@@ -1292,6 +1292,7 @@ do_ipsintr(int irq, void *dev_id, struct pt_regs *regs) {
ips_ha_t *ha; ips_ha_t *ha;
unsigned long cpu_flags; unsigned long cpu_flags;
struct Scsi_Host *host; struct Scsi_Host *host;
int irqstatus;
METHOD_TRACE("do_ipsintr", 2); METHOD_TRACE("do_ipsintr", 2);
...@@ -1312,13 +1313,13 @@ do_ipsintr(int irq, void *dev_id, struct pt_regs *regs) { ...@@ -1312,13 +1313,13 @@ do_ipsintr(int irq, void *dev_id, struct pt_regs *regs) {
return IRQ_HANDLED; return IRQ_HANDLED;
} }
(*ha->func.intr)(ha); irqstatus = (*ha->func.intr)(ha);
IPS_UNLOCK_RESTORE(host->host_lock, cpu_flags); IPS_UNLOCK_RESTORE(host->host_lock, cpu_flags);
/* start the next command */ /* start the next command */
ips_next(ha, IPS_INTR_ON); ips_next(ha, IPS_INTR_ON);
return IRQ_HANDLED; return IRQ_RETVAL(irqstatus);
} }
/****************************************************************************/ /****************************************************************************/
...@@ -1332,7 +1333,7 @@ do_ipsintr(int irq, void *dev_id, struct pt_regs *regs) { ...@@ -1332,7 +1333,7 @@ do_ipsintr(int irq, void *dev_id, struct pt_regs *regs) {
/* ASSUMES interrupts are disabled */ /* ASSUMES interrupts are disabled */
/* */ /* */
/****************************************************************************/ /****************************************************************************/
void int
ips_intr_copperhead(ips_ha_t *ha) { ips_intr_copperhead(ips_ha_t *ha) {
ips_stat_t *sp; ips_stat_t *sp;
ips_scb_t *scb; ips_scb_t *scb;
...@@ -1342,10 +1343,10 @@ ips_intr_copperhead(ips_ha_t *ha) { ...@@ -1342,10 +1343,10 @@ ips_intr_copperhead(ips_ha_t *ha) {
METHOD_TRACE("ips_intr", 2); METHOD_TRACE("ips_intr", 2);
if (!ha) if (!ha)
return; return 0;
if (!ha->active) if (!ha->active)
return; return 0;
intrstatus = (*ha->func.isintr)(ha); intrstatus = (*ha->func.isintr)(ha);
...@@ -1354,7 +1355,7 @@ ips_intr_copperhead(ips_ha_t *ha) { ...@@ -1354,7 +1355,7 @@ ips_intr_copperhead(ips_ha_t *ha) {
* Unexpected/Shared interrupt * Unexpected/Shared interrupt
*/ */
return; return 0;
} }
while (TRUE) { while (TRUE) {
...@@ -1381,6 +1382,7 @@ ips_intr_copperhead(ips_ha_t *ha) { ...@@ -1381,6 +1382,7 @@ ips_intr_copperhead(ips_ha_t *ha) {
*/ */
(*scb->callback) (ha, scb); (*scb->callback) (ha, scb);
} /* end while */ } /* end while */
return 1;
} }
/****************************************************************************/ /****************************************************************************/
...@@ -1394,7 +1396,7 @@ ips_intr_copperhead(ips_ha_t *ha) { ...@@ -1394,7 +1396,7 @@ ips_intr_copperhead(ips_ha_t *ha) {
/* ASSUMES interrupts are disabled */ /* ASSUMES interrupts are disabled */
/* */ /* */
/****************************************************************************/ /****************************************************************************/
void int
ips_intr_morpheus(ips_ha_t *ha) { ips_intr_morpheus(ips_ha_t *ha) {
ips_stat_t *sp; ips_stat_t *sp;
ips_scb_t *scb; ips_scb_t *scb;
...@@ -1404,10 +1406,10 @@ ips_intr_morpheus(ips_ha_t *ha) { ...@@ -1404,10 +1406,10 @@ ips_intr_morpheus(ips_ha_t *ha) {
METHOD_TRACE("ips_intr_morpheus", 2); METHOD_TRACE("ips_intr_morpheus", 2);
if (!ha) if (!ha)
return; return 0;
if (!ha->active) if (!ha->active)
return; return 0;
intrstatus = (*ha->func.isintr)(ha); intrstatus = (*ha->func.isintr)(ha);
...@@ -1416,7 +1418,7 @@ ips_intr_morpheus(ips_ha_t *ha) { ...@@ -1416,7 +1418,7 @@ ips_intr_morpheus(ips_ha_t *ha) {
* Unexpected/Shared interrupt * Unexpected/Shared interrupt
*/ */
return; return 0;
} }
while (TRUE) { while (TRUE) {
...@@ -1449,6 +1451,7 @@ ips_intr_morpheus(ips_ha_t *ha) { ...@@ -1449,6 +1451,7 @@ ips_intr_morpheus(ips_ha_t *ha) {
*/ */
(*scb->callback) (ha, scb); (*scb->callback) (ha, scb);
} /* end while */ } /* end while */
return 1;
} }
/****************************************************************************/ /****************************************************************************/
......
...@@ -96,6 +96,10 @@ ...@@ -96,6 +96,10 @@
#endif #endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
typedef void irqreturn_t;
#define IRQ_NONE
#define IRQ_HANDLED
#define IRQ_RETVAL(x)
#define IPS_REGISTER_HOSTS(SHT) scsi_register_module(MODULE_SCSI_HA,SHT) #define IPS_REGISTER_HOSTS(SHT) scsi_register_module(MODULE_SCSI_HA,SHT)
#define IPS_UNREGISTER_HOSTS(SHT) scsi_unregister_module(MODULE_SCSI_HA,SHT) #define IPS_UNREGISTER_HOSTS(SHT) scsi_unregister_module(MODULE_SCSI_HA,SHT)
#define IPS_ADD_HOST(shost,device) #define IPS_ADD_HOST(shost,device)
...@@ -1052,7 +1056,7 @@ typedef struct { ...@@ -1052,7 +1056,7 @@ typedef struct {
int (*programbios)(struct ips_ha *, char *, uint32_t, uint32_t); int (*programbios)(struct ips_ha *, char *, uint32_t, uint32_t);
int (*verifybios)(struct ips_ha *, char *, uint32_t, uint32_t); int (*verifybios)(struct ips_ha *, char *, uint32_t, uint32_t);
void (*statinit)(struct ips_ha *); void (*statinit)(struct ips_ha *);
void (*intr)(struct ips_ha *); int (*intr)(struct ips_ha *);
void (*enableint)(struct ips_ha *); void (*enableint)(struct ips_ha *);
uint32_t (*statupd)(struct ips_ha *); uint32_t (*statupd)(struct ips_ha *);
} ips_hw_func_t; } ips_hw_func_t;
......
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