Red Hat Bugzilla – Bug 154028
megaraid2 driver causes panic if loaded for a second time
Last modified: 2007-11-30 17:07:06 EST
Description of problem:
In RHEL 3 U3/U4, loading the megaraid2 driver after a rmmod causes kernel
panic. This was fixed in the older driver (megaraid) but somehow the fix got
removed in megaraid2 driver. The simple fix is to set the dma_mask to 0xFFFFFF
before the adapter_query.
3.insmod megaraid2 - will cause a kernel panic
The following fixes the issue.
--- megaraid2.c 2004-08-18 17:33:28.000000000 -0700
+++ megaraid2_new.c 2005-03-31 15:37:53.000000000 -0800
@@ -530,6 +530,8 @@
did_setup_mbox_f = 1;
+ pci_set_dma_mask(pdev, 0xffffffffULL);
if( mega_query_adapter(adapter) != 0 )
Created attachment 112764 [details]
This patch is one way to fix the issue
1. -Why- does this fix the problem? Where is the panic output?
2. Normally the dma_mask is already 0xffffffff, which makes this fix unusual.
It sounds like something else is going on.
3. Check pci_set_dma_mask() return value, per API.
Created attachment 116554 [details]
modprode, rmmod messages
I was not able to reproduce this panic. I tried it a dozen times on an 8 way
i686 with 8 GB of memory with stock U5. IIRC there were no megaraid2 changes
from U4 to U5. See attached for some of the messages.
Please provide the panic output, and information about your platform, arch, and
This bug is fixed in RHEL 3 U6 early release.
There are no changes in the megaraid2 driver betwen U5 and U6 that are likely to
have fixed this. Maybe it was somewhere else. I'll close this now. Re-open if it
comes up again.
Created attachment 119269 [details]
Since RHEL3 U4 only x86_64 arch is affected. I have attached the kernel panic
Additional notes from original submitter:
ââ¦. On the 1st insmod, when mega_i_query is called, the DMA is set to 32 bit
by default. And pci_map_single() returns expected addresses. After getting
handles, the DMA mask is set to 64 bit. And normal operation continues. Ater
rmmodâing and insmodâing the driver, the same code sequence is executed and
when we get an address for pci device, we get the SAME address (the same as
the 1st insmod) and the DMA mask (pdev->dma_mask) is 64 bit. It looks like the
memory is not being initialized (or the previous values are staying resident)
so when the driver tries to get DMA handles, it gets 64 bit address (which
gets truncated etc) which is not valid. â¦â
Changing "hardware" field to represent info in last comment.
Please test the kernel located at:
to verify that it solves the problem.
This contains version v220.127.116.11 of the megaraid2 driver. This is the latest from
LSI Logic and is a candidate for U7.
Panic still occurs with this test kernel rpm. We have made the
pci_set_dma_mask(pdev, 0xffffffffULL) change mentioned above on this version
(18.104.22.168) of the driver and it does correct the problem.
The patch described in Comment #18 is described in the bug decription above.
This patch is still needed for version 22.214.171.124.
A fix for this problem has just been committed to the RHEL3 U7
patch pool this evening (in kernel version 2.4.21-37.11.EL).
This issue was fixed in RHEL 3 U7 public beta. This bugzilla can be closed.
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.