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.
I switched our megaraid driver to your cleaned up version. Do you have time to boot the new kernel I'm building with it?
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
Cleaned up driver doing well in our testing so far. Might as well have a more maintainable driver if it passes our testing... :-)
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.
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() +#endif + #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."); MODULE_DESCRIPTION ("AMI MegaRAID driver"); @@ -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."); MODULE_DESCRIPTION ("AMI MegaRAID driver"); @@ -4301,12 +4300,10 @@ } #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) -static Scsi_Host_Template driver_template = MEGARAID; -#include "scsi_module.c" -#else -#ifdef MODULE +static +#endif /* LINUX VERSION 2.4.XX */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) || defined(MODULE) 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 */
Our latest kernel should have Alan's megaraid as of ac18. The ac20 changes seem purely cosmetic.
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.