
From: Alan Cox <alan@redhat.com>

In 2.4 the megaraid driver was careful to avoid stepping on wrong devices. 
Specifically the megaraid3 series devices used an intel pci ID (8086:1960)
which is the generic i960 identifier not their own.

The code to do this in 2.4 worked for almost all cases, but even that code has
mysteriously vanished in 2.6 meaning the megaraid driver trashes stuff like
promise i2o cards and compaq management cards.

The following patch puts back the 2.4 stuff + one additional check so that the
driver isn't quite as rude as it was before.


---

 25-akpm/drivers/scsi/megaraid.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+)

diff -puN drivers/scsi/megaraid.c~stop-megaraid-trashing-other-i960-based-devices drivers/scsi/megaraid.c
--- 25/drivers/scsi/megaraid.c~stop-megaraid-trashing-other-i960-based-devices	2004-05-22 18:58:05.490881264 -0700
+++ 25-akpm/drivers/scsi/megaraid.c	2004-05-22 18:59:10.189045648 -0700
@@ -4612,6 +4612,26 @@ megaraid_probe_one(struct pci_dev *pdev,
 	pci_dev_func = pdev->devfn;
 
 	/*
+	 * The megaraid3 stuff reports the ID of the Intel part which is not
+	 * remotely specific to the megaraid
+	 */
+	if (pdev->vendor == PCI_VENDOR_ID_INTEL) {
+		u16 magic;
+		/*
+		 * Don't fall over the Compaq management cards using the same
+		 * PCI identifier
+		 */
+		if (pdev->subsystem_vendor == PCI_VENDOR_ID_COMPAQ &&
+		    pdev->subsystem_device == 0xC000)
+		   	return -ENODEV;
+		/* Now check the magic signature byte */
+		pci_read_config_word(pdev, PCI_CONF_AMISIG, &magic);
+		if (magic != HBA_SIGNATURE_471 && magic != HBA_SIGNATURE)
+			return -ENODEV;
+		/* Ok it is probably a megaraid */
+	}
+
+	/*
 	 * For these vendor and device ids, signature offsets are not
 	 * valid and 64 bit is implicit
 	 */

_
