From patchwork Fri Jun 30 05:46:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 106674 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1904910qge; Thu, 29 Jun 2017 22:47:39 -0700 (PDT) X-Received: by 10.99.5.82 with SMTP id 79mr19005051pgf.134.1498801659679; Thu, 29 Jun 2017 22:47:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498801659; cv=none; d=google.com; s=arc-20160816; b=yhOnhWO/HyjZJU9nrKk55cOEBKsJy2xXTCMQYoyF8H4tO2jY4YlA4KRMnGNLn8z9h1 9z/Xb4UM1CwzrwK9fUYggJdJ+NhzV8B/LcxPh7k7T9iPpeSX5VrAGQrkTL+CcR0ZZXFd v7Dm1tDP/x2UC6RUU8+oDk04GEtVyvkTKWN4d5Pun1gix0x07Kd4tOsIBFWdGVsg+h8X zgkNqCm/3xEhtb+MZn4CkpwCsU0pp/v3XzKtixVJysNVTSvFetboUiHlzEEORw3NShV8 Ic5ZsUD+KGA/V7AIirLslsDAL89Oea0nmhFhIpKhksQlAqXpCtJGRNnXHgChbGVhQf4E eO4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=OSb0Th8Oe9x9s1WtowPz07KoA6DdEeYHQc4L822q0+c=; b=IDVbt9cbWYBCLsPOPqegjSURnbau7c8sBUJqoLao755gkveqOQPTBp1ka2GR+EEm1T AIq6d2FA9haHw9dPJwi4NVKrZ5n3IFB2AhsxozGt8A53dUjmMAh/v37vyojUWG4VF2RS 5ASc0vQvvm7tUgiBoRVW+nwMFN1Y6BPGRy8s/vjtzoooNCNwgZBZ+YkIjTemX1kLZXXn rBCn0aW4Ux0Cj81ms5sLPYJecLJDBY/sSHmijjlrFQ94/GAlO/f000Bm7O9oQIDjaVGh HzuiuxR/nZXFdOJC7dBH+aTtyVZ6Hgo8mvLuA6UdRLenbqkJQvOkIuzU1Bx+wpuM1IBk eE6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=A4f0fKTG; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si4519277pgj.463.2017.06.29.22.47.39; Thu, 29 Jun 2017 22:47:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.b=A4f0fKTG; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752089AbdF3Frg (ORCPT + 6 others); Fri, 30 Jun 2017 01:47:36 -0400 Received: from mail-pf0-f182.google.com ([209.85.192.182]:33615 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752086AbdF3Fre (ORCPT ); Fri, 30 Jun 2017 01:47:34 -0400 Received: by mail-pf0-f182.google.com with SMTP id e7so61638369pfk.0 for ; Thu, 29 Jun 2017 22:47:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OSb0Th8Oe9x9s1WtowPz07KoA6DdEeYHQc4L822q0+c=; b=A4f0fKTGWi2b0PzOgXm3NCfGhH9CUtVTb2xRFVRvInh9iPXsVcKN+5AsKARH+N6O4X qfFqAsPq0e0sUw48wem8UcGpI3zEpb7fGmVlBiES5uGzyoEkirHwrcMLlFENXWxmfII7 1tLwYAQt3QbwfnhpTjE7eEc2LruVcTo47ZnfE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=OSb0Th8Oe9x9s1WtowPz07KoA6DdEeYHQc4L822q0+c=; b=lZYdnGIx6qWS2SHqLf1Yy7JVWsUdqNGVN/AEuhI8WSZqXjxORVlJB7dP4ZkUFdoEhs NqQslZ3Nb876BZ4klreoTieEBGxHlETAT3xA1KASS3M3+qxrXZbBjOP7Awy9sw17u8p3 jLsAVVRflh74q6cIZqd++NMEJ3peiY0AAJ5Jvtlgj1l5sIs5vHjp6r92XRGIoKI/fnca VtYXwirBFcnO6raPGRlOMRhXU9+ptKD8aHGV5Xsq49BSxzfQ7SnBw5BsRrMcA2JeRe/i ndodYOmao2pbiMhEyiQjGHA3St48g8BfbGvPqXrxnD31BKjsSpt4eL1S97P/d44ZgWYl 2yNQ== X-Gm-Message-State: AKS2vOz9Wh9mAgMSNgZrMFJF6MnI+H5dPFvOVJaTX10/sF7aW9iy+A6H FDZBXUUMWPr0tDU5 X-Received: by 10.99.125.88 with SMTP id m24mr10518575pgn.269.1498801649145; Thu, 29 Jun 2017 22:47:29 -0700 (PDT) Received: from localhost.localdomain ([106.51.129.233]) by smtp.gmail.com with ESMTPSA id a187sm11405550pgc.37.2017.06.29.22.47.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Jun 2017 22:47:28 -0700 (PDT) From: Amit Pundir To: Greg KH Cc: Stable , Florian Fainelli , "David S . Miller" Subject: [PATCH for-4.4 14/16] net: bgmac: Fix SOF bit checking Date: Fri, 30 Jun 2017 11:16:38 +0530 Message-Id: <1498801600-20896-15-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498801600-20896-1-git-send-email-amit.pundir@linaro.org> References: <1498801600-20896-1-git-send-email-amit.pundir@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Florian Fainelli 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 Signed-off-by: David S. Miller Signed-off-by: Amit Pundir --- drivers/net/ethernet/broadcom/bgmac.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.7.4 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);