Bug 497445

Summary: iwlwifi crashes RHEL5.4-x86_64 on VT-d capable & enabled machine
Product: Red Hat Enterprise Linux 5 Reporter: Don Dutile (Red Hat) <ddutile>
Component: kernelAssignee: Stanislaw Gruszka <sgruszka>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: medium Docs Contact:
Priority: low    
Version: 5.4CC: linville
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-01-07 14:52:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
upstream backport of iwlwifi-fix-TX-cmd-dma-unmapping.patch to 5.4
none
Proposed fix. none

Description Don Dutile (Red Hat) 2009-04-23 22:20:52 UTC
Created attachment 341029 [details]
upstream backport of iwlwifi-fix-TX-cmd-dma-unmapping.patch to 5.4

Description of problem:
When enabling the Intel VT-d support on a Dell E6500 with an Intel 5100
wireless device, the system will crash when it tries to configure
the wireless.

Version-Release number of selected component (if applicable):


How reproducible:
Every time on boot if:
An Intel system with VT-d support, and a RHEL5.4 kernel with VT-d support included & enabled(intel_iommu=on), and an Intel 5100 wireless is enabled to
be configured.

Steps to Reproduce:
Can also do this:
1. blacklist iwlagn in /etc/modprobe.conf
2. bring up aforementioned hw & kernel
3. modprobe iwlagn
4. iwconfig wlan0 essid <local wireless pt>
5. dhclient wlan0
    ^-- crashes here
  
Actual results:
Crashes.

Expected results:
System continues to operate.
Wireless configures successfully.

Additional info:
(1) Took the rhel5.4-140 iwl driver and added the posted patches for
BZ 474699 (address problems switching btwn WPA & WEP) because it
had RX skb alignment fixes -- still crashed with this patch.
(2) backported the following upstream commit to the iwl driver:
    499b1883038a7db2dcf8b64229f8533ce2c8f0fc
(will attach the backported version for review).
 -- This stopped the iwl from crashing the kernel,
     but the iwl wouldn't successfully configure either;
     so, not sure if it cured one problem, created another,
     or just avoided the original iwl DMA mapping problem.
(3) this type of DMA mapping error has been seen in other
    upstream drivers when Intel Vt-d was enabled, and DMA 
    mapping bugs show up once real IOMMUs are
    in the hw path. 
     Typically, the driver error is due to multiple dma-like free/unmaps,
     improper params' passed to dma_[un]map_single(), etc.

Although laptops are not a primary target for RHEL5.4+KVM+VTd,
the chip set used in them is common in other laptops (Thinkpad x200,
Dell E6400, etc.), and are used by numerous KVM & VTD developers
as test machines (due to portability, costs, etc.).
Several patches to the VT-d code have been made to accomodate these
machines, or the drivers they use, in order to keep this set of 
developers 'healthy'.  To encourage RHEL5.4 use, a fix for the RHEL5.4
iwlwifi driver would be prudent.

Comment 2 Stanislaw Gruszka 2009-07-03 12:55:26 UTC
Don, your patch is not applicable. It is partially in reverse direction and partially forward. But in general it looks good, I did not see any backporting bugs in there. Could you provide dmesg output when device fail to configure after patch applied.

Comment 3 Stanislaw Gruszka 2009-07-03 12:59:42 UTC
I made a new backport as Don patch is a bit messy. It consist of two upstream  commits:

commit 499b1883038a7db2dcf8b64229f8533ce2c8f0fc
Author: Tomas Winkler <tomas.winkler>
Date:   Tue Oct 14 12:32:48 2008 -0700

    iwlwifi: fix TX cmd dma unmapping

commit 6aa03ab06978e97b3e0720f83280d7841051916b
Author: Fenghua Yu <fenghua.yu>
Date:   Wed Feb 25 14:06:26 2009 +0900

    Fix iwlan DMA mapping direction

I compiled in only, Don can give patch a try. 

There are further DMA related fixes in upstream: 

commit 96891ceedaeaac95aa5b9dba5e68a8e77d541e78
Author: Fenghua Yu <fenghua.yu>
Date:   Wed Feb 18 15:54:33 2009 -0800

    iwlwifi: dma mapping read and write change

commit: df833b1d73680f9f9dc72cbc3215edbbc6ab740d
Author: Reinette Chatre <reinette.chatre>
Date:   Tue Apr 21 10:55:48 2009 -0700

    iwlwifi: DMA fixes

First one is not related with RHEL version, backporting of second is in progress

Comment 4 Stanislaw Gruszka 2009-07-03 13:02:23 UTC
Created attachment 350422 [details]
Proposed fix.

Backport of 499b1883038a7db2dcf8b64229f8533ce2c8f0fc and 6aa03ab06978e97b3e0720f83280d7841051916b.

Comment 5 Stanislaw Gruszka 2009-10-23 12:02:43 UTC
Comment on attachment 350422 [details]
Proposed fix.

Patch is broken.

Comment 6 Stanislaw Gruszka 2009-12-02 09:28:38 UTC
Hi Don,

Could you please test kernel from:

http://people.redhat.com/linville/kernels/rhel5/

it should have this issue fixed.

Comment 7 Stanislaw Gruszka 2010-01-07 14:52:47 UTC
Don reported issue is fixed. I tested against this bug as well. Closing it.