linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Allow both megaraid drivers to be built
@ 2005-08-29 14:50 Daniel Drake
  2005-08-29 15:02 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Drake @ 2005-08-29 14:50 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-scsi, sreenib, sju

[-- Attachment #1: Type: text/plain, Size: 2541 bytes --]

Currently, the two megaraid drivers are exclusive - if you build the "new 
generation" megaraid driver then you aren't able to build the old one.

I've been investigating this as this is not ideal: the old driver supports a 
lot of common hardware which the new driver does not, and vice-versa.

The two drivers compile together ok but will clash at runtime, due to the same 
name in the pci_driver struct. However I presume that the main reason that 
these drivers exclude each other is because there is some hardware support 
overlap - the new driver supports some hardware which would also be claimed by 
the old, not a sensible thing to do if both can be built and run in parallel.

The hardware overlap isn't straightforward - the newgen driver supports mostly 
a specific set of pid/vid/sspid/ssvid whereas the legacy one supports pid/vid 
pairs and accepts _any_ subsystem id's.

For example, the legacy driver will claim any device with vendor=101E 
product=1960. The newgen driver also lists those ID numbers but only against 5 
different subsystem id pairs, it won't claim "the whole lot".

I have repeatedly tried to contact LSI Logic to find out more about this 
overlap. In the above example, are there devices which have the ID's 
vendor=101E product=1960 and a subsystem _not_ listed in the newgen driver? 
These devices would be claimed by the old driver and not the new - is there a 
reason for this - would they not work with the newgen driver? Do they even 
exist at all?

I have recieved no real response from LSIL so I have produced this patch, 
which has been included on Gentoo's latest release media where both drivers 
have been built alongside each other and we have not recieved any negative 
reports about it. (hopefully those legacy users are over the moon because they 
can install gentoo again!)

This patch makes the assumption that in the above example there are no 
101E/1960 adapters anywhere in the world that have subsystem ID's not listed 
in the newgen driver, and the same for the other device support overlaps. This 
results in the newgen driver being favoured (which apparently performs much 
better than the legacy on the devices which are supported by both) when both 
are built together -- however the device support in the old driver will be 
*unchanged* if you do not build the new one alongside it.

I know that this solution is not ideal, but as LSIL are being uncooperative, I 
think this is the best compromise we can do for now. Please apply.

Signed-off-by: Daniel Drake <dsd@gentoo.org>

[-- Attachment #2: 4351_megaraid-compatibility.patch --]
[-- Type: text/x-patch, Size: 2198 bytes --]

diff -urNp linux-2.6.12/drivers/scsi-orig/megaraid/Kconfig.megaraid linux-2.6.12/drivers/scsi/megaraid/Kconfig.megaraid
--- linux-2.6.12/drivers/scsi-orig/megaraid/Kconfig.megaraid	2005-06-29 16:19:55.000000000 +0100
+++ linux-2.6.12/drivers/scsi/megaraid/Kconfig.megaraid	2005-06-29 16:22:12.000000000 +0100
@@ -64,7 +64,6 @@ config MEGARAID_MAILBOX
 	To compile this driver as a module, choose M here: the
 	module will be called megaraid_mbox
 
-if MEGARAID_NEWGEN=n
 config MEGARAID_LEGACY
 	tristate "LSI Logic Legacy MegaRAID Driver"
 	depends on PCI && SCSI
@@ -75,4 +74,4 @@ config MEGARAID_LEGACY
 
 	To compile this driver as a module, choose M here: the
 	module will be called megaraid
-endif
+
diff -urNp linux-2.6.12/drivers/scsi-orig/megaraid.c linux-2.6.12/drivers/scsi/megaraid.c
--- linux-2.6.12/drivers/scsi-orig/megaraid.c	2005-06-29 16:19:55.000000000 +0100
+++ linux-2.6.12/drivers/scsi/megaraid.c	2005-06-30 13:07:41.000000000 +0100
@@ -5033,28 +5033,34 @@ megaraid_shutdown(struct device *dev)
 }
 
 static struct pci_device_id megaraid_pci_tbl[] = {
+#ifndef CONFIG_MEGARAID_NEWGEN
 	{PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DISCOVERY,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_PERC4_DI,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, BOARD_64BIT},
 	{PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_PERC4_QC_VERDE,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, BOARD_64BIT},
+#endif
 	{PCI_VENDOR_ID_AMI, PCI_DEVICE_ID_AMI_MEGARAID,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{PCI_VENDOR_ID_AMI, PCI_DEVICE_ID_AMI_MEGARAID2,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+#ifndef CONFIG_MEGARAID_NEWGEN
 	{PCI_VENDOR_ID_AMI, PCI_DEVICE_ID_AMI_MEGARAID3,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+#endif
 	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_AMI_MEGARAID3,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+#ifndef CONFIG_MEGARAID_NEWGEN
 	{PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_AMI_MEGARAID3,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+#endif
 	{0,}
 };
 MODULE_DEVICE_TABLE(pci, megaraid_pci_tbl);
 
 static struct pci_driver megaraid_pci_driver = {
-	.name		= "megaraid",
+	.name		= "megaraid_legacy",
 	.id_table	= megaraid_pci_tbl,
 	.probe		= megaraid_probe_one,
 	.remove		= __devexit_p(megaraid_remove_one),

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

* Re: [PATCH] Allow both megaraid drivers to be built
  2005-08-29 14:50 [PATCH] Allow both megaraid drivers to be built Daniel Drake
@ 2005-08-29 15:02 ` Christoph Hellwig
  2005-08-29 17:30   ` Daniel Drake
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2005-08-29 15:02 UTC (permalink / raw)
  To: Daniel Drake; +Cc: James.Bottomley, linux-scsi, sreenib, sju

On Mon, Aug 29, 2005 at 03:50:19PM +0100, Daniel Drake wrote:

ifdef on other drivers is bogus, please remove the pci ids completely
from the old driver.  It'd probably be a good idea to rename it to
megaraid_legacy aswell.  I've also asked the LSI Engineers whether they
could help identifying what code could be remove when only supporting
the two oldes chips but haven't gotten a reply yet.  I hope they'll
be able to answer when they're less busy.

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

* [PATCH] Allow both megaraid drivers to be built
  2005-08-29 15:02 ` Christoph Hellwig
@ 2005-08-29 17:30   ` Daniel Drake
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Drake @ 2005-08-29 17:30 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: James.Bottomley, linux-scsi, sreenib, sju

Christoph Hellwig wrote:
> ifdef on other drivers is bogus, please remove the pci ids completely
> from the old driver.  It'd probably be a good idea to rename it to
> megaraid_legacy aswell.  I've also asked the LSI Engineers whether they
> could help identifying what code could be remove when only supporting
> the two oldes chips but haven't gotten a reply yet.  I hope they'll
> be able to answer when they're less busy.

Thanks for the feedback. Here's a new patch.



Rename megaraid to megaraid_legacy, changing the filenames, sysfs name, module 
name, and the messages printed out via printk. I have left the procfs name as 
"megaraid" as presumably userspace tools rely on this.

Remove hardware ID's from megaraid_legacy which overlap with the newgen 
megaraid drivers.

Allow megaraid_legacy to be built alongside the newgen driver.

Signed-off-by: Daniel Drake <dsd@gentoo.org>



As the patch is large (300K) I am not including it in this mail. You can get 
it here:

	http://dev.gentoo.org/~dsd/megaraid_legacy.patch

Thanks,
Daniel

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

end of thread, other threads:[~2005-08-29 17:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-29 14:50 [PATCH] Allow both megaraid drivers to be built Daniel Drake
2005-08-29 15:02 ` Christoph Hellwig
2005-08-29 17:30   ` Daniel Drake

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