linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* cciss updates for 2.6 [4 of 11]
@ 2004-02-05  0:11 mikem
  0 siblings, 0 replies; only message in thread
From: mikem @ 2004-02-05  0:11 UTC (permalink / raw)
  To: akpm, axboe; +Cc: linux-kernel

Patch 4 of 11. Please apply in order.
This patch fixes a bug when sharing IRQs with another controller that
receives a lot of interrupts. Without this check we will panic the system
when unloading and reloading the driver. This is in 2.4.
Please consider this for inclusion. Tested against 2.6.2.
--------------------------------------------------------------------------------------
diff -burN lx261-p003/drivers/block/cciss.c lx261/drivers/block/cciss.c
--- lx261-p003/drivers/block/cciss.c	2004-01-21 16:31:59.000000000 -0600
+++ lx261/drivers/block/cciss.c	2004-01-21 17:02:06.000000000 -0600
@@ -1983,7 +1983,7 @@


 	/* Is this interrupt for us? */
-	if ( h->access.intr_pending(h) == 0)
+	if (( h->access.intr_pending(h) == 0) || (h->interrupts_enabled == 0))
 		return IRQ_NONE;

 	/*
diff -burN lx261-p003/drivers/block/cciss.h lx261/drivers/block/cciss.h
--- lx261-p003/drivers/block/cciss.h	2004-01-21 15:53:59.000000000 -0600
+++ lx261/drivers/block/cciss.h	2004-01-21 16:59:34.000000000 -0600
@@ -48,7 +48,7 @@
 	unsigned long io_mem_length;
 	CfgTable_struct *cfgtable;
 	int	intr;
-
+	int	interrupts_enabled;
 	int 	max_commands;
 	int	commands_outstanding;
 	int 	max_outstanding; /* Debug */
@@ -134,9 +134,11 @@
 {
 	if (val)
 	{ /* Turn interrupts on */
+		h->interrupts_enabled = 1;
 		writel(0, h->vaddr + SA5_REPLY_INTR_MASK_OFFSET);
 	} else /* Turn them off */
 	{
+		h->interrupts_enabled = 0;
         	writel( SA5_INTR_OFF,
 			h->vaddr + SA5_REPLY_INTR_MASK_OFFSET);
 	}
@@ -150,9 +152,11 @@
 {
         if (val)
         { /* Turn interrupts on */
+		h->interrupts_enabled = 1;
                 writel(0, h->vaddr + SA5_REPLY_INTR_MASK_OFFSET);
         } else /* Turn them off */
         {
+		h->interrupts_enabled = 0;
                 writel( SA5B_INTR_OFF,
                         h->vaddr + SA5_REPLY_INTR_MASK_OFFSET);
         }

Thanks,
mikem
mike.miller@hp.com


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-02-05  0:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-05  0:11 cciss updates for 2.6 [4 of 11] mikem

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).