Bug 557084 - kdump hangs due to oops in iwl3945
Summary: kdump hangs due to oops in iwl3945
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Stanislaw Gruszka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-01-20 11:21 UTC by Stanislaw Gruszka
Modified: 2010-04-10 10:29 UTC (History)
9 users (show)

Fixed In Version: kernel-2.6.32.11-99.fc12
Clone Of:
: 575120 575122 (view as bug list)
Environment:
Last Closed: 2010-04-10 10:29:30 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Backported fix to 2.6.32 kernel (714 bytes, patch)
2010-01-20 11:31 UTC, Stanislaw Gruszka
no flags Details | Diff
call trace (682.20 KB, image/jpeg)
2010-01-22 11:59 UTC, Stanislaw Gruszka
no flags Details
oops (685.22 KB, image/jpeg)
2010-01-22 12:03 UTC, Stanislaw Gruszka
no flags Details
Reset 3945 on probe (731 bytes, patch)
2010-02-03 00:33 UTC, reinette chatre
no flags Details | Diff

Description Stanislaw Gruszka 2010-01-20 11:21:45 UTC
Description of problem:
Kdump not work when iwl3945 module is loaded in crash kernel. This can be observed on lenovo t60 laptop. When blacklist iwl3945 module, kdump works as expected. Not sure if affected are other iwlwifi devices.

Version-Release number of selected component (if applicable):
Bug can be observed on 2.6.31 and 2.6.32 kernels (on F11 and F12)

How reproducible:
Always.

Steps to Reproduce:
'echo "c" > /proc/sysreq-triger' on hardware with iwl3945 device
  
Actual results:
Kdump hungs with oops in iwl3945 (not see full oops, only some calltrace)

Expected results:
Sucessful kdump.

Additional info:
This is fixed in 2.6.33-rc4 kernel.

Comment 2 Stanislaw Gruszka 2010-01-20 11:27:12 UTC
Upstream fix this in commit:

commit f8701fe3aec24fcfb0dfa19aab47904611f96daf                                   
Author: Reinette Chatre <reinette.chatre>                               
Date:   Thu Dec 10 14:37:22 2009 -0800                                            

    iwlwifi: power up all devices for EEPROM read

Comment 3 Stanislaw Gruszka 2010-01-20 11:31:03 UTC
Created attachment 385657 [details]
Backported fix to 2.6.32 kernel

Comment 4 Stanislaw Gruszka 2010-01-22 11:59:15 UTC
Created attachment 386130 [details]
call trace

Comment 5 Stanislaw Gruszka 2010-01-22 12:03:09 UTC
Created attachment 386132 [details]
oops

Comment 6 Stanislaw Gruszka 2010-01-22 12:14:44 UTC
(gdb) l *(iwl3945_irq_tasklet+0x387)
0x5a87 is in iwl3945_rx_handle (drivers/net/wireless/iwlwifi/iwl3945-base.c:1383).
1378            u32 count = 8;
1379            int total_empty = 0;
1380
1381            /* uCode's read index (stored in shared DRAM) indicates the last Rx
1382             * buffer that the driver may process (last buffer filled by ucode). */
1383            r = le16_to_cpu(rxq->rb_stts->closed_rb_num) &  0x0FFF;
1384            i = rxq->read;
1385
1386            /* calculate total frames need to be restock after handling RX */
1387            total_empty = r - priv->rxq.write_actual;

Oops is here (line 1383), but I'm not sure if something bad does not happen before.

Comment 7 Stanislaw Gruszka 2010-01-22 12:16:19 UTC
Note: photos and gdb are from 2.6.32.4 kernel.

Comment 8 reinette chatre 2010-01-22 18:35:40 UTC
Is the interface up (firmware loaded) at the time you trigger this problem?

Comment 9 Stanislaw Gruszka 2010-01-25 08:55:32 UTC
During kdump only module is loaded, interface is not up. When triggering crash from primary kernel, there is no difference if interface is up or down, kdump will oops anyway.

Comment 10 reinette chatre 2010-01-25 21:06:00 UTC
This makes a big difference since firmware is only loaded at interface up. You indicate that this problem occurs when interface is down, which is a problem since iwl3945_rx_handle() handles responses and notifications from firmware. So, how can driver be receiving response from firmware if firmware is not loaded?

What does kdump do to make driver think it received data from firmware?

Comment 11 Stanislaw Gruszka 2010-01-26 11:06:55 UTC
I'm sorry, I was wrong. Interface must be up on primary kernel to get crash. Kdump kernel crash after udev start - when module is loaded.

Comment 12 reinette chatre 2010-01-27 23:12:40 UTC
Could you please elaborate on what is going on here?

From what I understand you are talking about the "primary kernel" and the "kdump kernel". So, it seems that your "primary kernel" starts the "kdump kernel" and it is the "kdump kernel" that is crashing right when the module is loaded.

Is this correct?

To continue, from what I understand, the "kdump kernel" did not bring up the interface, so the firmware is not loaded. Even so, it is receiving interrupts as though the firmware is loaded. Considering that the device is already brought up and firmware loaded by the "primary kernel" this does sound plausible. 

Could you please explain why is iwl3945 part of "kdump kernel"?

Comment 13 Stanislaw Gruszka 2010-01-28 09:01:39 UTC
> Could you please elaborate on what is going on here?

The reason of oops is mysterious for me. Only that I know patch fix it. If patch is too risky put it in 2.6.32 stable, I'll dig more into the issue. 

> From what I understand you are talking about the "primary kernel" and the
> "kdump kernel". So, it seems that your "primary kernel" starts the "kdump
> kernel" and it is the "kdump kernel" that is crashing right when the module is
> loaded.
> 
> Is this correct?

Yes, kdump is a spare kernel running when primary kernel crash to dump memory. In fedora kdump and primary kernel are two instances of the same binary kernel image, but loaded in different places in memory (kernel image is relocatable), see Documentation/kdump/kdump.txt for more info.
 
> To continue, from what I understand, the "kdump kernel" did not bring up the
> interface, so the firmware is not loaded. Even so, it is receiving interrupts
> as though the firmware is loaded. Considering that the device is already
> brought up and firmware loaded by the "primary kernel" this does sound
> plausible. 

That explain also why disabling power after reading EEPROM solve the issue. 

> Could you please explain why is iwl3945 part of "kdump kernel"?    

Good question. IIUC some modules are blacklisted in kdump, but not networking. One feature of kdump is ability to dump memory through network via scp or nfs.

CCing Neil, perhaps he can elaborate more about whole problem.

Comment 14 reinette chatre 2010-01-28 21:54:06 UTC
(In reply to comment #13)
 
> 
> > Could you please explain why is iwl3945 part of "kdump kernel"?    
> 
> Good question. IIUC some modules are blacklisted in kdump, but not networking.
> One feature of kdump is ability to dump memory through network via scp or nfs.

How does the other devices do this? Since the firmware is loaded by "primary kernel" and that driver and device is fully initialized then things work well. The problem is that the driver in "kdump kernel" is not fully initialized, but talks to the same fully initialized device. Even if you bring up the interface right after module load in "kdump kernel" then there will still be a race since device can send interrupts at any time and driver may or may not be ready to deal with them.

Comment 15 Stanislaw Gruszka 2010-01-29 12:11:29 UTC
(In reply to comment #14)
> How does the other devices do this? 

Device reset is done before enabling interrupts (or registering interrupt handler), e100* do this in pci_probe. Hardware reset is usually a bit complicated procedure of writing to hw registers, like for example e1000_hw_reset(). 

Can we do someting similar in iwlwifi, I can see
extern int iwl3945_hw_nic_reset(struct iwl_priv *priv)
declaration in iwl3945.h, but that function is not implemented anywhere :/

Comment 16 reinette chatre 2010-01-29 17:53:59 UTC
I do not see how a device reset will help here since that will attempt to grab the device away from the "primary kernel"'s driver - I am not sure how driver in "primary kernel" will behave.

This problem does not seem valid to me since you are trying to manage a single device with two identical drivers.

Comment 17 Stanislaw Gruszka 2010-02-01 09:26:18 UTC
Primary kernel is dead when kdump starts, hence only one driver works at given time.

Comment 18 Stanislaw Gruszka 2010-02-01 09:51:08 UTC
Neil,

What you think about blacklisting modules during kdump? 

This could save some troubles for us. I think we can do something like that in kdump initrd before root directory switch:

cp -r /sysroot/etc/modprobe.d/* /tmp/tmpdir/
mount -t ramfs ramfs /sysroot/etc/modprobe.d
cp -r /tmp/tmpdir/* /sysroot/etc/modprobe.d/
cp blacklist-kdump.conf /sysroot/etc/modprobe.d/

blacklist-kdump.conf would be crated from /etc/kdump.conf with some reasonable defaults like blacklisting wifi drivers.

Comment 19 reinette chatre 2010-02-03 00:33:49 UTC
Created attachment 388410 [details]
Reset 3945 on probe

(In reply to comment #17)
> Primary kernel is dead when kdump starts, hence only one driver works at given
> time.    

ah - I see. Now I understand why your suggestion of resetting the device should work. Could you please try attached patch? Does it make sense? This is the same reset that is done when interface goes down.

Comment 20 Stanislaw Gruszka 2010-02-03 14:00:49 UTC
(In reply to comment #19)
> ah - I see. Now I understand why your suggestion of resetting the device should
> work. Could you please try attached patch? Does it make sense? This is the same
> reset that is done when interface goes down.    

Patch fix the problem and make perfect sense to me :)

Comment 21 reinette chatre 2010-02-03 17:42:52 UTC
Thank you for testing this. I made a similar change for iwlagn and will now work on getting it accepted and validated internally and pushed upstream.

Comment 22 reinette chatre 2010-02-11 23:41:06 UTC
Pushed upstream as http://article.gmane.org/gmane.linux.kernel.wireless.general/46580

Comment 23 Stanislaw Gruszka 2010-02-12 13:17:53 UTC
Thanks! Any plans to put patch into 2.6.33 and 2.6.32.

Comment 24 reinette chatre 2010-02-12 19:19:36 UTC
I did not think it was necessary since this does not have anything to do with normal operation.

Comment 26 Fedora Update System 2010-04-06 07:10:22 UTC
kernel-2.6.32.11-99.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/kernel-2.6.32.11-99.fc12

Comment 27 Fedora Update System 2010-04-09 01:37:38 UTC
kernel-2.6.32.11-99.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update kernel'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/kernel-2.6.32.11-99.fc12

Comment 28 Fedora Update System 2010-04-10 10:29:09 UTC
kernel-2.6.32.11-99.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


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