[PATCH 3/3] cpqarray: per disk request queue in 2.6 kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Patch 3 of 3
This patch adds support for per disk request queue in 2.6 kernel. This
solves the
kernel panic while removing the cpqarray with more than one LUN
configured.

Please consider this for inclusion.

Signed-off-by: Ramanamurthy Saripalli <[email protected]>

 cpqarray.c |   51 +++++++++++++++++++++++++++++++++++++++++++++++----
 cpqarray.h |    1 +
 2 files changed, 48 insertions(+), 4 deletions(-)
------------------------------------------------------------------------
-----------
diff -burpN old/drivers/block/cpqarray.c new3/drivers/block/cpqarray.c
--- old/drivers/block/cpqarray.c	2005-06-28 23:26:06.000000000
-0400
+++ new3/drivers/block/cpqarray.c	2005-06-29 00:01:22.000000000
-0400
@@ -45,13 +45,13 @@
 
 #define SMART2_DRIVER_VERSION(maj,min,submin)
((maj<<16)|(min<<8)|(submin))
 
-#define DRIVER_NAME "Compaq SMART2 Driver (v 2.6.0)"
-#define DRIVER_VERSION SMART2_DRIVER_VERSION(2,6,0)
+#define DRIVER_NAME "Compaq SMART2 Driver (v 2.6.1)"
+#define DRIVER_VERSION SMART2_DRIVER_VERSION(2,6,1)
 
 /* Embedded module documentation macros - see modules.h */
 /* Original author Chris Frantz - Compaq Computer Corporation */
 MODULE_AUTHOR("Compaq Computer Corporation");
-MODULE_DESCRIPTION("Driver for Compaq Smart2 Array Controllers version
2.6.0");
+MODULE_DESCRIPTION("Driver for Compaq Smart2 Array Controllers version
2.6.1");
 MODULE_LICENSE("GPL");
 
 #include "cpqarray.h"
@@ -489,6 +489,22 @@ static int cpqarray_register_ctlr( int i
 		blk_queue_hardsect_size(hba[i]->queue, drv->blk_size);
 		set_capacity(disk, drv->nr_blks);
 		disk->queue = hba[i]->queue;
+
+		/*
+		 * Create request queue per logical volume
+		 */
+                if ( j )
+                        disk->queue = blk_init_queue(do_ida_request,
&hba[i]->lock);
+
+                disk->queue->queuedata = hba[i];
+
+                /* This is a hardware imposed limit. */
+                blk_queue_max_hw_segments(disk->queue, SG_MAX);
+
+                /* This is a driver limit and could be eliminated. */
+                blk_queue_max_phys_segments(disk->queue, SG_MAX);
+
+
 		disk->private_data = drv;
 		add_disk(disk);
 	}
@@ -1060,6 +1076,9 @@ static irqreturn_t do_ida_intr(int irq, 
 	unsigned long istat;
 	unsigned long flags;
 	__u32 a,a1;
+	int j;
+        int ctlr = h->ctlr;             
+        int start_queue = h->next_to_run;
 
 	istat = h->access.intr_pending(h);
 	/* Is this interrupt for us? */
@@ -1113,7 +1132,31 @@ static irqreturn_t do_ida_intr(int irq, 
 	/*
 	 * See if we can queue up some more IO
 	 */
-	do_ida_request(h->queue);
+        for(j=0; j < NWD; j++) {
+                int curr_queue = (start_queue + j) % NWD;
+
+                if (!(ida_gendisk[ctlr][curr_queue]->queue) ||
+                        !(h->drv[curr_queue].heads))
+                        continue;
+
+                blk_start_queue(ida_gendisk[ctlr][curr_queue]->queue);
+
+                if ( (find_first_zero_bit(h->cmd_pool_bits, NR_CMDS) )
== NR_CMDS)
+                {
+                        if ( curr_queue == start_queue) {
+                                h->next_to_run = (start_queue + 1) %
NWD;
+                                goto cleanup;
+                        } else {
+                                h->next_to_run = curr_queue;
+                                goto cleanup;
+                        }
+                } else {
+                        curr_queue = (curr_queue + 1) %NWD;
+                }
+        }
+
+cleanup:
+
 	spin_unlock_irqrestore(IDA_LOCK(h->ctlr), flags); 
 	return IRQ_HANDLED;
 }
diff -burpN old/drivers/block/cpqarray.h new3/drivers/block/cpqarray.h
--- old/drivers/block/cpqarray.h	2005-06-28 23:26:14.000000000
-0400
+++ new3/drivers/block/cpqarray.h	2005-06-29 00:01:31.000000000
-0400
@@ -117,6 +117,7 @@ struct ctlr_info {
 	unsigned int nr_frees;
 	struct timer_list timer;
 	unsigned int misc_tflags;
+	int next_to_run;
 };
 
 #define IDA_LOCK(i)	(&hba[i]->lock)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux