[Cbe-oss-dev] [PATCH] apnet: fix byte ordering of apnet_bd->data_ptr

Akinobu Mita akinobu.mita at gmail.com
Fri Aug 20 12:18:52 EST 2010


This patch is against branch 'triblade-2.6.32' of
git://git.kernel.org/pub/scm/linux/kernel/git/arnd/cell-2.6.git

The dma handle of a skb for receive is stored to apnet_bd->data_ptr with
big endian byte order. But it is referenced without byte order conversion.

Actually we get a crash on the x86_64 system using swiotlb without correct
byte order conversion.

Signed-off-by: Akinobu Mita <mita at fixstars.com>
Cc: Arnd Bergmann <arnd at arndb.de>
Cc: Murali Iyer <mniyer at us.ibm.com>
---
 drivers/net/apnet.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/apnet.c b/drivers/net/apnet.c
index 5a53044..c0f6695 100644
--- a/drivers/net/apnet.c
+++ b/drivers/net/apnet.c
@@ -360,7 +360,7 @@ static int apnet_poll(struct napi_struct *napi, int budget)
 		skb->ip_summed = CHECKSUM_UNNECESSARY;
 		netif_receive_skb(skb);
 		adev->astats.inflight_rx_skbs--;
-		axon_dma_unmap_single(adev->if_num, bd->data_ptr,
+		axon_dma_unmap_single(adev->if_num, read64be(&bd->data_ptr),
 				adev->rx_cfg.mtu, DMA_FROM_DEVICE);
 		if (apnet_alloc_rx_skb(ndev, adev->rx_slot))
 			adev->nstats.rx_dropped++;
-- 
1.7.1.231.gd0b16



More information about the cbe-oss-dev mailing list