FW: cciss updates for 2.4.22-pre3 [5 of 6]

Miller, Mike (mike.miller@hp.com)
Thu, 10 Jul 2003 17:00:40 -0500


-----Original Message-----
From: Miller, Mike (OS Dev)
Sent: Thursday, July 10, 2003 4:53 PM
To: 'axboe@suse.de'; 'marcelo@conectiva.com.br'
Cc: 'alan@lxorguk.ukuu.org.uk'; 'linuxkernel@vger.kernel.org'
Subject: cciss updates for 2.4.22-pre3 [5 of 6]

This is the 5th of 6 updates. Apply this patch before applying the 6th patch.

This patch was built & tested using kernel 2.4.21 with the 2.4.22pre3 patch
applied. It is intended for inclusion in the 2.4.22 kernel. Note the caveat
below.
Patch name: p1_cciss_2447_pci_enable_fix_for_lx2422p3.patch
Changes:
1. Checks the command register BEFORE trying to enable the controller.
If the controller was disabled via the ROM Based Setup Utility or
the System Configuration Utility the driver may Oops while loading.
Bug fix.
Caveats:
This patch and p2_cciss_2448_pci_read_fixes_for_lx2422p3.patch both
touch code very close to each other. Apply this patch first, then apply
p2_cciss_2448_pci_read_fixes_lx2422p3.patch. Otherwise, they may not
patch cleanly.
--------------------------------------------------------------------------------------------------------------------
diff -burN lx2422p3.test/drivers/block/cciss.c lx2422p3/drivers/block/cciss.c
--- lx2422p3.test/drivers/block/cciss.c 2003-07-07 14:51:32.000000000 -0500
+++ lx2422p3/drivers/block/cciss.c 2003-07-07 16:14:36.000000000 -0500
@@ -2487,6 +2487,13 @@
device_id = pdev->device;
irq = pdev->irq;

+ /* check to see if controller has been disabled */
+ /* BEFORE we try to enable it */
+ (void) pci_read_config_word(pdev, PCI_COMMAND,&command);
+ if (!(command & 0x02)) {
+ printk(KERN_WARNING "cciss: controller appears to be disabled\n");
+ return -1;
+ }
if (pci_enable_device(pdev)) {
printk(KERN_ERR "cciss: Unable to Enable PCI device\n");
return -1;
@@ -2496,7 +2503,6 @@
return -1;
}

- (void) pci_read_config_word(pdev, PCI_COMMAND,&command);
(void) pci_read_config_byte(pdev, PCI_CLASS_REVISION, &revision);
(void) pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE,
&cache_line_size);
@@ -2506,11 +2512,6 @@
(void) pci_read_config_dword(pdev, PCI_SUBSYSTEM_VENDOR_ID,
&board_id);

- /* check to see if controller has been disabled */
- if (!(command & 0x02)) {
- printk(KERN_WARNING "cciss: controller appears to be disabled\n");
- return -1;
- }
/* search for our IO range so we can protect it */
for (i=0; i<DEVICE_COUNT_RESOURCE; i++) {
/* is this an IO range */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/