Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e91af0af authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

iwlagn: fix DMA sync



For the RX DMA fix for iwlwifi ("iwlagn: fix RX skb alignment") Luis
pointed out:

> aligned_dma_addr can obviously be > real_dma_addr at this point, what
> guarantees we can use it on our own whim?

I asked around, and he's right, there may be platforms that do not allow
passing such such an address to the DMA API functions. This patch
changes it by using the proper dma_sync_single_range_for_cpu API
invented for this purpose.

Cc: Luis R. Rodriguez <mcgrof@gmail.com>
Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 7e56b5d6
Loading
Loading
Loading
Loading
+5 −3
Original line number Original line Diff line number Diff line
@@ -1384,7 +1384,9 @@ void iwl_rx_handle(struct iwl_priv *priv)


		rxq->queue[i] = NULL;
		rxq->queue[i] = NULL;


		pci_dma_sync_single_for_cpu(priv->pci_dev, rxb->aligned_dma_addr,
		dma_sync_single_range_for_cpu(
				&priv->pci_dev->dev, rxb->real_dma_addr,
				rxb->aligned_dma_addr - rxb->real_dma_addr,
				priv->hw_params.rx_buf_size,
				priv->hw_params.rx_buf_size,
				PCI_DMA_FROMDEVICE);
				PCI_DMA_FROMDEVICE);
		pkt = (struct iwl_rx_packet *)rxb->skb->data;
		pkt = (struct iwl_rx_packet *)rxb->skb->data;