diff options
author | Krzysztof Hałasa <khc@pm.waw.pl> | 2009-08-23 19:02:13 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-09-15 10:37:19 -0700 |
commit | 832b524a136e7306f66a632a42dbc86fd41b2f3c (patch) | |
tree | 6ba54e0bf8400d4179a4111a31becdb706e38694 | |
parent | 3a5d6b8edb95a602cfb93d4fb3e10fb0c0f3fe65 (diff) |
E100: fix interaction with swiotlb on X86.
[ Upstream commit 6ff9c2e7fa8ca63a575792534b63c5092099c286 ]
E100 places it's RX packet descriptors inside skb->data and uses them
with bidirectional streaming DMA mapping. Data in descriptors is
accessed simultaneously by the chip (writing status and size when
a packet is received) and CPU (reading to check if the packet was
received). This isn't a valid usage of PCI DMA API, which requires use
of the coherent (consistent) memory for such purpose. Unfortunately e100
chips working in "simplified" RX mode have to store received data
directly after the descriptor. Fixing the driver to conform to the API
would require using unsupported "flexible" RX mode or receiving data
into a coherent memory and using CPU to copy it to network buffers.
This patch, while not yet making the driver conform to the PCI DMA API,
allows it to work correctly on X86 with swiotlb (while not breaking
other architectures).
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/net/e100.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index d991167082f..c68c57b45c0 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c @@ -1842,7 +1842,7 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx, nic->ru_running = RU_SUSPENDED; pci_dma_sync_single_for_device(nic->pdev, rx->dma_addr, sizeof(struct rfd), - PCI_DMA_BIDIRECTIONAL); + PCI_DMA_FROMDEVICE); return -ENODATA; } |