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

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


-----Original Message-----
From: Miller, Mike (OS Dev)
Sent: Thursday, July 10, 2003 4:55 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 [6 of 6]

This is the 6th of 6 updates for cciss. Apply this patch AFTER applying the 5th of 6.

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: p2_cciss_2447_pci_read_fixes_for_lx2422p3.patch
Changes:
1. Reduces reading directly from PCI config space. Most of the
info we require is already in the pci_dev struct (except the
command register). Request from Redhat.
2. Miscellaneous code cleanup, remove some debug printk()'s, etc.
Caveats:
This patch and p1_cciss_2448_pci_enable_fix_for_lx2422p3.patch
both touch code very close to each other. Apply
p1_cciss_2448_pci_enable_fix_for_lx2422p3.patch first, then apply
this 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 16:25:53.000000000 -0500
+++ lx2422p3/drivers/block/cciss.c 2003-07-07 16:35:35.000000000 -0500
@@ -2474,19 +2474,14 @@

static int cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev)
{
- ushort vendor_id, device_id, command;
- unchar cache_line_size, latency_timer;
- unchar irq, revision;
+ ushort subsystem_vendor_id, subsystem_device_id, command;
+ unchar irq = pdev->irq;
__u32 board_id;
__u64 cfg_offset;
__u32 cfg_base_addr;
__u64 cfg_base_addr_index;
int i;

- vendor_id = pdev->vendor;
- 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);
@@ -2503,14 +2498,11 @@
return -1;
}

- (void) pci_read_config_byte(pdev, PCI_CLASS_REVISION, &revision);
- (void) pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE,
- &cache_line_size);
- (void) pci_read_config_byte(pdev, PCI_LATENCY_TIMER,
- &latency_timer);
+ subsystem_vendor_id = pdev->subsystem_vendor;
+ subsystem_device_id = pdev->subsystem_device;
+ board_id = (((__u32) (subsystem_device_id << 16) & 0xffff0000) |
+ subsystem_vendor_id );

- (void) pci_read_config_dword(pdev, PCI_SUBSYSTEM_VENDOR_ID,
- &board_id);

/* search for our IO range so we can protect it */
for (i=0; i<DEVICE_COUNT_RESOURCE; i++) {
@@ -2538,15 +2530,8 @@
}

#ifdef CCISS_DEBUG
- printk("vendor_id = %x\n", vendor_id);
- printk("device_id = %x\n", device_id);
printk("command = %x\n", command);
- for(i=0; i<6; i++)
- printk("addr[%d] = %x\n", i, pci_resource_start(pdev, i);
- printk("revision = %x\n", revision);
printk("irq = %x\n", irq);
- printk("cache_line_size = %x\n", cache_line_size);
- printk("latency_timer = %x\n", latency_timer);
printk("board_id = %x\n", board_id);
#endif /* CCISS_DEBUG */
-
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/