* cciss updates for 2.6 [6 of 11]
@ 2004-02-05 0:14 mikem
0 siblings, 0 replies; only message in thread
From: mikem @ 2004-02-05 0:14 UTC (permalink / raw)
To: akpm, axboe; +Cc: linux-kernel
Patch 6 of 11.
This patch moves the check of the controller to before trying to enable
it. If a controller is disabled the system will Oops without this fix.
This in the 2.4 tree.
--------------------------------------------------------------------------------------
diff -burN lx261-p005/drivers/block/cciss.c lx261/drivers/block/cciss.c
--- lx261-p005/drivers/block/cciss.c 2004-01-22 14:10:20.000000000 -0600
+++ lx261/drivers/block/cciss.c 2004-01-22 15:20:16.000000000 -0600
@@ -2130,6 +2130,15 @@
__u64 cfg_base_addr_index;
int i;
+ /* check to see if controller has been disabled */
+ /* BEFORE trying 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");
@@ -2145,7 +2154,6 @@
device_id = pdev->device;
irq = pdev->irq;
- (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);
@@ -2154,13 +2162,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++)
{
Thanks,
mikem
mike.miller@hp.com
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-02-05 0:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-05 0:14 cciss updates for 2.6 [6 of 11] mikem
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).