diff options
author | Fenghua Yu <fenghua.yu@intel.com> | 2009-02-18 18:54:33 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-27 14:52:47 -0500 |
commit | 96891ceedaeaac95aa5b9dba5e68a8e77d541e78 (patch) | |
tree | 4f0666a793ec60dbd4194755d076b5c7ae709807 /drivers/net/wireless/iwlwifi/iwl-tx.c | |
parent | 7dc45f25d39ea959fdc1d5f636e9fc6cbe7ac7e0 (diff) |
iwlwifi: dma mapping read and write changes
When iwlwifi 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 iwlwifi
driver calls DMA mapping with PCI_DMA_TODEVICE which is read only in mapping
PTE. But iwlwifi 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 iwl TX command contains a scratch field that is updated by uCode to
indicate retry counts. For 5000 series the patch is required also for
regular frames, but this patch does not differenciate.
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-tx.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-tx.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index ae04c2086f70..dff60fb70214 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c | |||
@@ -819,7 +819,7 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) | |||
819 | * within command buffer array. */ | 819 | * within command buffer array. */ |
820 | txcmd_phys = pci_map_single(priv->pci_dev, | 820 | txcmd_phys = pci_map_single(priv->pci_dev, |
821 | out_cmd, sizeof(struct iwl_cmd), | 821 | out_cmd, sizeof(struct iwl_cmd), |
822 | PCI_DMA_TODEVICE); | 822 | PCI_DMA_BIDIRECTIONAL); |
823 | pci_unmap_addr_set(&out_cmd->meta, mapping, txcmd_phys); | 823 | pci_unmap_addr_set(&out_cmd->meta, mapping, txcmd_phys); |
824 | pci_unmap_len_set(&out_cmd->meta, len, sizeof(struct iwl_cmd)); | 824 | pci_unmap_len_set(&out_cmd->meta, len, sizeof(struct iwl_cmd)); |
825 | /* Add buffer containing Tx command and MAC(!) header to TFD's | 825 | /* Add buffer containing Tx command and MAC(!) header to TFD's |
@@ -968,7 +968,7 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd) | |||
968 | IWL_MAX_SCAN_SIZE : sizeof(struct iwl_cmd); | 968 | IWL_MAX_SCAN_SIZE : sizeof(struct iwl_cmd); |
969 | 969 | ||
970 | phys_addr = pci_map_single(priv->pci_dev, out_cmd, | 970 | phys_addr = pci_map_single(priv->pci_dev, out_cmd, |
971 | len, PCI_DMA_TODEVICE); | 971 | len, PCI_DMA_BIDIRECTIONAL); |
972 | pci_unmap_addr_set(&out_cmd->meta, mapping, phys_addr); | 972 | pci_unmap_addr_set(&out_cmd->meta, mapping, phys_addr); |
973 | pci_unmap_len_set(&out_cmd->meta, len, len); | 973 | pci_unmap_len_set(&out_cmd->meta, len, len); |
974 | phys_addr += offsetof(struct iwl_cmd, hdr); | 974 | phys_addr += offsetof(struct iwl_cmd, hdr); |
@@ -1068,7 +1068,7 @@ static void iwl_hcmd_queue_reclaim(struct iwl_priv *priv, int txq_id, | |||
1068 | pci_unmap_single(priv->pci_dev, | 1068 | pci_unmap_single(priv->pci_dev, |
1069 | pci_unmap_addr(&txq->cmd[cmd_idx]->meta, mapping), | 1069 | pci_unmap_addr(&txq->cmd[cmd_idx]->meta, mapping), |
1070 | pci_unmap_len(&txq->cmd[cmd_idx]->meta, len), | 1070 | pci_unmap_len(&txq->cmd[cmd_idx]->meta, len), |
1071 | PCI_DMA_TODEVICE); | 1071 | PCI_DMA_BIDIRECTIONAL); |
1072 | 1072 | ||
1073 | for (idx = iwl_queue_inc_wrap(idx, q->n_bd); q->read_ptr != idx; | 1073 | for (idx = iwl_queue_inc_wrap(idx, q->n_bd); q->read_ptr != idx; |
1074 | q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) { | 1074 | q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) { |