Fedora Account System
Red Hat Associate
Red Hat Customer
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.
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
Created attachment 385657 [details] Backported fix to 2.6.32 kernel
Created attachment 386130 [details] call trace
Created attachment 386132 [details] oops
(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.
Note: photos and gdb are from 2.6.32.4 kernel.
Is the interface up (firmware loaded) at the time you trigger this problem?
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.
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?
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.
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"?
> 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.
(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.
(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 :/
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.
Primary kernel is dead when kdump starts, hence only one driver works at given time.
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.
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.
(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 :)
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.
Pushed upstream as http://article.gmane.org/gmane.linux.kernel.wireless.general/46580
Thanks! Any plans to put patch into 2.6.33 and 2.6.32.
I did not think it was necessary since this does not have anything to do with normal operation.
http://koji.fedoraproject.org/koji/buildinfo?buildID=164363
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
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
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.