[PATCH net 0/3] net: bgmac: Random fixes

STALE3723d

3 messages, 2 authors, 2016-06-28 · open the first message on its own page

[PATCH net 0/3] net: bgmac: Random fixes

From: Florian Fainelli <f.fainelli@gmail.com>
Date: 2016-06-23 21:23:22

Hi all,

This patch series fixes a few issues spotted by code inspection and
actual testing.

Thanks

Florian Fainelli (3):
  net: bgmac: Fix SOF bit checking
  net: bgmac: Start transmit queue in bgmac_open
  net: bgmac: Remove superflous netif_carrier_on()

 drivers/net/ethernet/broadcom/bgmac.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

-- 
2.7.4

[PATCH net 1/3] net: bgmac: Fix SOF bit checking

From: Florian Fainelli <f.fainelli@gmail.com>
Date: 2016-06-23 21:23:25

We are checking for the Start of Frame bit in the ctl1 word, while this
bit is set in the ctl0 word instead. Read the ctl0 word and update the
check to verify that.

Fixes: 9cde94506eac ("bgmac: implement scatter/gather support")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/ethernet/broadcom/bgmac.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index ee5f431ab32a..70926c611f25 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -267,15 +267,16 @@ static void bgmac_dma_tx_free(struct bgmac *bgmac, struct bgmac_dma_ring *ring)
 	while (ring->start != ring->end) {
 		int slot_idx = ring->start % BGMAC_TX_RING_SLOTS;
 		struct bgmac_slot_info *slot = &ring->slots[slot_idx];
-		u32 ctl1;
+		u32 ctl0, ctl1;
 		int len;
 
 		if (slot_idx == empty_slot)
 			break;
 
+		ctl0 = le32_to_cpu(ring->cpu_base[slot_idx].ctl0);
 		ctl1 = le32_to_cpu(ring->cpu_base[slot_idx].ctl1);
 		len = ctl1 & BGMAC_DESC_CTL1_LEN;
-		if (ctl1 & BGMAC_DESC_CTL0_SOF)
+		if (ctl0 & BGMAC_DESC_CTL0_SOF)
 			/* Unmap no longer used buffer */
 			dma_unmap_single(dma_dev, slot->dma_addr, len,
 					 DMA_TO_DEVICE);
-- 
2.7.4

Re: [PATCH net 0/3] net: bgmac: Random fixes

From: David Miller <davem@davemloft.net>
Date: 2016-06-28 08:23:29

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Thu, 23 Jun 2016 14:23:11 -0700
This patch series fixes a few issues spotted by code inspection and
actual testing.
Series applied, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help