LKML Archive on 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

* Re: PATCH: Stop megaraid trashing other i960 based devices
  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
  0 siblings, 1 reply; 7+ messages in thread
From: hch @ 2004-05-22 16:02 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel, linux-megaraid-devel, akpm

On Sat, May 22, 2004 at 11:46:59AM -0400, Alan Cox wrote:
> --- 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 */
> +	}

I think we should add all valid subvendor ids to the pci_id table instead.
Especially to not consude the hotplug package.


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

* Re: PATCH: Stop megaraid trashing other i960 based devices
  2004-05-22 16:02 ` hch
@ 2004-05-22 16:03   ` Alan Cox
  2004-05-22 16:07     ` hch
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Cox @ 2004-05-22 16:03 UTC (permalink / raw)
  To: hch, Alan Cox, linux-kernel, linux-megaraid-devel, akpm

On Sat, May 22, 2004 at 12:02:05PM -0400, hch@infradead.org wrote:
> > +		   	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 */
> > +	}
> 
> I think we should add all valid subvendor ids to the pci_id table instead.
> Especially to not consude the hotplug package.

Most of the megaraids don't have subvendor ids... so that doesn't work at
all.




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

* Re: PATCH: Stop megaraid trashing other i960 based devices
  2004-05-22 16:03   ` Alan Cox
@ 2004-05-22 16:07     ` hch
  2004-05-22 17:07       ` Matt Domsch
  0 siblings, 1 reply; 7+ messages in thread
From: hch @ 2004-05-22 16:07 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel, linux-scsi, akpm

On Sat, May 22, 2004 at 12:03:28PM -0400, Alan Cox wrote:
> > I think we should add all valid subvendor ids to the pci_id table instead.
> > Especially to not consude the hotplug package.
> 
> Most of the megaraids don't have subvendor ids... so that doesn't work at
> all.

Okay.  In that case we should apply the patch and shoot some megraid
hardware engineer.

(and keep linux-scsi in the loop)

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

* Re: PATCH: Stop megaraid trashing other i960 based devices
  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
  0 siblings, 2 replies; 7+ messages in thread
From: Matt Domsch @ 2004-05-22 17:07 UTC (permalink / raw)
  To: hch, Alan Cox, linux-kernel, linux-scsi, akpm

On Sat, May 22, 2004 at 12:07:18PM -0400, hch@infradead.org wrote:
> On Sat, May 22, 2004 at 12:03:28PM -0400, Alan Cox wrote:
> > Most of the megaraids don't have subvendor ids... so that doesn't work at
> > all.
> 
> Okay.  In that case we should apply the patch and shoot some megraid
> hardware engineer.

Now, I love a good megaraid bashing as much as the next guy.  Just ask
Peter Jarrett and Atul Mukker.  But in this case I have to side with
them.  The cards w/o subsystem IDs all predate the existance of
subsystem IDs in the PCI spec, and I'm pretty sure the IDs in the i960
of that vintage are hard-coded so AMI couldn't have changed them if
they wanted to.  So their magic words were the equivalent of what we
now do with subsystem IDs.  It's only the older cards that have a
problem, AFAIK.

Thanks,
Matt

-- 
Matt Domsch
Sr. Software Engineer, Lead Engineer
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com

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

* Re: PATCH: Stop megaraid trashing other i960 based devices
  2004-05-22 17:07       ` Matt Domsch
@ 2004-05-22 17:11         ` Alan Cox
  2004-05-22 17:11         ` hch
  1 sibling, 0 replies; 7+ messages in thread
From: Alan Cox @ 2004-05-22 17:11 UTC (permalink / raw)
  To: Matt Domsch; +Cc: hch, Alan Cox, linux-kernel, linux-scsi, akpm

On Sat, May 22, 2004 at 12:07:06PM -0500, Matt Domsch wrote:
> of that vintage are hard-coded so AMI couldn't have changed them if
> they wanted to.  So their magic words were the equivalent of what we
> now do with subsystem IDs.  It's only the older cards that have a
> problem, AFAIK.

Certain megaraid 3 era cards - so yes quite old stuff only. Its not the
only driver with these kind of problems although the other i960 stuff I have
does all have a unique id or class.


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

* Re: PATCH: Stop megaraid trashing other i960 based devices
  2004-05-22 17:07       ` Matt Domsch
  2004-05-22 17:11         ` Alan Cox
@ 2004-05-22 17:11         ` hch
  1 sibling, 0 replies; 7+ messages in thread
From: hch @ 2004-05-22 17:11 UTC (permalink / raw)
  To: Matt Domsch; +Cc: Alan Cox, linux-kernel, linux-scsi, akpm

On Sat, May 22, 2004 at 12:07:06PM -0500, Matt Domsch wrote:
> Now, I love a good megaraid bashing as much as the next guy.  Just ask
> Peter Jarrett and Atul Mukker.  But in this case I have to side with
> them.  The cards w/o subsystem IDs all predate the existance of
> subsystem IDs in the PCI spec, and I'm pretty sure the IDs in the i960
> of that vintage are hard-coded so AMI couldn't have changed them if
> they wanted to.  So their magic words were the equivalent of what we
> now do with subsystem IDs.  It's only the older cards that have a
> problem, AFAIK.

Okay, so let's shoot an i960 engineer instead.  Intel bashing is even
more fun anyway ;-)


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