* [PATCH] ips 2.5 driver update [1/4] irq return update
@ 2003-05-06 17:34 Jeffery, David
2003-05-06 17:47 ` James Bottomley
0 siblings, 1 reply; 3+ messages in thread
From: Jeffery, David @ 2003-05-06 17:34 UTC (permalink / raw)
To: 'linux-scsi@vger.kernel.org'
[-- Attachment #1: Type: text/plain, Size: 214 bytes --]
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(-)
[-- Attachment #2: patch1.txt --]
[-- Type: text/plain, Size: 4409 bytes --]
diff -urN linux-2.5.69_p0/drivers/scsi/ips.c linux-2.5.69_p1/drivers/scsi/ips.c
--- linux-2.5.69_p0/drivers/scsi/ips.c 2003-05-06 12:57:14.000000000 -0400
+++ linux-2.5.69_p1/drivers/scsi/ips.c 2003-05-06 13:18:49.000000000 -0400
@@ -426,8 +426,8 @@
static void ips_enable_int_copperhead(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_intr_copperhead(ips_ha_t *);
-static void ips_intr_morpheus(ips_ha_t *);
+static irqreturn_t ips_intr_copperhead(ips_ha_t *);
+static irqreturn_t ips_intr_morpheus(ips_ha_t *);
static void ips_next(ips_ha_t *, int);
static void ipsintr_blocking(ips_ha_t *, struct ips_scb *);
static void ipsintr_done(ips_ha_t *, struct ips_scb *);
@@ -1269,7 +1269,8 @@
ips_ha_t *ha;
unsigned long cpu_flags;
struct Scsi_Host *host;
-
+ irqreturn_t irqstatus;
+
METHOD_TRACE("do_ipsintr", 2);
ha = (ips_ha_t *) dev_id;
@@ -1289,13 +1290,13 @@
return IRQ_HANDLED;
}
- (*ha->func.intr)(ha);
+ irqstatus = (*ha->func.intr)(ha);
IPS_UNLOCK_RESTORE(host->host_lock, cpu_flags);
/* start the next command */
ips_next(ha, IPS_INTR_ON);
- return IRQ_HANDLED;
+ return IRQ_RETVAL(irqstatus);
}
/****************************************************************************/
@@ -1309,7 +1310,7 @@
/* ASSUMES interrupts are disabled */
/* */
/****************************************************************************/
-void
+irqreturn_t
ips_intr_copperhead(ips_ha_t *ha) {
ips_stat_t *sp;
ips_scb_t *scb;
@@ -1319,10 +1320,10 @@
METHOD_TRACE("ips_intr", 2);
if (!ha)
- return;
+ return IRQ_NONE;
if (!ha->active)
- return;
+ return IRQ_NONE;
intrstatus = (*ha->func.isintr)(ha);
@@ -1331,7 +1332,7 @@
* Unexpected/Shared interrupt
*/
- return;
+ return IRQ_NONE;
}
while (TRUE) {
@@ -1358,6 +1359,7 @@
*/
(*scb->callback) (ha, scb);
} /* end while */
+ return IRQ_HANDLED;
}
/****************************************************************************/
@@ -1371,7 +1373,7 @@
/* ASSUMES interrupts are disabled */
/* */
/****************************************************************************/
-void
+irqreturn_t
ips_intr_morpheus(ips_ha_t *ha) {
ips_stat_t *sp;
ips_scb_t *scb;
@@ -1381,10 +1383,10 @@
METHOD_TRACE("ips_intr_morpheus", 2);
if (!ha)
- return;
+ return IRQ_NONE;
if (!ha->active)
- return;
+ return IRQ_NONE;
intrstatus = (*ha->func.isintr)(ha);
@@ -1393,7 +1395,7 @@
* Unexpected/Shared interrupt
*/
- return;
+ return IRQ_NONE;
}
while (TRUE) {
@@ -1426,6 +1428,7 @@
*/
(*scb->callback) (ha, scb);
} /* end while */
+ return IRQ_HANDLED;
}
/****************************************************************************/
diff -urN linux-2.5.69_p0/drivers/scsi/ips.h linux-2.5.69_p1/drivers/scsi/ips.h
--- linux-2.5.69_p0/drivers/scsi/ips.h 2003-05-06 12:57:14.000000000 -0400
+++ linux-2.5.69_p1/drivers/scsi/ips.h 2003-05-06 12:58:22.000000000 -0400
@@ -99,6 +99,10 @@
#endif
#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_UNREGISTER_HOSTS(SHT) scsi_unregister_module(MODULE_SCSI_HA,SHT)
#define IPS_ADD_HOST(shost,device)
@@ -1092,7 +1096,7 @@
int (*programbios)(struct ips_ha *, char *, uint32_t, uint32_t);
int (*verifybios)(struct ips_ha *, char *, uint32_t, uint32_t);
void (*statinit)(struct ips_ha *);
- void (*intr)(struct ips_ha *);
+ irqreturn_t (*intr)(struct ips_ha *);
void (*enableint)(struct ips_ha *);
uint32_t (*statupd)(struct ips_ha *);
} ips_hw_func_t;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ips 2.5 driver update [1/4] irq return update
2003-05-06 17:34 [PATCH] ips 2.5 driver update [1/4] irq return update Jeffery, David
@ 2003-05-06 17:47 ` James Bottomley
0 siblings, 0 replies; 3+ messages in thread
From: James Bottomley @ 2003-05-06 17:47 UTC (permalink / raw)
To: Jeffery, David; +Cc: 'linux-scsi@vger.kernel.org'
On Tue, 2003-05-06 at 12:34, Jeffery, David wrote:
> This is the proper way to report if the interrupt
> was from a serveraid or not.
This:
> + irqreturn_t irqstatus;
[...]
> + irqstatus = (*ha->func.intr)(ha);
[...]
> - return IRQ_HANDLED;
> + return IRQ_RETVAL(irqstatus);
Doesn't look right. Either your (ha->func.intr) returns true or false
and you need to put it through IRQ_RETVAL to get the correct IRQ_ value,
or it returns IRQ_HANDLED, IRQ_NONE and you just return these directly
(the latter looks to be what it does, so the IRQ_RETVAL() isn't needed).
I'm not sure this will work on 2.4 kernels, though, because the compiler
will then be making a
void irqstatus;
declaration which I think at least some versions of gcc won't like.
James
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] ips 2.5 driver update [1/4] irq return update
@ 2003-05-06 18:18 Jeffery, David
0 siblings, 0 replies; 3+ messages in thread
From: Jeffery, David @ 2003-05-06 18:18 UTC (permalink / raw)
To: 'James Bottomley'; +Cc: 'linux-scsi@vger.kernel.org'
[-- Attachment #1: Type: text/plain, Size: 1173 bytes --]
You are correct. Here's a corrected version of the patch.
David Jeffery
> -----Original Message-----
> From: James Bottomley [mailto:James.Bottomley@SteelEye.com]
> Sent: Tuesday, May 06, 2003 1:47 PM
> To: Jeffery, David
> Cc: 'linux-scsi@vger.kernel.org'
> Subject: Re: [PATCH] ips 2.5 driver update [1/4] irq return update
>
>
> On Tue, 2003-05-06 at 12:34, Jeffery, David wrote:
> > This is the proper way to report if the interrupt
> > was from a serveraid or not.
>
> This:
>
> > + irqreturn_t irqstatus;
> [...]
> > + irqstatus = (*ha->func.intr)(ha);
> [...]
> > - return IRQ_HANDLED;
> > + return IRQ_RETVAL(irqstatus);
>
> Doesn't look right. Either your (ha->func.intr) returns true or false
> and you need to put it through IRQ_RETVAL to get the correct
> IRQ_ value,
> or it returns IRQ_HANDLED, IRQ_NONE and you just return these directly
> (the latter looks to be what it does, so the IRQ_RETVAL()
> isn't needed).
>
> I'm not sure this will work on 2.4 kernels, though, because
> the compiler
> will then be making a
>
> void irqstatus;
>
> declaration which I think at least some versions of gcc won't like.
>
> James
>
>
[-- Attachment #2: newpatch1.txt --]
[-- Type: text/plain, Size: 4304 bytes --]
diff -urN linux-2.5.69_p0/drivers/scsi/ips.c linux-2.5.69_p1/drivers/scsi/ips.c
--- linux-2.5.69_p0/drivers/scsi/ips.c 2003-05-06 12:57:14.000000000 -0400
+++ linux-2.5.69_p1/drivers/scsi/ips.c 2003-05-06 13:18:49.000000000 -0400
@@ -426,8 +426,8 @@
static void ips_enable_int_copperhead(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_intr_copperhead(ips_ha_t *);
-static void ips_intr_morpheus(ips_ha_t *);
+static int ips_intr_copperhead(ips_ha_t *);
+static int ips_intr_morpheus(ips_ha_t *);
static void ips_next(ips_ha_t *, int);
static void ipsintr_blocking(ips_ha_t *, struct ips_scb *);
static void ipsintr_done(ips_ha_t *, struct ips_scb *);
@@ -1269,7 +1269,8 @@
ips_ha_t *ha;
unsigned long cpu_flags;
struct Scsi_Host *host;
-
+ int irqstatus;
+
METHOD_TRACE("do_ipsintr", 2);
ha = (ips_ha_t *) dev_id;
@@ -1289,13 +1290,13 @@
return IRQ_HANDLED;
}
- (*ha->func.intr)(ha);
+ irqstatus = (*ha->func.intr)(ha);
IPS_UNLOCK_RESTORE(host->host_lock, cpu_flags);
/* start the next command */
ips_next(ha, IPS_INTR_ON);
- return IRQ_HANDLED;
+ return IRQ_RETVAL(irqstatus);
}
/****************************************************************************/
@@ -1309,7 +1310,7 @@
/* ASSUMES interrupts are disabled */
/* */
/****************************************************************************/
-void
+int
ips_intr_copperhead(ips_ha_t *ha) {
ips_stat_t *sp;
ips_scb_t *scb;
@@ -1319,10 +1320,10 @@
METHOD_TRACE("ips_intr", 2);
if (!ha)
- return;
+ return 0;
if (!ha->active)
- return;
+ return 0;
intrstatus = (*ha->func.isintr)(ha);
@@ -1331,7 +1332,7 @@
* Unexpected/Shared interrupt
*/
- return;
+ return 0;
}
while (TRUE) {
@@ -1358,6 +1359,7 @@
*/
(*scb->callback) (ha, scb);
} /* end while */
+ return 1;
}
/****************************************************************************/
@@ -1371,7 +1373,7 @@
/* ASSUMES interrupts are disabled */
/* */
/****************************************************************************/
-void
+int
ips_intr_morpheus(ips_ha_t *ha) {
ips_stat_t *sp;
ips_scb_t *scb;
@@ -1381,10 +1383,10 @@
METHOD_TRACE("ips_intr_morpheus", 2);
if (!ha)
- return;
+ return 0;
if (!ha->active)
- return;
+ return 0;
intrstatus = (*ha->func.isintr)(ha);
@@ -1393,7 +1395,7 @@
* Unexpected/Shared interrupt
*/
- return;
+ return 0;
}
while (TRUE) {
@@ -1426,6 +1428,7 @@
*/
(*scb->callback) (ha, scb);
} /* end while */
+ return 1;
}
/****************************************************************************/
diff -urN linux-2.5.69_p0/drivers/scsi/ips.h linux-2.5.69_p1/drivers/scsi/ips.h
--- linux-2.5.69_p0/drivers/scsi/ips.h 2003-05-06 12:57:14.000000000 -0400
+++ linux-2.5.69_p1/drivers/scsi/ips.h 2003-05-06 12:58:22.000000000 -0400
@@ -99,6 +99,10 @@
#endif
#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_UNREGISTER_HOSTS(SHT) scsi_unregister_module(MODULE_SCSI_HA,SHT)
#define IPS_ADD_HOST(shost,device)
@@ -1092,7 +1096,7 @@
int (*programbios)(struct ips_ha *, char *, uint32_t, uint32_t);
int (*verifybios)(struct ips_ha *, char *, uint32_t, uint32_t);
void (*statinit)(struct ips_ha *);
- void (*intr)(struct ips_ha *);
+ int (*intr)(struct ips_ha *);
void (*enableint)(struct ips_ha *);
uint32_t (*statupd)(struct ips_ha *);
} ips_hw_func_t;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-05-06 18:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-06 17:34 [PATCH] ips 2.5 driver update [1/4] irq return update Jeffery, David
2003-05-06 17:47 ` James Bottomley
-- strict thread matches above, loose matches on Subject: below --
2003-05-06 18:18 Jeffery, David
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox