[kernel] r8028 - in dists/sid/linux-2.6/debian: . patches/bugfix patches/series

Dann Frazier dannf at alioth.debian.org
Tue Dec 19 19:04:59 UTC 2006


Author: dannf
Date: Tue Dec 19 20:04:57 2006
New Revision: 8028

Added:
   dists/sid/linux-2.6/debian/patches/bugfix/cciss-1TB-disc-bug.patch
   dists/sid/linux-2.6/debian/patches/bugfix/cciss-XFER_READ-WRITE.patch
   dists/sid/linux-2.6/debian/patches/bugfix/cciss-define-NR_CMDS-per-controller.patch
   dists/sid/linux-2.6/debian/patches/bugfix/cciss-e500-fwbug-workaround.patch
   dists/sid/linux-2.6/debian/patches/bugfix/cciss-increase-blk_queue_max_sectors.patch
   dists/sid/linux-2.6/debian/patches/bugfix/cciss-map-more-config-table-mem.patch
   dists/sid/linux-2.6/debian/patches/bugfix/cciss-p600-asic-bug-disable-prefetch.patch
   dists/sid/linux-2.6/debian/patches/bugfix/cciss-set-default-raid-level.patch
   dists/sid/linux-2.6/debian/patches/bugfix/cciss-support-hp-raid-class-with-valid-sig.patch
Modified:
   dists/sid/linux-2.6/debian/changelog
   dists/sid/linux-2.6/debian/patches/series/9
Log:
* Backport a number of fixes for the cciss driver
  - Fix a bug with 1TB disks caused by converting total_size to an int
  - Claim devices that are of the HP RAID class and have a valid cciss sig
  - Make NR_CMDS a per-controller define - most can do 1024 commands, but
    the E200 family can only support 128
  - Change the SSID on the E500 as a workaround for a firmware bug
  - Disable prefetch on the P600 controller. An ASIC bug may result in
    prefetching beyond the end of physical memory
  - Increase blk_queue_max_sectors from 512 to 2048 to increase performance
  - Map out more memor for the PCI config table, required to reach offset
    0x214 to disable DMA on the P600
  - Set a default raid level on a volume that either does not support
    reading the geometry or reports an invalid geometry for whatever reason
    to avoid problems with buggy firmware
  - Revert change that replaed XFER_READ/XFER_WRITE macros with
    h->cciss_read/h->cciss_write that caused command timeouts on older
    controllers on ia32 (closes: #402787)

Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog	(original)
+++ dists/sid/linux-2.6/debian/changelog	Tue Dec 19 20:04:57 2006
@@ -12,12 +12,29 @@
   [ dann frazier ]
   * Fix data corruption with dm-crypt over RAID5 (closes: #402812)
   * Fix potential fragmentation attacks in ip6_tables (CVE-2006-4572)
+  * Backport a number of fixes for the cciss driver
+    - Fix a bug with 1TB disks caused by converting total_size to an int
+    - Claim devices that are of the HP RAID class and have a valid cciss sig
+    - Make NR_CMDS a per-controller define - most can do 1024 commands, but
+      the E200 family can only support 128
+    - Change the SSID on the E500 as a workaround for a firmware bug
+    - Disable prefetch on the P600 controller. An ASIC bug may result in
+      prefetching beyond the end of physical memory
+    - Increase blk_queue_max_sectors from 512 to 2048 to increase performance
+    - Map out more memor for the PCI config table, required to reach offset
+      0x214 to disable DMA on the P600
+    - Set a default raid level on a volume that either does not support
+      reading the geometry or reports an invalid geometry for whatever reason
+      to avoid problems with buggy firmware
+    - Revert change that replaed XFER_READ/XFER_WRITE macros with
+      h->cciss_read/h->cciss_write that caused command timeouts on older
+      controllers on ia32 (closes: #402787)
 
   [ Norbert Tretkowski ]
   * libata: handle 0xff status properly. (closes: #391867)
   * alpha: enabled CONFIG_SCSI_ARCMSR. (closes: #401187)
 
- -- Norbert Tretkowski <nobse at debian.org>  Mon, 18 Dec 2006 20:22:10 +0100
+ -- dann frazier <dannf at debian.org>  Tue, 19 Dec 2006 11:00:26 -0700
 
 linux-2.6 (2.6.18-8) unstable; urgency=low
 

Added: dists/sid/linux-2.6/debian/patches/bugfix/cciss-1TB-disc-bug.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/cciss-1TB-disc-bug.patch	Tue Dec 19 20:04:57 2006
@@ -0,0 +1,67 @@
+From: Matthew Wilcox <matthew at wil.cx>
+Date: Sat, 21 Oct 2006 17:24:19 +0000 (-0700)
+Subject: [PATCH] cciss: Fix warnings (and bug on 1TB discs)
+X-Git-Tag: v2.6.19-rc3
+X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=3f7705eab6722ad1a346d748c4aad55755d6c241
+
+[PATCH] cciss: Fix warnings (and bug on 1TB discs)
+
+CCISS was producing warnings about shifts being greater than the size of
+the type and pointers being of incompatible type.  Turns out this is
+because it's calling do_div on a 32-bit quantity.  Upon further
+investigation, the sector_t total_size is being assigned to an int, and
+then we're calling do_div on that int.  Obviously, sector_div is called for
+here, and I took the chance to refactor the code a little.
+
+Signed-off-by: Matthew Wilcox <matthew at wil.cx>
+Acked-by: Mike Miller <mike.miller at hp.com>
+Signed-off-by: Andrew Morton <akpm at osdl.org>
+Signed-off-by: Linus Torvalds <torvalds at osdl.org>
+---
+
+--- a/drivers/block/cciss.c
++++ b/drivers/block/cciss.c
+@@ -1923,7 +1923,6 @@ static void cciss_geometry_inquiry(int c
+ {
+ 	int return_code;
+ 	unsigned long t;
+-	unsigned long rem;
+ 
+ 	memset(inq_buff, 0, sizeof(InquiryData_struct));
+ 	if (withirq)
+@@ -1939,26 +1938,23 @@ static void cciss_geometry_inquiry(int c
+ 			printk(KERN_WARNING
+ 			       "cciss: reading geometry failed, volume "
+ 			       "does not support reading geometry\n");
+-			drv->block_size = block_size;
+-			drv->nr_blocks = total_size;
+ 			drv->heads = 255;
+ 			drv->sectors = 32;	// Sectors per track
+-			t = drv->heads * drv->sectors;
+-			drv->cylinders = total_size;
+-			rem = do_div(drv->cylinders, t);
+ 		} else {
+-			drv->block_size = block_size;
+-			drv->nr_blocks = total_size;
+ 			drv->heads = inq_buff->data_byte[6];
+ 			drv->sectors = inq_buff->data_byte[7];
+ 			drv->cylinders = (inq_buff->data_byte[4] & 0xff) << 8;
+ 			drv->cylinders += inq_buff->data_byte[5];
+ 			drv->raid_level = inq_buff->data_byte[8];
+-			t = drv->heads * drv->sectors;
+-			if (t > 1) {
+-				drv->cylinders = total_size;
+-				rem = do_div(drv->cylinders, t);
+-			}
++		}
++		drv->block_size = block_size;
++		drv->nr_blocks = total_size;
++		t = drv->heads * drv->sectors;
++		if (t > 1) {
++			unsigned rem = sector_div(total_size, t);
++			if (rem)
++				total_size++;
++			drv->cylinders = total_size;
+ 		}
+ 	} else {		/* Get geometry failed */
+ 		printk(KERN_WARNING "cciss: reading geometry failed\n");

Added: dists/sid/linux-2.6/debian/patches/bugfix/cciss-XFER_READ-WRITE.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/cciss-XFER_READ-WRITE.patch	Tue Dec 19 20:04:57 2006
@@ -0,0 +1,32 @@
+Patch 2 of 2
+
+This patch fixes a stupid bug. Sometime during the 2tb enhancement I ended up
+replacing the macros XFER_READ and XFER_WRITE with h->cciss_read and
+h->cciss_write respectively. It seemed to work somehow at least on x86_64 and
+ia64. I don't know how. But people started complaining about command timeouts
+on older controllers like the 64xx series and only on ia32. This resolves the
+issue reproduced in our lab. Please consider this for inclusion. 
+
+Thanks,
+mikem
+
+Signed-off-by: Mike Miller <mike.miller at hp.com>
+--------------------------------------------------------------------------------
+
+ drivers/block/cciss.c |    2 +-
+ 1 files changed, 1 insertion(+), 1 deletion(-)
+
+diff -puN drivers/block/cciss.c~cciss_xfer_fix drivers/block/cciss.c
+--- linux-2.6-work/drivers/block/cciss.c~cciss_xfer_fix	2006-12-15 08:56:40.000000000 -0600
++++ linux-2.6-work-mikem/drivers/block/cciss.c	2006-12-15 08:58:20.000000000 -0600
+@@ -2492,7 +2492,7 @@ static void do_cciss_request(request_que
+ 	c->Request.Type.Type = TYPE_CMD;	// It is a command.
+ 	c->Request.Type.Attribute = ATTR_SIMPLE;
+ 	c->Request.Type.Direction =
+-	    (rq_data_dir(creq) == READ) ? h->cciss_read : h->cciss_write;
++	    (rq_data_dir(creq) == READ) ? XFER_READ : XFER_WRITE;
+ 	c->Request.Timeout = 0;	// Don't time out
+ 	c->Request.CDB[0] =
+ 	    (rq_data_dir(creq) == READ) ? h->cciss_read : h->cciss_write;
+_
+

Added: dists/sid/linux-2.6/debian/patches/bugfix/cciss-define-NR_CMDS-per-controller.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/cciss-define-NR_CMDS-per-controller.patch	Tue Dec 19 20:04:57 2006
@@ -0,0 +1,223 @@
+From: Mike Miller <mike.miller at hp.com>
+Date: Thu, 7 Dec 2006 04:35:01 +0000 (-0800)
+Subject: [PATCH] cciss: increase number of commands on controller
+X-Git-Tag: v2.6.20-rc1
+X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=f880632f963c3611d096d9373d16663c076310c7
+
+[PATCH] cciss: increase number of commands on controller
+
+Remove #define NR_CMDS and replace it w/hba[i]->nr_cmds.  Most Smart Array
+controllers can support up to 1024 commands but the E200 family can only
+support 128.  To prevent annoying "fifo full" messages we define nr_cmds on a
+per controller basis by adding it the product table.
+
+Signed-off-by: Mike Miller <mike.miller at hp.com>
+Acked-by: Jens Axboe <jens.axboe at oracle.com>
+Signed-off-by: Andrew Morton <akpm at osdl.org>
+Signed-off-by: Linus Torvalds <torvalds at osdl.org>
+---
+
+--- a/drivers/block/cciss.c
++++ b/drivers/block/cciss.c
+@@ -93,28 +93,29 @@ MODULE_DEVICE_TABLE(pci, cciss_pci_devic
+ /*  board_id = Subsystem Device ID & Vendor ID
+  *  product = Marketing Name for the board
+  *  access = Address of the struct of function pointers
++ *  nr_cmds = Number of commands supported by controller
+  */
+ static struct board_type products[] = {
+-	{0x40700E11, "Smart Array 5300", &SA5_access},
+-	{0x40800E11, "Smart Array 5i", &SA5B_access},
+-	{0x40820E11, "Smart Array 532", &SA5B_access},
+-	{0x40830E11, "Smart Array 5312", &SA5B_access},
+-	{0x409A0E11, "Smart Array 641", &SA5_access},
+-	{0x409B0E11, "Smart Array 642", &SA5_access},
+-	{0x409C0E11, "Smart Array 6400", &SA5_access},
+-	{0x409D0E11, "Smart Array 6400 EM", &SA5_access},
+-	{0x40910E11, "Smart Array 6i", &SA5_access},
+-	{0x3225103C, "Smart Array P600", &SA5_access},
+-	{0x3223103C, "Smart Array P800", &SA5_access},
+-	{0x3234103C, "Smart Array P400", &SA5_access},
+-	{0x3235103C, "Smart Array P400i", &SA5_access},
+-	{0x3211103C, "Smart Array E200i", &SA5_access},
+-	{0x3212103C, "Smart Array E200", &SA5_access},
+-	{0x3213103C, "Smart Array E200i", &SA5_access},
+-	{0x3214103C, "Smart Array E200i", &SA5_access},
+-	{0x3215103C, "Smart Array E200i", &SA5_access},
+-	{0x3233103C, "Smart Array E500", &SA5_access},
+-	{0xFFFF103C, "Unknown Smart Array", &SA5_access},
++	{0x40700E11, "Smart Array 5300", &SA5_access, 512},
++	{0x40800E11, "Smart Array 5i", &SA5B_access, 512},
++	{0x40820E11, "Smart Array 532", &SA5B_access, 512},
++	{0x40830E11, "Smart Array 5312", &SA5B_access, 512},
++	{0x409A0E11, "Smart Array 641", &SA5_access, 512},
++	{0x409B0E11, "Smart Array 642", &SA5_access, 512},
++	{0x409C0E11, "Smart Array 6400", &SA5_access, 512},
++	{0x409D0E11, "Smart Array 6400 EM", &SA5_access, 512},
++	{0x40910E11, "Smart Array 6i", &SA5_access, 512},
++	{0x3225103C, "Smart Array P600", &SA5_access, 512},
++	{0x3223103C, "Smart Array P800", &SA5_access, 512},
++	{0x3234103C, "Smart Array P400", &SA5_access, 512},
++	{0x3235103C, "Smart Array P400i", &SA5_access, 512},
++	{0x3211103C, "Smart Array E200i", &SA5_access, 120},
++	{0x3212103C, "Smart Array E200", &SA5_access, 120},
++	{0x3213103C, "Smart Array E200i", &SA5_access, 120},
++	{0x3214103C, "Smart Array E200i", &SA5_access, 120},
++	{0x3215103C, "Smart Array E200i", &SA5_access, 120},
++	{0x3233103C, "Smart Array E500", &SA5_access, 512},
++	{0xFFFF103C, "Unknown Smart Array", &SA5_access, 120},
+ };
+ 
+ /* How long to wait (in milliseconds) for board to go into simple mode */
+@@ -125,7 +126,6 @@ static struct board_type products[] = {
+ #define MAX_CMD_RETRIES 3
+ 
+ #define READ_AHEAD 	 1024
+-#define NR_CMDS		 384	/* #commands that can be outstanding */
+ #define MAX_CTLR	32
+ 
+ /* Originally cciss driver only supports 8 major numbers */
+@@ -404,8 +404,8 @@ static CommandList_struct *cmd_alloc(ctl
+ 	} else {		/* get it out of the controllers pool */
+ 
+ 		do {
+-			i = find_first_zero_bit(h->cmd_pool_bits, NR_CMDS);
+-			if (i == NR_CMDS)
++			i = find_first_zero_bit(h->cmd_pool_bits, h->nr_cmds);
++			if (i == h->nr_cmds)
+ 				return NULL;
+ 		} while (test_and_set_bit
+ 			 (i & (BITS_PER_LONG - 1),
+@@ -1247,7 +1247,7 @@ static void cciss_check_queues(ctlr_info
+ 	 * in case the interrupt we serviced was from an ioctl and did not
+ 	 * free any new commands.
+ 	 */
+-	if ((find_first_zero_bit(h->cmd_pool_bits, NR_CMDS)) == NR_CMDS)
++	if ((find_first_zero_bit(h->cmd_pool_bits, h->nr_cmds)) == h->nr_cmds)
+ 		return;
+ 
+ 	/* We have room on the queue for more commands.  Now we need to queue
+@@ -1266,7 +1266,7 @@ static void cciss_check_queues(ctlr_info
+ 		/* check to see if we have maxed out the number of commands
+ 		 * that can be placed on the queue.
+ 		 */
+-		if ((find_first_zero_bit(h->cmd_pool_bits, NR_CMDS)) == NR_CMDS) {
++		if ((find_first_zero_bit(h->cmd_pool_bits, h->nr_cmds)) == h->nr_cmds) {
+ 			if (curr_queue == start_queue) {
+ 				h->next_to_run =
+ 				    (start_queue + 1) % (h->highest_lun + 1);
+@@ -2140,7 +2140,7 @@ static int add_sendcmd_reject(__u8 cmd, 
+ 
+ 	/* We've sent down an abort or reset, but something else
+ 	   has completed */
+-	if (srl->ncompletions >= (NR_CMDS + 2)) {
++	if (srl->ncompletions >= (hba[ctlr]->nr_cmds + 2)) {
+ 		/* Uh oh.  No room to save it for later... */
+ 		printk(KERN_WARNING "cciss%d: Sendcmd: Invalid command addr, "
+ 		       "reject list overflow, command lost!\n", ctlr);
+@@ -2677,7 +2677,7 @@ static irqreturn_t do_cciss_intr(int irq
+ 			a1 = a;
+ 			if ((a & 0x04)) {
+ 				a2 = (a >> 3);
+-				if (a2 >= NR_CMDS) {
++				if (a2 >= h->nr_cmds) {
+ 					printk(KERN_WARNING
+ 					       "cciss: controller cciss%d failed, stopping.\n",
+ 					       h->ctlr);
+@@ -2960,6 +2960,7 @@ static int cciss_pci_init(ctlr_info_t *c
+ 		if (board_id == products[i].board_id) {
+ 			c->product_name = products[i].product_name;
+ 			c->access = *(products[i].access);
++			c->nr_cmds = products[i].nr_cmds;
+ 			break;
+ 		}
+ 	}
+@@ -2979,6 +2980,7 @@ static int cciss_pci_init(ctlr_info_t *c
+ 		if (subsystem_vendor_id == PCI_VENDOR_ID_HP) {
+ 			c->product_name = products[i-1].product_name;
+ 			c->access = *(products[i-1].access);
++			c->nr_cmds = products[i-1].nr_cmds;
+ 			printk(KERN_WARNING "cciss: This is an unknown "
+ 				"Smart Array controller.\n"
+ 				"cciss: Please update to the latest driver "
+@@ -3286,15 +3288,15 @@ static int __devinit cciss_init_one(stru
+ 	       hba[i]->intr[SIMPLE_MODE_INT], dac ? "" : " not");
+ 
+ 	hba[i]->cmd_pool_bits =
+-	    kmalloc(((NR_CMDS + BITS_PER_LONG -
++	    kmalloc(((hba[i]->nr_cmds + BITS_PER_LONG -
+ 		      1) / BITS_PER_LONG) * sizeof(unsigned long), GFP_KERNEL);
+ 	hba[i]->cmd_pool = (CommandList_struct *)
+ 	    pci_alloc_consistent(hba[i]->pdev,
+-		    NR_CMDS * sizeof(CommandList_struct),
++		    hba[i]->nr_cmds * sizeof(CommandList_struct),
+ 		    &(hba[i]->cmd_pool_dhandle));
+ 	hba[i]->errinfo_pool = (ErrorInfo_struct *)
+ 	    pci_alloc_consistent(hba[i]->pdev,
+-		    NR_CMDS * sizeof(ErrorInfo_struct),
++		    hba[i]->nr_cmds * sizeof(ErrorInfo_struct),
+ 		    &(hba[i]->errinfo_pool_dhandle));
+ 	if ((hba[i]->cmd_pool_bits == NULL)
+ 	    || (hba[i]->cmd_pool == NULL)
+@@ -3305,7 +3307,7 @@ static int __devinit cciss_init_one(stru
+ #ifdef CONFIG_CISS_SCSI_TAPE
+ 	hba[i]->scsi_rejects.complete =
+ 	    kmalloc(sizeof(hba[i]->scsi_rejects.complete[0]) *
+-		    (NR_CMDS + 5), GFP_KERNEL);
++		    (hba[i]->nr_cmds + 5), GFP_KERNEL);
+ 	if (hba[i]->scsi_rejects.complete == NULL) {
+ 		printk(KERN_ERR "cciss: out of memory");
+ 		goto clean4;
+@@ -3319,7 +3321,7 @@ static int __devinit cciss_init_one(stru
+ 	/* command and error info recs zeroed out before
+ 	   they are used */
+ 	memset(hba[i]->cmd_pool_bits, 0,
+-	       ((NR_CMDS + BITS_PER_LONG -
++	       ((hba[i]->nr_cmds + BITS_PER_LONG -
+ 		 1) / BITS_PER_LONG) * sizeof(unsigned long));
+ 
+ #ifdef CCISS_DEBUG
+@@ -3388,11 +3390,11 @@ static int __devinit cciss_init_one(stru
+ 	kfree(hba[i]->cmd_pool_bits);
+ 	if (hba[i]->cmd_pool)
+ 		pci_free_consistent(hba[i]->pdev,
+-				    NR_CMDS * sizeof(CommandList_struct),
++				    hba[i]->nr_cmds * sizeof(CommandList_struct),
+ 				    hba[i]->cmd_pool, hba[i]->cmd_pool_dhandle);
+ 	if (hba[i]->errinfo_pool)
+ 		pci_free_consistent(hba[i]->pdev,
+-				    NR_CMDS * sizeof(ErrorInfo_struct),
++				    hba[i]->nr_cmds * sizeof(ErrorInfo_struct),
+ 				    hba[i]->errinfo_pool,
+ 				    hba[i]->errinfo_pool_dhandle);
+ 	free_irq(hba[i]->intr[SIMPLE_MODE_INT], hba[i]);
+@@ -3459,9 +3461,9 @@ static void __devexit cciss_remove_one(s
+ 		}
+ 	}
+ 
+-	pci_free_consistent(hba[i]->pdev, NR_CMDS * sizeof(CommandList_struct),
++	pci_free_consistent(hba[i]->pdev, hba[i]->nr_cmds * sizeof(CommandList_struct),
+ 			    hba[i]->cmd_pool, hba[i]->cmd_pool_dhandle);
+-	pci_free_consistent(hba[i]->pdev, NR_CMDS * sizeof(ErrorInfo_struct),
++	pci_free_consistent(hba[i]->pdev, hba[i]->nr_cmds * sizeof(ErrorInfo_struct),
+ 			    hba[i]->errinfo_pool, hba[i]->errinfo_pool_dhandle);
+ 	kfree(hba[i]->cmd_pool_bits);
+ #ifdef CONFIG_CISS_SCSI_TAPE
+--- a/drivers/block/cciss.h
++++ b/drivers/block/cciss.h
+@@ -60,6 +60,7 @@ struct ctlr_info 
+ 	__u32	board_id;
+ 	void __iomem *vaddr;
+ 	unsigned long paddr;
++	int 	nr_cmds; /* Number of commands allowed on this controller */
+ 	CfgTable_struct __iomem *cfgtable;
+ 	int	interrupts_enabled;
+ 	int	major;
+@@ -282,6 +283,7 @@ struct board_type {
+ 	__u32	board_id;
+ 	char	*product_name;
+ 	struct access_method *access;
++	int nr_cmds; /* Max cmds this kind of ctlr can handle. */
+ };
+ 
+ #define CCISS_LOCK(i)	(&hba[i]->lock)

Added: dists/sid/linux-2.6/debian/patches/bugfix/cciss-e500-fwbug-workaround.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/cciss-e500-fwbug-workaround.patch	Tue Dec 19 20:04:57 2006
@@ -0,0 +1,37 @@
+From: Mike Miller <mike.miller at hp.com>
+Date: Thu, 7 Dec 2006 04:35:03 +0000 (-0800)
+Subject: [PATCH] cciss: fix pci ssid for the E500 controller
+X-Git-Tag: v2.6.20-rc1
+X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=de9239167158c0210c5b9a709d67cea1b6f8ae56
+
+[PATCH] cciss: fix pci ssid for the E500 controller
+
+Change the SSID on the E500 as a workaround for a firmware bug.  It looks like
+the original patch was backed out between rc2 and rc4.
+
+Signed-off-by: Mike Miller <mike.miller at hp.com>
+Acked-by: Jens Axboe <jens.axboe at oracle.com>
+Signed-off-by: Andrew Morton <akpm at osdl.org>
+Signed-off-by: Linus Torvalds <torvalds at osdl.org>
+---
+
+--- a/drivers/block/cciss.c
++++ b/drivers/block/cciss.c
+@@ -82,7 +82,7 @@ static const struct pci_device_id cciss_
+ 	{PCI_VENDOR_ID_HP,     PCI_DEVICE_ID_HP_CISSD,     0x103C, 0x3213},
+ 	{PCI_VENDOR_ID_HP,     PCI_DEVICE_ID_HP_CISSD,     0x103C, 0x3214},
+ 	{PCI_VENDOR_ID_HP,     PCI_DEVICE_ID_HP_CISSD,     0x103C, 0x3215},
+-	{PCI_VENDOR_ID_HP,     PCI_DEVICE_ID_HP_CISSC,     0x103C, 0x3233},
++	{PCI_VENDOR_ID_HP,     PCI_DEVICE_ID_HP_CISSC,     0x103C, 0x3237},
+ 	{PCI_VENDOR_ID_HP,     PCI_ANY_ID,	PCI_ANY_ID, PCI_ANY_ID,
+ 		PCI_CLASS_STORAGE_RAID << 8, 0xffff << 8, 0},
+ 	{0,}
+@@ -114,7 +114,7 @@ static struct board_type products[] = {
+ 	{0x3213103C, "Smart Array E200i", &SA5_access, 120},
+ 	{0x3214103C, "Smart Array E200i", &SA5_access, 120},
+ 	{0x3215103C, "Smart Array E200i", &SA5_access, 120},
+-	{0x3233103C, "Smart Array E500", &SA5_access, 512},
++	{0x3237103C, "Smart Array E500", &SA5_access, 512},
+ 	{0xFFFF103C, "Unknown Smart Array", &SA5_access, 120},
+ };
+ 

Added: dists/sid/linux-2.6/debian/patches/bugfix/cciss-increase-blk_queue_max_sectors.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/cciss-increase-blk_queue_max_sectors.patch	Tue Dec 19 20:04:57 2006
@@ -0,0 +1,77 @@
+From: Mike Miller <mike.miller at hp.com>
+Date: Thu, 7 Dec 2006 04:35:06 +0000 (-0800)
+Subject: [PATCH] cciss: set sector_size to 2048 for performance
+X-Git-Tag: v2.6.20-rc1
+X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=92c4231aef720bd5e1d634d2f7335f31277318da
+
+[PATCH] cciss: set sector_size to 2048 for performance
+
+Change the blk_queue_max_sectors from 512 to 2048.  This helps increase
+performance.
+
+[akpm at osdl.org: s/sector_size/max_sectors/]
+Signed-off-by: Mike Miller <mike.miller at hp.com>
+Cc: Jens Axboe <jens.axboe at oracle.com>
+Signed-off-by: Andrew Morton <akpm at osdl.org>
+Signed-off-by: Linus Torvalds <torvalds at osdl.org>
+---
+
+--- a/drivers/block/cciss.c
++++ b/drivers/block/cciss.c
+@@ -269,6 +269,7 @@ static int cciss_proc_get_info(char *buf
+ 		       "Firmware Version: %c%c%c%c\n"
+ 		       "IRQ: %d\n"
+ 		       "Logical drives: %d\n"
++		       "Max sectors: %d\n"
+ 		       "Current Q depth: %d\n"
+ 		       "Current # commands on controller: %d\n"
+ 		       "Max Q depth since init: %d\n"
+@@ -279,7 +280,9 @@ static int cciss_proc_get_info(char *buf
+ 		       (unsigned long)h->board_id,
+ 		       h->firm_ver[0], h->firm_ver[1], h->firm_ver[2],
+ 		       h->firm_ver[3], (unsigned int)h->intr[SIMPLE_MODE_INT],
+-		       h->num_luns, h->Qdepth, h->commands_outstanding,
++		       h->num_luns,
++		       h->cciss_max_sectors,
++		       h->Qdepth, h->commands_outstanding,
+ 		       h->maxQsinceinit, h->max_outstanding, h->maxSG);
+ 
+ 	pos += size;
+@@ -1395,7 +1398,7 @@ static void cciss_update_drive_info(int 
+ 		/* This is a limit in the driver and could be eliminated. */
+ 		blk_queue_max_phys_segments(disk->queue, MAXSGENTRIES);
+ 
+-		blk_queue_max_sectors(disk->queue, 512);
++		blk_queue_max_sectors(disk->queue, h->cciss_max_sectors);
+ 
+ 		blk_queue_softirq_done(disk->queue, cciss_softirq_done);
+ 
+@@ -3347,6 +3350,9 @@ static int __devinit cciss_init_one(stru
+ 	hba[i]->access.set_intr_mask(hba[i], CCISS_INTR_ON);
+ 
+ 	cciss_procinit(i);
++
++	hba[i]->cciss_max_sectors = 2048;
++
+ 	hba[i]->busy_initializing = 0;
+ 
+ 	for (j = 0; j < NWD; j++) {	/* mfm */
+@@ -3371,7 +3377,7 @@ static int __devinit cciss_init_one(stru
+ 		/* This is a limit in the driver and could be eliminated. */
+ 		blk_queue_max_phys_segments(q, MAXSGENTRIES);
+ 
+-		blk_queue_max_sectors(q, 512);
++		blk_queue_max_sectors(q, hba[i]->cciss_max_sectors);
+ 
+ 		blk_queue_softirq_done(q, cciss_softirq_done);
+ 
+--- a/drivers/block/cciss.h
++++ b/drivers/block/cciss.h
+@@ -77,6 +77,7 @@ struct ctlr_info 
+ 	unsigned int intr[4];
+ 	unsigned int msix_vector;
+ 	unsigned int msi_vector;
++	int 	cciss_max_sectors;
+ 	BYTE	cciss_read;
+ 	BYTE	cciss_write;
+ 	BYTE	cciss_read_capacity;

Added: dists/sid/linux-2.6/debian/patches/bugfix/cciss-map-more-config-table-mem.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/cciss-map-more-config-table-mem.patch	Tue Dec 19 20:04:57 2006
@@ -0,0 +1,27 @@
+From: mike.miller at hp.com <mike.miller at hp.com>
+Date: Wed, 13 Dec 2006 12:08:56 +0000 (+0100)
+Subject: [PATCH 1/2] cciss: map out more memory for config table
+X-Git-Tag: v2.6.20-rc1
+X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=98040015bc5d6cea3bd2dcb642fe1e8c4bded8e1
+
+[PATCH 1/2] cciss: map out more memory for config table
+
+This patch maps out more memory for our config table. It's required to reach
+offset 0x214 to disable DMA on the P600. I'm not sure how I lost this hunk.
+Please consider this for inclusion.
+
+Signed-off-by: Mike Miller <mike.miller at hp.com>
+Signed-off-by: Jens Axboe <jens.axboe at oracle.com>
+---
+
+--- a/drivers/block/cciss.c
++++ b/drivers/block/cciss.c
+@@ -2865,7 +2865,7 @@ static int cciss_pci_init(ctlr_info_t *c
+ #ifdef CCISS_DEBUG
+ 	printk("address 0 = %x\n", c->paddr);
+ #endif				/* CCISS_DEBUG */
+-	c->vaddr = remap_pci_mem(c->paddr, 200);
++	c->vaddr = remap_pci_mem(c->paddr, 0x250);
+ 
+ 	/* Wait for the board to become ready.  (PCI hotplug needs this.)
+ 	 * We poll for up to 120 secs, once per 100ms. */

Added: dists/sid/linux-2.6/debian/patches/bugfix/cciss-p600-asic-bug-disable-prefetch.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/cciss-p600-asic-bug-disable-prefetch.patch	Tue Dec 19 20:04:57 2006
@@ -0,0 +1,47 @@
+From: Mike Miller <mike.miller at hp.com>
+Date: Thu, 7 Dec 2006 04:35:04 +0000 (-0800)
+Subject: [PATCH] cciss: disable DMA prefetch on P600
+X-Git-Tag: v2.6.20-rc1
+X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=f92e2f5f889803306e50c06e17ee330403e91b8d
+
+[PATCH] cciss: disable DMA prefetch on P600
+
+Unconditionally disable DMA prefetch on the P600 controller.  An ASIC bug may
+result in prefetching beyond the end of physical memory.
+
+Signed-off-by: Mike Miller <mike.miller at hp.com>
+Acked-by: Jens Axboe <jens.axboe at oracle.com>
+Signed-off-by: Andrew Morton <akpm at osdl.org>
+Signed-off-by: Linus Torvalds <torvalds at osdl.org>
+---
+
+--- a/drivers/block/cciss.c
++++ b/drivers/block/cciss.c
+@@ -3003,6 +3003,17 @@ static int cciss_pci_init(ctlr_info_t *c
+ 	}
+ #endif
+ 
++	/* Disabling DMA prefetch for the P600
++	 * An ASIC bug may result in a prefetch beyond
++	 * physical memory.
++	 */
++	if(board_id == 0x3225103C) {
++		__u32 dma_prefetch;
++		dma_prefetch = readl(c->vaddr + I2O_DMA1_CFG);
++		dma_prefetch |= 0x8000;
++		writel(dma_prefetch, c->vaddr + I2O_DMA1_CFG);
++	}
++
+ #ifdef CCISS_DEBUG
+ 	printk("Trying to put board into Simple mode\n");
+ #endif				/* CCISS_DEBUG */
+--- a/drivers/block/cciss_cmd.h
++++ b/drivers/block/cciss_cmd.h
+@@ -55,6 +55,7 @@
+ #define I2O_INT_MASK            0x34
+ #define I2O_IBPOST_Q            0x40
+ #define I2O_OBPOST_Q            0x44
++#define I2O_DMA1_CFG		0x214
+ 
+ //Configuration Table
+ #define CFGTBL_ChangeReq        0x00000001l

Added: dists/sid/linux-2.6/debian/patches/bugfix/cciss-set-default-raid-level.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/cciss-set-default-raid-level.patch	Tue Dec 19 20:04:57 2006
@@ -0,0 +1,30 @@
+PATCH 1 of 2
+
+This patch sets a default raid level on a volume that either does not support
+reading the geometry or reports an invalid geometry for whatever reason. We
+were always setting some values for heads and sectors but never set a raid
+level. This caused lots of problems on some buggy firmware. Please consider
+this for inclusion.
+
+Thanks,
+mikem
+
+Signed-off-by: Mike Miller <mike.miller at hp.com>
+--------------------------------------------------------------------------------
+
+ drivers/block/cciss.c |    1 +
+ 1 files changed, 1 insertion(+)
+
+diff -puN drivers/block/cciss.c~cciss_set_default_raidlevel drivers/block/cciss.c
+--- linux-2.6-work/drivers/block/cciss.c~cciss_set_default_raidlevel	2006-12-13 11:04:39.000000000 -0600
++++ linux-2.6-work-mikem/drivers/block/cciss.c	2006-12-13 11:05:06.000000000 -0600
+@@ -1907,6 +1907,7 @@ static void cciss_geometry_inquiry(int c
+ 			       "does not support reading geometry\n");
+ 			drv->heads = 255;
+ 			drv->sectors = 32;	// Sectors per track
++			drv->raid_level = RAID_UNKNOWN;
+ 		} else {
+ 			drv->heads = inq_buff->data_byte[6];
+ 			drv->sectors = inq_buff->data_byte[7];
+_
+

Added: dists/sid/linux-2.6/debian/patches/bugfix/cciss-support-hp-raid-class-with-valid-sig.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/cciss-support-hp-raid-class-with-valid-sig.patch	Tue Dec 19 20:04:57 2006
@@ -0,0 +1,77 @@
+From: Mike Miller <mike.miller at hp.com>
+Date: Thu, 7 Dec 2006 04:35:00 +0000 (-0800)
+Subject: [PATCH] cciss: reference driver support
+X-Git-Tag: v2.6.20-rc1
+X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=4ff9a9a4baff2627d7bcf65d0ec07d647bc1ad29
+
+[PATCH] cciss: reference driver support
+
+Add the support to fire up on any HP RAID class device that has a valid cciss
+signature.
+
+Signed-off-by: Mike Miller <mike.miller at hp.com>
+Acked-by: Jens Axboe <jens.axboe at oracle.com>
+Signed-off-by: Andrew Morton <akpm at osdl.org>
+Signed-off-by: Linus Torvalds <torvalds at osdl.org>
+---
+
+--- a/drivers/block/cciss.c
++++ b/drivers/block/cciss.c
+@@ -83,6 +83,8 @@ static const struct pci_device_id cciss_
+ 	{PCI_VENDOR_ID_HP,     PCI_DEVICE_ID_HP_CISSD,     0x103C, 0x3214},
+ 	{PCI_VENDOR_ID_HP,     PCI_DEVICE_ID_HP_CISSD,     0x103C, 0x3215},
+ 	{PCI_VENDOR_ID_HP,     PCI_DEVICE_ID_HP_CISSC,     0x103C, 0x3233},
++	{PCI_VENDOR_ID_HP,     PCI_ANY_ID,	PCI_ANY_ID, PCI_ANY_ID,
++		PCI_CLASS_STORAGE_RAID << 8, 0xffff << 8, 0},
+ 	{0,}
+ };
+ 
+@@ -112,6 +114,7 @@ static struct board_type products[] = {
+ 	{0x3214103C, "Smart Array E200i", &SA5_access},
+ 	{0x3215103C, "Smart Array E200i", &SA5_access},
+ 	{0x3233103C, "Smart Array E500", &SA5_access},
++	{0xFFFF103C, "Unknown Smart Array", &SA5_access},
+ };
+ 
+ /* How long to wait (in milliseconds) for board to go into simple mode */
+@@ -2960,13 +2963,6 @@ static int cciss_pci_init(ctlr_info_t *c
+ 			break;
+ 		}
+ 	}
+-	if (i == ARRAY_SIZE(products)) {
+-		printk(KERN_WARNING "cciss: Sorry, I don't know how"
+-		       " to access the Smart Array controller %08lx\n",
+-		       (unsigned long)board_id);
+-		err = -ENODEV;
+-		goto err_out_free_res;
+-	}
+ 	if ((readb(&c->cfgtable->Signature[0]) != 'C') ||
+ 	    (readb(&c->cfgtable->Signature[1]) != 'I') ||
+ 	    (readb(&c->cfgtable->Signature[2]) != 'S') ||
+@@ -2975,6 +2971,26 @@ static int cciss_pci_init(ctlr_info_t *c
+ 		err = -ENODEV;
+ 		goto err_out_free_res;
+ 	}
++	/* We didn't find the controller in our list. We know the
++	 * signature is valid. If it's an HP device let's try to
++	 * bind to the device and fire it up. Otherwise we bail.
++	 */
++	if (i == ARRAY_SIZE(products)) {
++		if (subsystem_vendor_id == PCI_VENDOR_ID_HP) {
++			c->product_name = products[i-1].product_name;
++			c->access = *(products[i-1].access);
++			printk(KERN_WARNING "cciss: This is an unknown "
++				"Smart Array controller.\n"
++				"cciss: Please update to the latest driver "
++				"available from www.hp.com.\n");
++		} else {
++			printk(KERN_WARNING "cciss: Sorry, I don't know how"
++				" to access the Smart Array controller %08lx\n"
++					, (unsigned long)board_id);
++			err = -ENODEV;
++			goto err_out_free_res;
++		}
++	}
+ #ifdef CONFIG_X86
+ 	{
+ 		/* Need to enable prefetch in the SCSI core for 6400 in x86 */

Modified: dists/sid/linux-2.6/debian/patches/series/9
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/9	(original)
+++ dists/sid/linux-2.6/debian/patches/series/9	Tue Dec 19 20:04:57 2006
@@ -3,3 +3,13 @@
 + bugfix/ip6_tables-protocol-bypass-bug.patch
 + bugfix/ip6_tables-extension-header-bypass-bug.patch
 + bugfix/libata-handle-0xff-status-properly.patch
++ bugfix/cciss-1TB-disc-bug.patch
++ bugfix/cciss-support-hp-raid-class-with-valid-sig.patch
++ bugfix/cciss-define-NR_CMDS-per-controller.patch
++ bugfix/cciss-e500-fwbug-workaround.patch
++ bugfix/cciss-p600-asic-bug-disable-prefetch.patch
++ bugfix/cciss-increase-blk_queue_max_sectors.patch
++ bugfix/cciss-map-more-config-table-mem.patch
++ bugfix/cciss-set-default-raid-level.patch
++ bugfix/cciss-XFER_READ-WRITE.patch
+



More information about the Kernel-svn-changes mailing list