linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* FW: cciss updates for 2.4.22-pre3  [5 of 6]
@ 2003-07-10 22:00 Miller, Mike (OS Dev)
  2003-07-10 22:20 ` Jeff Garzik
  0 siblings, 1 reply; 3+ messages in thread
From: Miller, Mike (OS Dev) @ 2003-07-10 22:00 UTC (permalink / raw)
  To: linux-kernel



-----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 */

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: FW: cciss updates for 2.4.22-pre3  [5 of 6]
  2003-07-10 22:00 FW: cciss updates for 2.4.22-pre3 [5 of 6] Miller, Mike (OS Dev)
@ 2003-07-10 22:20 ` Jeff Garzik
  2003-07-10 22:22   ` Jeff Garzik
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Garzik @ 2003-07-10 22:20 UTC (permalink / raw)
  To: Miller, Mike (OS Dev); +Cc: linux-kernel

Miller, Mike (OS Dev) wrote:
> @@ -2506,11 +2512,6 @@
>  	(void) pci_read_config_dword(pdev, PCI_SUBSYSTEM_VENDOR_ID, 
>  						&board_id);


This line _still_ needs to be removed.

Use the 'subsystem_vendor' and 'subsystem_device' members of struct 
pci_dev instead.

	Jeff




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: FW: cciss updates for 2.4.22-pre3  [5 of 6]
  2003-07-10 22:20 ` Jeff Garzik
@ 2003-07-10 22:22   ` Jeff Garzik
  0 siblings, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2003-07-10 22:22 UTC (permalink / raw)
  To: Miller, Mike (OS Dev); +Cc: linux-kernel

Jeff Garzik wrote:
> Miller, Mike (OS Dev) wrote:
> 
>> @@ -2506,11 +2512,6 @@
>>      (void) pci_read_config_dword(pdev, PCI_SUBSYSTEM_VENDOR_ID, 
>>                          &board_id);
> 
> 
> 
> This line _still_ needs to be removed.
> 
> Use the 'subsystem_vendor' and 'subsystem_device' members of struct 
> pci_dev instead.

LOL -- your final mail (patch 6) was delayed.

All good.

	Jeff




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-07-10 22:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-10 22:00 FW: cciss updates for 2.4.22-pre3 [5 of 6] Miller, Mike (OS Dev)
2003-07-10 22:20 ` Jeff Garzik
2003-07-10 22:22   ` Jeff Garzik

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).