074-0001-net-bgmac-Fix-SOF-bit-checking.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From d2b13233879ca1268a1c027d4573109e5a777811 Mon Sep 17 00:00:00 2001
  2. From: Florian Fainelli <f.fainelli@gmail.com>
  3. Date: Thu, 23 Jun 2016 14:23:12 -0700
  4. Subject: [PATCH 1/3] net: bgmac: Fix SOF bit checking
  5. We are checking for the Start of Frame bit in the ctl1 word, while this
  6. bit is set in the ctl0 word instead. Read the ctl0 word and update the
  7. check to verify that.
  8. Fixes: 9cde94506eac ("bgmac: implement scatter/gather support")
  9. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
  10. Signed-off-by: David S. Miller <davem@davemloft.net>
  11. ---
  12. drivers/net/ethernet/broadcom/bgmac.c | 5 +++--
  13. 1 file changed, 3 insertions(+), 2 deletions(-)
  14. --- a/drivers/net/ethernet/broadcom/bgmac.c
  15. +++ b/drivers/net/ethernet/broadcom/bgmac.c
  16. @@ -269,15 +269,16 @@ static void bgmac_dma_tx_free(struct bgm
  17. while (ring->start != ring->end) {
  18. int slot_idx = ring->start % BGMAC_TX_RING_SLOTS;
  19. struct bgmac_slot_info *slot = &ring->slots[slot_idx];
  20. - u32 ctl1;
  21. + u32 ctl0, ctl1;
  22. int len;
  23. if (slot_idx == empty_slot)
  24. break;
  25. + ctl0 = le32_to_cpu(ring->cpu_base[slot_idx].ctl0);
  26. ctl1 = le32_to_cpu(ring->cpu_base[slot_idx].ctl1);
  27. len = ctl1 & BGMAC_DESC_CTL1_LEN;
  28. - if (ctl1 & BGMAC_DESC_CTL0_SOF)
  29. + if (ctl0 & BGMAC_DESC_CTL0_SOF)
  30. /* Unmap no longer used buffer */
  31. dma_unmap_single(dma_dev, slot->dma_addr, len,
  32. DMA_TO_DEVICE);