Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 31017 - AMI Megaraid driver problem
AMI Megaraid driver problem
Product: Red Hat Linux
Classification: Retired
Component: kernel (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Arjan van de Ven
Brock Organ
Depends On:
  Show dependency treegraph
Reported: 2001-03-07 17:47 EST by Alan Cox
Modified: 2007-04-18 12:32 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-03-21 04:56:58 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Alan Cox 2001-03-07 17:47:49 EST
RC2 fails to find my AMI megaraid and configure it properly. Rebuilding
with my cleaned up driver works, as does adding #define DELL_HACKS (I think
thats the string) to it so that it does a pci_enable_device().

The enable device being needed is probably because I have the BIOS set PnP
so not going to bite many people

Please also default the skipid module option to -1 for all cases. If it is
set to non -1 values it misdetects other boards as megaraids if they have
i960's on them.
Comment 1 Arjan van de Ven 2001-03-08 04:20:34 EST
I switched our megaraid driver to your cleaned up version.
Do you have time to boot the new kernel I'm building with it?
Comment 2 Alan Cox 2001-03-08 06:35:51 EST
I can try such an RPM kernel, however I would suggest that is a non trivial
change while enable the DELL_whatever #ifdef / #defines which also solves it
changes about 5 lines of code you can hand inspect for correctness.

I can test either for you
Comment 3 Michael K. Johnson 2001-03-12 22:26:13 EST
Cleaned up driver doing well in our testing so far.  Might as well
have a more maintainable driver if it passes our testing...  :-)
Comment 4 Matt Domsch 2001-03-20 22:39:06 EST
I didn't actually write the #define/#ifdef DELL_MODIFICATIONS stuff.  For a 
while about a year ago people were sending megaraid patches to lkml, but PeterJ 
wasn't receiving them.  So, I packaged 3 or 4 of them up and sent them off to 
Peter, who passed them off to another developer, who, not understanding if they 
were any good, put them inside that #define.  So, if they appear to do "the 
right thing", I say go ahead and remove the #define/#ifdef and just use that 
code straight.
Comment 5 Matt Domsch 2001-03-20 23:50:35 EST
Alan made some additional changes around -ac18 (I looked at -ac20) which aren't 
incorporated in the Red Hat 2.4.2-0.1.28 kernel.  Should they be?  Linus's 
2.4.3-pre6 doesn't have these either.

--- /usr/src/redhat/BUILD/kernel-2.4.2/linux/drivers/scsi/megaraid.c	Tue Mar 
20 22:30:53 2001
+++ linux-2.4.2-ac20/drivers/scsi/megaraid.c	Tue Mar 20 22:37:11 2001
@@ -75,7 +75,7 @@
  *     Changed megaraid_command to use wait_queue.
  * Version 1.00:
- *     Checks to see if an irq ocurred while in isr, and runs through
+ *     Checks to see if an irq occurred while in isr, and runs through
  *       routine again.
  *     Copies mailbox to temp area before processing in isr
  *     Added barrier() in busy wait to fix volatility bug
@@ -391,6 +391,11 @@
 	writel (value, megaCfg->base + 0x2C);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)	/* 0x020200 */
+#include <linux/smp.h>
+#define cpuid smp_processor_id()
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)	/* 0x020100 */
@@ -401,9 +406,6 @@
  *	queue task is a simple api without irq forms
-#include <linux/smp.h>
-#define cpuid smp_processor_id()
 static char kernel_version[] = UTS_RELEASE;
 MODULE_AUTHOR ("American Megatrends Inc.");
@@ -430,10 +432,7 @@
  *	queue_task is now a single simple API
-#include <linux/smp.h>
-#define cpuid smp_processor_id()
-char kernel_version[] = UTS_RELEASE;
+static char kernel_version[] = UTS_RELEASE;
 MODULE_AUTHOR ("American Megatrends Inc.");
@@ -4301,12 +4300,10 @@
-static Scsi_Host_Template driver_template = MEGARAID;
-#include "scsi_module.c"
-#ifdef MODULE
+#endif				/* LINUX VERSION 2.4.XX */
 Scsi_Host_Template driver_template = MEGARAID;
 #include "scsi_module.c"
-#endif				/* MODULE */
-#endif				/* LINUX VERSION 2.4.XX  test */
+#endif				/* LINUX VERSION 2.4.XX || MODULE */

Comment 6 Arjan van de Ven 2001-03-21 04:56:47 EST
Our latest kernel should have Alan's megaraid as of ac18.
The ac20 changes seem purely cosmetic.
Comment 7 Arjan van de Ven 2001-03-23 14:59:05 EST
Closing this bug as we already have latest. If megaraid is causing any
problems, please open a new bug, as that is unlikely to be related to this one.

Note You need to log in before you can comment on or make changes to this bug.