rpms/kernel/devel linux-2.6-iwlwifi-dma-direction.patch, NONE, 1.1 kernel.spec, 1.1289, 1.1290

David Woodhouse dwmw2 at fedoraproject.org
Wed Feb 11 21:12:48 UTC 2009


Author: dwmw2

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv11007

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-iwlwifi-dma-direction.patch 
Log Message:
fix iwlwifi dma bug

linux-2.6-iwlwifi-dma-direction.patch:

--- NEW FILE linux-2.6-iwlwifi-dma-direction.patch ---
From: Fenghua Yu <fenghua.yu at intel.com>
Subject: [PATCH]iwlan dma mapping read and write changes
When iwlan runs on IOMMU, IOMMU generates a lot of PTE write faults because PTE
write bit is not set on some of PTE's. This is because iwlan driver calls DMA
mapping with PCI_DMA_TODEVICE which is read only in mapping PTE. But iwlan device
actually writes to the mapped page to update its contents. This issue is not
exposed in swiotlb. But VT-d hardware can capture this fault and stop the fault
transaction.

The following patch fixes the issue.

Signed-off-by: Fenghua Yu <fenghua.yu at intel.com>
Tested-by: Chris Wright <chrisw at sous-sol.org>
---

 iwl-tx.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

--- a/drivers/net/wireless/iwlwifi/iwl-tx.c.orig	2009-02-10 21:28:45.000000000 -0800
+++ b/drivers/net/wireless/iwlwifi/iwl-tx.c	2009-02-10 21:41:02.000000000 -0800
@@ -148,7 +148,7 @@ static void iwl_hw_txq_free_tfd(struct i
 		pci_unmap_single(dev,
 				pci_unmap_addr(&txq->cmd[index]->meta, mapping),
 				pci_unmap_len(&txq->cmd[index]->meta, len),
-				PCI_DMA_TODEVICE);
+				PCI_DMA_BIDIRECTIONAL);
 
 	/* Unmap chunks, if any. */
 	for (i = 1; i < num_tbs; i++) {
@@ -964,7 +964,7 @@ int iwl_tx_skb(struct iwl_priv *priv, st
 	 * within command buffer array. */
 	txcmd_phys = pci_map_single(priv->pci_dev,
 				    out_cmd, sizeof(struct iwl_cmd),
-				    PCI_DMA_TODEVICE);
+				    PCI_DMA_BIDIRECTIONAL);
 	pci_unmap_addr_set(&out_cmd->meta, mapping, txcmd_phys);
 	pci_unmap_len_set(&out_cmd->meta, len, sizeof(struct iwl_cmd));
 	/* Add buffer containing Tx command and MAC(!) header to TFD's
@@ -1115,7 +1115,7 @@ int iwl_enqueue_hcmd(struct iwl_priv *pr
 			IWL_MAX_SCAN_SIZE : sizeof(struct iwl_cmd);
 
 	phys_addr = pci_map_single(priv->pci_dev, out_cmd,
-				   len, PCI_DMA_TODEVICE);
+				   len, PCI_DMA_BIDIRECTIONAL);
 	pci_unmap_addr_set(&out_cmd->meta, mapping, phys_addr);
 	pci_unmap_len_set(&out_cmd->meta, len, len);
 	phys_addr += offsetof(struct iwl_cmd, hdr);
@@ -1212,7 +1212,7 @@ static void iwl_hcmd_queue_reclaim(struc
 	pci_unmap_single(priv->pci_dev,
 		pci_unmap_addr(&txq->cmd[cmd_idx]->meta, mapping),
 		pci_unmap_len(&txq->cmd[cmd_idx]->meta, len),
-		PCI_DMA_TODEVICE);
+		PCI_DMA_BIDIRECTIONAL);
 
 	for (idx = iwl_queue_inc_wrap(idx, q->n_bd); q->read_ptr != idx;
 	     q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) {


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1289
retrieving revision 1.1290
diff -u -r1.1289 -r1.1290
--- kernel.spec	11 Feb 2009 20:16:01 -0000	1.1289
+++ kernel.spec	11 Feb 2009 21:12:18 -0000	1.1290
@@ -625,6 +625,8 @@
 
 Patch680: linux-2.6-rt2x00-asus-leds.patch
 
+Patch690: linux-2.6-iwlwifi-dma-direction.patch
+
 Patch1515: linux-2.6.29-lirc.patch
 Patch1520: linux-2.6-hdpvr.patch
 
@@ -1123,6 +1125,9 @@
 # rt2x00: back-port activity LED init patches
 ApplyPatch linux-2.6-rt2x00-asus-leds.patch
 
+# Intel wireless DMA fix
+ApplyPatch linux-2.6-iwlwifi-dma-direction.patch
+
 # http://www.lirc.org/
 ApplyPatch linux-2.6.29-lirc.patch
 # http://hg.jannau.net/hdpvr/
@@ -1744,6 +1749,9 @@
 %kernel_variant_files -k vmlinux %{with_kdump} kdump
 
 %changelog
+* Wed Feb 11 2009 David Woodhouse <David.Woodhouse at intel.com>
+- Fix iwlwifi DMA direction bug.
+
 * Wed Feb 11 2009 John W. Linville <linville at redhat.com>
 - Drop linux-2.6-at76.patch in favor of version from drivers/staging (#477927)
 




More information about the fedora-extras-commits mailing list