linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sh_eth: fix TX buffer byte-swapping
@ 2015-12-13 18:27 Sergei Shtylyov
  2015-12-13 22:25 ` Rob Landley
  2015-12-15  5:25 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2015-12-13 18:27 UTC (permalink / raw)
  To: netdev; +Cc: linux-sh

For the little-endian SH771x kernels the driver has to byte-swap the RX/TX
buffers,  however yet unset physcial address from the TX descriptor is used
to call sh_eth_soft_swap(). Use 'skb->data' instead...

Fixes: 31fcb99d9958 ("net: sh_eth: remove __flush_purge_region")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
The patch is against Dave Miller's 'net.git' repo.
Although there have been no complaints during 4+ years of this being broken,
I  think it's  probably  worth queuing the patch for  the stable trees...

 drivers/net/ethernet/renesas/sh_eth.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Index: net/drivers/net/ethernet/renesas/sh_eth.c
=================================--- net.orig/drivers/net/ethernet/renesas/sh_eth.c
+++ net/drivers/net/ethernet/renesas/sh_eth.c
@@ -2372,8 +2372,7 @@ static int sh_eth_start_xmit(struct sk_b
 	txdesc = &mdp->tx_ring[entry];
 	/* soft swap. */
 	if (!mdp->cd->hw_swap)
-		sh_eth_soft_swap(phys_to_virt(ALIGN(txdesc->addr, 4)),
-				 skb->len + 2);
+		sh_eth_soft_swap(PTR_ALIGN(skb->data, 4), skb->len + 2);
 	txdesc->addr = dma_map_single(&ndev->dev, skb->data, skb->len,
 				      DMA_TO_DEVICE);
 	if (dma_mapping_error(&ndev->dev, txdesc->addr)) {


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-12-15  5:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-13 18:27 [PATCH] sh_eth: fix TX buffer byte-swapping Sergei Shtylyov
2015-12-13 22:25 ` Rob Landley
2015-12-15  5:25 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).