* [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
* Re: [PATCH] sh_eth: fix TX buffer byte-swapping
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
1 sibling, 0 replies; 3+ messages in thread
From: Rob Landley @ 2015-12-13 22:25 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: netdev, Linux-sh list
On Sun, Dec 13, 2015 at 12:27 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> 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...
Rummage rummage rummage...
Ah, my sh4 qemu system has an rtl-8139cp network driver, and the sh2
j-core numato board one is A) big endian, B) has an oddball version
with its own driver.
That's why I haven't hit this.
Rob
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] sh_eth: fix TX buffer byte-swapping
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
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2015-12-15 5:25 UTC (permalink / raw)
To: sergei.shtylyov; +Cc: netdev, linux-sh
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Sun, 13 Dec 2015 21:27:04 +0300
> 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>
Applied.
^ 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).