073-v5.12-0008-net-broadcom-bcm4908_enet-fix-endianness-in-xmit-cod.patch 1.1 KB

12345678910111213141516171819202122232425262728
  1. From bdd70b997799099597fc0952fb0ec1bd80505bc4 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
  3. Date: Thu, 11 Feb 2021 13:12:39 +0100
  4. Subject: [PATCH] net: broadcom: bcm4908_enet: fix endianness in xmit code
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Use le32_to_cpu() for reading __le32 struct field filled by hw.
  9. Signed-off-by: Rafał Miłecki <[email protected]>
  10. Reviewed-by: Florian Fainelli <[email protected]>
  11. Signed-off-by: David S. Miller <[email protected]>
  12. ---
  13. drivers/net/ethernet/broadcom/bcm4908_enet.c | 2 +-
  14. 1 file changed, 1 insertion(+), 1 deletion(-)
  15. --- a/drivers/net/ethernet/broadcom/bcm4908_enet.c
  16. +++ b/drivers/net/ethernet/broadcom/bcm4908_enet.c
  17. @@ -476,7 +476,7 @@ static int bcm4908_enet_start_xmit(struc
  18. /* Free transmitted skbs */
  19. while (ring->read_idx != ring->write_idx) {
  20. buf_desc = &ring->buf_desc[ring->read_idx];
  21. - if (buf_desc->ctl & DMA_CTL_STATUS_OWN)
  22. + if (le32_to_cpu(buf_desc->ctl) & DMA_CTL_STATUS_OWN)
  23. break;
  24. slot = &ring->slots[ring->read_idx];