All of lore.kernel.org
 help / color / mirror / Atom feed
* PATCH: Stop megaraid trashing other i960 based devices
@ 2004-05-22 15:46 Alan Cox
  2004-05-22 16:02 ` hch
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Cox @ 2004-05-22 15:46 UTC (permalink / raw)
  To: linux-kernel, linux-megaraid-devel, akpm

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.


--- drivers/scsi/megaraid.c~	2004-05-22 16:34:01.976198176 +0100
+++ drivers/scsi/megaraid.c	2004-05-22 16:38:58.176168936 +0100
@@ -4609,6 +4609,21 @@
 
 	pci_bus = pdev->bus->number;
 	pci_dev_func = pdev->devfn;
+	
+	if(pdev->vendor == PCI_VENDOR_ID_INTEL)		/* The megaraid3 stuff reports the id of the intel
+							   part which is not remotely specific to the megaraid */
+	{
+		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

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

end of thread, other threads:[~2004-05-22 17:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-22 15:46 PATCH: Stop megaraid trashing other i960 based devices Alan Cox
2004-05-22 16:02 ` hch
2004-05-22 16:03   ` Alan Cox
2004-05-22 16:07     ` hch
2004-05-22 17:07       ` Matt Domsch
2004-05-22 17:11         ` Alan Cox
2004-05-22 17:11         ` hch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.