All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amit Pundir <amit.pundir@linaro.org>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Stable <stable@vger.kernel.org>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"David S . Miller" <davem@davemloft.net>
Subject: [PATCH for-4.4 14/16] net: bgmac: Fix SOF bit checking
Date: Fri, 30 Jun 2017 11:16:38 +0530	[thread overview]
Message-ID: <1498801600-20896-15-git-send-email-amit.pundir@linaro.org> (raw)
In-Reply-To: <1498801600-20896-1-git-send-email-amit.pundir@linaro.org>

From: Florian Fainelli <f.fainelli@gmail.com>

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: 9cde94506eac ("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>
---
 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 20356755b708..50de83bfcc2e 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -255,15 +255,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

  parent reply	other threads:[~2017-06-30  5:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-30  5:46 [PATCH for-4.4 00/16] Stable commits picked up from lede project Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 01/16] ARM: dts: BCM5301X: Correct GIC_PPI interrupt flags Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 02/16] net: mvneta: Fix for_each_present_cpu usage Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 03/16] MIPS: ath79: fix regression in PCI window initialization Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 04/16] net: korina: Fix NAPI versus resources freeing Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 05/16] MIPS: ralink: MT7688 pinmux fixes Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 06/16] MIPS: ralink: fix USB frequency scaling Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 07/16] MIPS: ralink: Fix invalid assignment of SoC type Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 08/16] MIPS: ralink: fix MT7628 pinmux typos Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 09/16] MIPS: ralink: fix MT7628 wled_an pinmux gpio Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 10/16] mtd: bcm47xxpart: limit scanned flash area on BCM47XX (MIPS) only Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 11/16] mtd: bcm47xxpart: don't fail because of bit-flips Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 12/16] bgmac: fix a missing check for build_skb Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 13/16] bgmac: Fix reversed test of build_skb() return value Amit Pundir
2017-06-30  5:46 ` Amit Pundir [this message]
2017-06-30  5:46 ` [PATCH for-4.4 15/16] net: bgmac: Start transmit queue in bgmac_open Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 16/16] net: bgmac: Remove superflous netif_carrier_on() Amit Pundir
2017-07-03  9:51 ` [PATCH for-4.4 00/16] Stable commits picked up from lede project Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1498801600-20896-15-git-send-email-amit.pundir@linaro.org \
    --to=amit.pundir@linaro.org \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.