Skip to content

Commit f01babe

Browse files
ffainelligregkh
authored andcommitted
net: bgmac: Fix SOF bit checking
commit d2b13233879ca1268a1c027d4573109e5a777811 upstream. 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: 9cde945 ("bgmac: implement scatter/gather support") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Amit Pundir <amit.pundir@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 992048f commit f01babe

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • drivers/net/ethernet/broadcom

drivers/net/ethernet/broadcom/bgmac.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,15 +255,16 @@ static void bgmac_dma_tx_free(struct bgmac *bgmac, struct bgmac_dma_ring *ring)
255255
while (ring->start != ring->end) {
256256
int slot_idx = ring->start % BGMAC_TX_RING_SLOTS;
257257
struct bgmac_slot_info *slot = &ring->slots[slot_idx];
258-
u32 ctl1;
258+
u32 ctl0, ctl1;
259259
int len;
260260

261261
if (slot_idx == empty_slot)
262262
break;
263263

264+
ctl0 = le32_to_cpu(ring->cpu_base[slot_idx].ctl0);
264265
ctl1 = le32_to_cpu(ring->cpu_base[slot_idx].ctl1);
265266
len = ctl1 & BGMAC_DESC_CTL1_LEN;
266-
if (ctl1 & BGMAC_DESC_CTL0_SOF)
267+
if (ctl0 & BGMAC_DESC_CTL0_SOF)
267268
/* Unmap no longer used buffer */
268269
dma_unmap_single(dma_dev, slot->dma_addr, len,
269270
DMA_TO_DEVICE);

0 commit comments

Comments
 (0)