Bug 154028 - megaraid2 driver causes panic if loaded for a second time
megaraid2 driver causes panic if loaded for a second time
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel (Show other bugs)
3.0
ia32e Linux
medium Severity medium
: ---
: ---
Assigned To: Tom Coughlan
Brian Brock
:
Depends On:
Blocks: 168424
  Show dependency treegraph
 
Reported: 2005-04-06 13:03 EDT by Need Real Name
Modified: 2007-11-30 17:07 EST (History)
6 users (show)

See Also:
Fixed In Version: RHSA-2006-0144
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-03-15 10:55:12 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
This patch is one way to fix the issue (343 bytes, patch)
2005-04-06 13:03 EDT, Need Real Name
no flags Details | Diff
modprode, rmmod messages (9.61 KB, text/plain)
2005-07-08 20:14 EDT, Tom Coughlan
no flags Details
panic output (6.20 KB, text/plain)
2005-09-26 14:50 EDT, Dale Busacker
no flags Details

  None (edit)
Description Need Real Name 2005-04-06 13:03:48 EDT
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.

How reproducible:
1.insmod megaraid2
2.rmmod megaraid2
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 )
                        goto fail_attach;
Comment 1 Need Real Name 2005-04-06 13:03:49 EDT
Created attachment 112764 [details]
This patch is one way to fix the issue
Comment 7 Jeff Garzik 2005-06-23 17:27:11 EDT
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.
Comment 8 Tom Coughlan 2005-07-08 20:14:51 EDT
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
megaraid config.
Comment 10 Magdalena Glinkowski 2005-08-03 16:48:44 EDT
This bug is fixed in RHEL 3 U6 early release.
Comment 11 Tom Coughlan 2005-08-10 11:03:31 EDT
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. 
Comment 13 Dale Busacker 2005-09-26 14:50:47 EDT
Created attachment 119269 [details]
panic output
Comment 14 Dale Busacker 2005-09-26 14:53:08 EDT
Reopening...
Since RHEL3 U4 only x86_64 arch is affected.  I have attached the kernel panic 
output.

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. …”

Comment 15 Ernie Petrides 2005-10-03 22:14:55 EDT
Changing "hardware" field to represent info in last comment.
Comment 17 Tom Coughlan 2005-11-01 19:08:33 EST
Please test the kernel located at:

http://people.redhat.com/coughlan/.2.4.21-37.7.ELdrvrtest2/

to verify that it solves the problem. 

This contains version v2.10.10.1 of the megaraid2 driver. This is the latest from
LSI Logic and is a candidate for U7. 

Comment 18 Dale Busacker 2005-11-02 17:15:50 EST
Panic still occurs with this test kernel rpm.  We have made the 
pci_set_dma_mask(pdev, 0xffffffffULL) change mentioned above on this version 
(2.10.10.1) of the driver and it does correct the problem.  
Comment 20 dely.l.sy 2005-11-14 12:53:41 EST
The patch described in Comment #18 is described in the bug decription above.  
This patch is still needed for version 2.10.10.1.
Comment 21 Ernie Petrides 2005-11-28 18:04:29 EST
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).
Comment 24 dely.l.sy 2006-01-10 20:44:50 EST
This issue was fixed in RHEL 3 U7 public beta.  This bugzilla can be closed.
Comment 26 Red Hat Bugzilla 2006-03-15 10:55:15 EST
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.

http://rhn.redhat.com/errata/RHSA-2006-0144.html

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