r1303 - in trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian: . patches

Christoph Hellwig hch-guest@haydn.debian.org
Wed, 25 Aug 2004 04:18:28 -0600


Author: hch-guest
Date: 2004-08-25 04:18:06 -0600 (Wed, 25 Aug 2004)
New Revision: 1303

Added:
   trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/cciss-update.dpatch
Modified:
   trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/changelog
   trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/00list-3
Log:

  * Update CCISS driver (Christoph Hellwig).



Modified: trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/changelog
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/changelog	2004-08-25 10:08:38 UTC (rev 1302)
+++ trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/changelog	2004-08-25 10:18:06 UTC (rev 1303)
@@ -32,6 +32,8 @@
   * Update list of safe SCSI commands for SG_IO to match 2.6.9-rc1
     (Christoph Hellwig).
 
+  * Update CCISS driver (Christoph Hellwig).
+
  -- Andres Salomon <dilinger@voxel.net>  Wed, 18 Aug 2004 02:13:56 -0400
 
 kernel-source-2.6.8 (2.6.8-2) unstable; urgency=high

Modified: trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/00list-3
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/00list-3	2004-08-25 10:08:38 UTC (rev 1302)
+++ trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/00list-3	2004-08-25 10:18:06 UTC (rev 1303)
@@ -38,3 +38,4 @@
 pmac-no-of-stdout
 net-sched-fix
 drivers-scsi-sym_2-dv-hang
+cciss-update

Added: trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/cciss-update.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/cciss-update.dpatch	2004-08-25 10:08:38 UTC (rev 1302)
+++ trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/cciss-update.dpatch	2004-08-25 10:18:06 UTC (rev 1303)
@@ -0,0 +1,404 @@
+#! /bin/sh -e 
+## <PATCHNAME>.dpatch by <PATCH_AUTHOR@EMAI>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Description: Update CCISS driver
+## DP: Patch author: Mike Miller <mike.miller@hp.com>
+## DP: Upstream status: backport
+
+. $(dirname $0)/DPATCH
+
+@DPATCH@
+# This is a BitKeeper generated diff -Nru style patch.
+#
+# ChangeSet
+#   2004/08/23 13:09:03-07:00 bunk@fs.tum.de 
+#   [PATCH] cciss /proc dependency fix
+#   
+#   cciss uses /proc to hook into the SCSI subsystem.  If you do not build
+#   /proc support into your kernel then you should also disable tape support in
+#   the driver. 
+#   
+#   Signed-off-by: Adrian Bunk <bunk@fs.tum.de>
+#   Signed-off-by: Andrew Morton <akpm@osdl.org>
+#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
+# 
+# drivers/block/Kconfig
+#   2004/08/23 01:15:29-07:00 bunk@fs.tum.de +1 -1
+#   cciss /proc dependency fix
+# 
+# ChangeSet
+#   2004/08/23 13:08:51-07:00 mike.miller@hp.com 
+#   [PATCH] cciss update 8 maintainers update for HP
+#   
+#   This patch updates the maintainers list for HP drivers.
+#   
+#   Signed-off-by: Andrew Morton <akpm@osdl.org>
+#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
+# 
+# MAINTAINERS
+#   2004/08/23 01:15:28-07:00 mike.miller@hp.com +5 -5
+#   cciss update 8 maintainers update for HP
+# 
+# ChangeSet
+#   2004/08/23 13:08:39-07:00 mike.miller@hp.com 
+#   [PATCH] cciss: read_ahead bumped to 1024
+#   
+#   This patch changes our read_ahead to 1024.  This has been shown to increase
+#   performance.
+#   
+#   Signed-off-by: Andrew Morton <akpm@osdl.org>
+#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
+# 
+# drivers/block/cciss.c
+#   2004/08/23 01:15:28-07:00 mike.miller@hp.com +1 -1
+#   cciss: read_ahead bumped to 1024
+# 
+# ChangeSet
+#   2004/08/23 13:08:30-07:00 mike.miller@hp.com 
+#   [PATCH] cciss: pdev->intr fix
+#   
+#   This patch fixes our usage of pdev->intr.  We were truncating it to an unchar.
+#    We were also reading it before calling pci_enable_device.  This patch fixes
+#   both of those.  Thanks to Bjorn Helgaas for the patch.
+#   
+#   Signed-off-by: Andrew Morton <akpm@osdl.org>
+#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
+# 
+# drivers/block/cciss.h
+#   2004/08/23 01:15:28-07:00 mike.miller@hp.com +1 -1
+#   cciss: pdev->intr fix
+# 
+# drivers/block/cciss.c
+#   2004/08/23 01:15:28-07:00 mike.miller@hp.com +2 -3
+#   cciss: pdev->intr fix
+# 
+# ChangeSet
+#   2004/08/23 13:08:19-07:00 mikem@beardog.cca.cpqcorp.net 
+#   [PATCH] cciss: V100 PCI ID fix again
+#   
+#   Somehow I managed to get the wrong PCI ID in pci_ids.h.  3210 is the
+#   correct PCI ID, 3211 is the subsystem ID.
+#   
+#   Signed-off-by: Andrew Morton <akpm@osdl.org>
+#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
+# 
+# include/linux/pci_ids.h
+#   2004/08/23 01:15:28-07:00 mikem@beardog.cca.cpqcorp.net +1 -1
+#   cciss: V100 PCI ID fix again
+# 
+# ChangeSet
+#   2004/08/23 13:08:07-07:00 mike.miller@hp.com 
+#   [PATCH] cciss: id change for V100 controller
+#   
+#   This patch fixes the vendor ID for our cciss based SATA controller due out
+#   later this year and adds the new PCI ID to pci_ids.h.
+#   
+#   Also changes DRIVER_NAME to HP CCISS.
+#   
+#   Signed-off-by: Andrew Morton <akpm@osdl.org>
+#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
+# 
+# include/linux/pci_ids.h
+#   2004/08/23 01:15:28-07:00 mike.miller@hp.com +1 -0
+#   cciss: id change for V100 controller
+# 
+# drivers/block/cciss.c
+#   2004/08/23 01:15:28-07:00 mike.miller@hp.com +3 -3
+#   cciss: id change for V100 controller
+# 
+# ChangeSet
+#   2004/08/23 13:07:56-07:00 mike.miller@hp.com 
+#   [PATCH] cciss: cylinder calculation fix
+#   
+#   This patch fixes our cylinder calculations.  Without his fix the number of
+#   cylinders maxes out at 65535.
+#   
+#   Signed-off-by: Andrew Morton <akpm@osdl.org>
+#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
+# 
+# drivers/block/cciss.c
+#   2004/08/23 01:15:27-07:00 mike.miller@hp.com +6 -0
+#   cciss: cylinder calculation fix
+# 
+# ChangeSet
+#   2004/08/23 13:07:44-07:00 mike.miller@hp.com 
+#   [PATCH] cciss: /proc fixes
+#   
+#   This patch fixes our output in /proc to display the logical volume sizes and
+#   RAID levels correctly.  Without this patch RAID level will always be 0 and
+#   size may be displayed as 0GB.
+#   
+#   Signed-off-by: Andrew Morton <akpm@osdl.org>
+#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
+# 
+# drivers/block/cciss.c
+#   2004/08/23 01:15:27-07:00 mike.miller@hp.com +8 -18
+#   cciss: /proc fixes
+# 
+# ChangeSet
+#   2004/08/23 13:07:33-07:00 mike.miller@hp.com 
+#   [PATCH] cciss: zero out buffer in passthru ioctls for HP utilities
+#   
+#   This patch addresses a problem with our utilities.  We must zero out the
+#   buffer before copying their data into it to prevent bogus info when switching
+#   between SCSI & SATA or SAS drives.
+#   
+#   Signed-off-by: Andrew Morton <akpm@osdl.org>
+#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
+# 
+# drivers/block/cciss.c
+#   2004/08/23 01:15:27-07:00 mike.miller@hp.com +4 -0
+#   cciss: zero out buffer in passthru ioctls for HP utilities
+# 
+# ChangeSet
+#   2004/08/23 13:07:21-07:00 mike.miller@hp.com 
+#   [PATCH] cciss: fixes to 32/64-bit conversions
+#   
+#   This patch fixes our usage of copy_to_user.  We were passing in the size of
+#   the address rather than the size of the struct.
+#   
+#   Signed-off-by: Andrew Morton <akpm@osdl.org>
+#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
+# 
+# drivers/block/cciss.c
+#   2004/08/23 01:15:27-07:00 mike.miller@hp.com +2 -2
+#   cciss: fixes to 32/64-bit conversions
+# 
+diff -Nru a/MAINTAINERS b/MAINTAINERS
+--- a/MAINTAINERS	2004-08-25 12:16:15 +02:00
++++ b/MAINTAINERS	2004-08-25 12:16:15 +02:00
+@@ -910,18 +910,18 @@
+ S:	Maintained
+ 
+ HEWLETT-PACKARD FIBRE CHANNEL 64-bit/66MHz PCI non-intelligent HBA
+-P:	Chase Maupin
+-M:	chase.maupin@hp.com
++P:	Chirag Kantharia
++M:	chirag.kantharia@hp.com
+ L:	iss_storagedev@hp.com
+ S:	Maintained
+  
+ HEWLETT-PACKARD SMART2 RAID DRIVER
+-P:	Francis Wiran
+-M:	francis.wiran@hp.com
++P:	Chirag Kantharia
++M:	chirag.kantharia@hp.com
+ L:	iss_storagedev@hp.com
+ S:	Maintained
+  
+-HEWLETT-PACKARD SMART CISS RAID DRIVER 
++HEWLETT-PACKARD SMART CISS RAID DRIVER (cciss)
+ P:	Mike Miller
+ M:	mike.miller@hp.com
+ L:	iss_storagedev@hp.com
+diff -Nru a/drivers/block/Kconfig b/drivers/block/Kconfig
+--- a/drivers/block/Kconfig	2004-08-25 12:16:15 +02:00
++++ b/drivers/block/Kconfig	2004-08-25 12:16:15 +02:00
+@@ -166,7 +166,7 @@
+ 
+ config CISS_SCSI_TAPE
+ 	bool "SCSI tape drive support for Smart Array 5xxx"
+-	depends on BLK_CPQ_CISS_DA && SCSI
++	depends on BLK_CPQ_CISS_DA && SCSI && PROC_FS
+ 	help
+ 	  When enabled (Y), this option allows SCSI tape drives and SCSI medium
+ 	  changers (tape robots) to be accessed via a Compaq 5xxx array 
+diff -Nru a/drivers/block/cciss.c b/drivers/block/cciss.c
+--- a/drivers/block/cciss.c	2004-08-25 12:16:15 +02:00
++++ b/drivers/block/cciss.c	2004-08-25 12:16:15 +02:00
+@@ -46,14 +46,14 @@
+ #include <linux/completion.h>
+ 
+ #define CCISS_DRIVER_VERSION(maj,min,submin) ((maj<<16)|(min<<8)|(submin))
+-#define DRIVER_NAME "Compaq CISS Driver (v 2.6.2)"
++#define DRIVER_NAME "HP CISS Driver (v 2.6.2)"
+ #define DRIVER_VERSION CCISS_DRIVER_VERSION(2,6,2)
+ 
+ /* Embedded module documentation macros - see modules.h */
+ MODULE_AUTHOR("Hewlett-Packard Company");
+ MODULE_DESCRIPTION("Driver for HP Controller SA5xxx SA6xxx version 2.6.2");
+ MODULE_SUPPORTED_DEVICE("HP SA5i SA5i+ SA532 SA5300 SA5312 SA641 SA642 SA6400"
+-			" SA6i");
++			" SA6i V100");
+ MODULE_LICENSE("GPL");
+ 
+ #include "cciss_cmd.h"
+@@ -82,7 +82,7 @@
+ 		0x0E11, 0x4091, 0, 0, 0},
+ 	{ PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_CISSC,
+ 		0x0E11, 0x409E, 0, 0, 0},
+-	{ PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_CISSC,
++	{ PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISS,
+ 		0x103C, 0x3211, 0, 0, 0},
+ 	{0,}
+ };
+@@ -115,7 +115,7 @@
+ /*define how many times we will try a command because of bus resets */
+ #define MAX_CMD_RETRIES 3
+ 
+-#define READ_AHEAD 	 256
++#define READ_AHEAD 	 1024
+ #define NR_CMDS		 384 /* #commands that can be outstanding */
+ #define MAX_CTLR 8
+ 
+@@ -192,10 +192,10 @@
+ /*
+  * Report information about this controller.
+  */
+-#define ENG_GIG 1048576000
++#define ENG_GIG 1000000000
+ #define ENG_GIG_FACTOR (ENG_GIG/512)
+ #define RAID_UNKNOWN 6
+-static const char *raid_label[] = {"0","4","1(0+1)","5","5+1","ADG",
++static const char *raid_label[] = {"0","4","1(1+0)","5","5+1","ADG",
+ 	                                   "UNKNOWN"};
+ 
+ static struct proc_dir_entry *proc_cciss;
+@@ -209,7 +209,7 @@
+         ctlr_info_t *h = (ctlr_info_t*)data;
+         drive_info_struct *drv;
+ 	unsigned long flags;
+-	unsigned int vol_sz, vol_sz_frac;
++        sector_t vol_sz, vol_sz_frac;
+ 
+         ctlr = h->ctlr;
+ 
+@@ -246,32 +246,21 @@
+         pos += size; len += size;
+ 	cciss_proc_tape_report(ctlr, buffer, &pos, &len);
+ 	for(i=0; i<=h->highest_lun; i++) {
+-		sector_t tmp;
+ 
+                 drv = &h->drv[i];
+ 		if (drv->block_size == 0)
+ 			continue;
+-		vol_sz = drv->nr_blocks;
+-		sector_div(vol_sz, ENG_GIG_FACTOR);
+-
+-		/*
+-		 * Awkwardly do this:
+-		 * vol_sz_frac =
+-		 *     (drv->nr_blocks%ENG_GIG_FACTOR)*100/ENG_GIG_FACTOR;
+-		 */
+-		tmp = drv->nr_blocks;
+-		vol_sz_frac = sector_div(tmp, ENG_GIG_FACTOR);
+-
+-		/* Now, vol_sz_frac = (drv->nr_blocks%ENG_GIG_FACTOR) */
+ 
++		vol_sz = drv->nr_blocks;
++		vol_sz_frac = sector_div(vol_sz, ENG_GIG_FACTOR);
+ 		vol_sz_frac *= 100;
+ 		sector_div(vol_sz_frac, ENG_GIG_FACTOR);
+ 
+ 		if (drv->raid_level > 5)
+ 			drv->raid_level = RAID_UNKNOWN;
+ 		size = sprintf(buffer+len, "cciss/c%dd%d:"
+-				"\t%4d.%02dGB\tRAID %s\n",
+-				ctlr, i, vol_sz,vol_sz_frac,
++				"\t%4u.%02uGB\tRAID %s\n",
++				ctlr, i, (int)vol_sz, (int)vol_sz_frac,
+ 				raid_label[drv->raid_level]);
+                 pos += size; len += size;
+         }
+@@ -578,7 +567,7 @@
+ 	err = sys_ioctl(fd, CCISS_PASSTHRU, (unsigned long) p);
+ 	if (err)
+ 		return err;
+-	err |= copy_in_user(&arg32->error_info, &p->error_info, sizeof(&arg32->error_info));
++	err |= copy_in_user(&arg32->error_info, &p->error_info, sizeof(arg32->error_info));
+ 	if (err)
+ 		return -EFAULT;
+ 	return err;
+@@ -610,7 +599,7 @@
+ 	err = sys_ioctl(fd, CCISS_BIG_PASSTHRU, (unsigned long) p);
+ 	if (err)
+ 		return err;
+-	err |= copy_in_user(&arg32->error_info, &p->error_info, sizeof(&arg32->error_info));
++	err |= copy_in_user(&arg32->error_info, &p->error_info, sizeof(arg32->error_info));
+ 	if (err)
+ 		return -EFAULT;
+ 	return err;
+@@ -866,6 +855,8 @@
+ 				kfree(buff);
+ 				return -EFAULT;
+ 			}
++		} else {
++			memset(buff, 0, iocommand.buf_size);
+ 		}
+ 		if ((c = cmd_alloc(host , 0)) == NULL)
+ 		{
+@@ -1012,6 +1003,8 @@
+ 				copy_from_user(buff[sg_used], data_ptr, sz)) {
+ 					status = -ENOMEM;
+ 					goto cleanup1;			
++			} else {
++				memset(buff[sg_used], 0, sz);
+ 			}
+ 			left -= sz;
+ 			data_ptr += sz;
+@@ -1477,12 +1470,19 @@
+ 			drv->sectors = 32; // Sectors per track
+ 			drv->cylinders = total_size / 255 / 32;
+ 		} else {
++			unsigned int t;
++
+ 			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/t;
++			}
+ 		}
+ 	} else { /* Get geometry failed */
+ 		printk(KERN_WARNING "cciss: reading geometry failed, "
+@@ -2300,7 +2300,6 @@
+ static int cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev)
+ {
+ 	ushort subsystem_vendor_id, subsystem_device_id, command;
+-	unchar irq = pdev->irq;
+ 	__u32 board_id, scratchpad = 0;
+ 	__u64 cfg_offset;
+ 	__u32 cfg_base_addr;
+@@ -2359,11 +2358,11 @@
+ 
+ #ifdef CCISS_DEBUG
+ 	printk("command = %x\n", command);
+-	printk("irq = %x\n", irq);
++	printk("irq = %x\n", pdev->irq);
+ 	printk("board_id = %x\n", board_id);
+ #endif /* CCISS_DEBUG */ 
+ 
+-	c->intr = irq;
++	c->intr = pdev->irq;
+ 
+ 	/*
+ 	 * Memory base addr is first addr , the second points to the config
+diff -Nru a/drivers/block/cciss.h b/drivers/block/cciss.h
+--- a/drivers/block/cciss.h	2004-08-25 12:16:15 +02:00
++++ b/drivers/block/cciss.h	2004-08-25 12:16:15 +02:00
+@@ -48,7 +48,7 @@
+ 	unsigned long io_mem_addr;
+ 	unsigned long io_mem_length;
+ 	CfgTable_struct *cfgtable;
+-	int	intr;
++	unsigned int intr;
+ 	int	interrupts_enabled;
+ 	int 	max_commands;
+ 	int	commands_outstanding;
+diff -Nru a/include/linux/pci_ids.h b/include/linux/pci_ids.h
+--- a/include/linux/pci_ids.h	2004-08-25 12:16:15 +02:00
++++ b/include/linux/pci_ids.h	2004-08-25 12:16:15 +02:00
+@@ -675,6 +675,7 @@
+ #define PCI_DEVICE_ID_HP_SX1000_IOC	0x127c
+ #define PCI_DEVICE_ID_HP_DIVA_EVEREST	0x1282
+ #define PCI_DEVICE_ID_HP_DIVA_AUX	0x1290
++#define PCI_DEVICE_ID_HP_CISS		0x3210
+ 
+ #define PCI_VENDOR_ID_PCTECH		0x1042
+ #define PCI_DEVICE_ID_PCTECH_RZ1000	0x1000