From patchwork Tue Jul 17 08:08:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 142116 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3359894ljj; Tue, 17 Jul 2018 01:08:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeYVyU35khUS1gn+tuw+6GtyUfAJz9feEzfK7fckIR7oar5/tYHrJj0Hty3rPmHljOmXFk/ X-Received: by 2002:a17:902:7891:: with SMTP id q17-v6mr654062pll.186.1531814936513; Tue, 17 Jul 2018 01:08:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531814936; cv=none; d=google.com; s=arc-20160816; b=YHB1SKnw989aC7OPaScnXeWD3laIAVE6ln9cDfS9nZDrwsj7O9eJifgbCaPOaQv4Qz 8uUiqSNmOGsgj/oAdlDy6Wg3sFudTwEeDND6vacmtHo7GMI3dLrEyzKno+h1jp4yzk4J KzUnnf3GvO0jp/qLDL0+FkRXwnH+tWoqQ9KZe5PHuj0QFvx0wZ1DDkR33rbYMoLDkf+j fOpuYDoH4pjl1keRkf1FTNLoeKsVMcJZAlQKYgFAvalGbki+NOZLuHn9Ao7f3cESMjDK ROZ7bqsKFDkC8VcxVgcXESZxpKc4gf6SgYVKvQJWKa+MI5b4FUGPzMiOK//Qme2RtmkZ 1S6g== 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=kjyHC2CTB+TeXZkTpurH1FLtNuT/tvE0R5TEbUJKX1k=; b=UBcj289cNczc0nXWap5t2pOnWhdLCmwWt2YutzBZYdNWLkzqt/vAXUexkmNLW3uAW7 kTTrau9mSoFHilIllbGnFRdtJpVi55bL5/d3/vZsD+m9FTXO/ynXxawvTTmm6uG3nz15 o+CbjVxa4sTN8zPnm8+pvNo0ijDLW/pB0RI6igypUGtxCCMgJyUim3VUuaM+20tDVbZr mRqOJx4mvwhuabne1q3eoCIQX3EY5hxexI7nwhVcih44ljJxLjnGJFG6IVxrxgiErSHU YovGRPAI8SP42R0oUMMCPnA9hNkF6q2BhE5aWymkZ5amKRPNLBZkr5+ZriiHWG5KjYJT 0fRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BE+Uf5Nc; 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 j1-v6si309442pll.493.2018.07.17.01.08.56; Tue, 17 Jul 2018 01:08:56 -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.s=google header.b=BE+Uf5Nc; 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 S1729720AbeGQIkR (ORCPT + 13 others); Tue, 17 Jul 2018 04:40:17 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:35298 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729718AbeGQIkR (ORCPT ); Tue, 17 Jul 2018 04:40:17 -0400 Received: by mail-pl0-f66.google.com with SMTP id w3-v6so126605plq.2 for ; Tue, 17 Jul 2018 01:08:55 -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=kjyHC2CTB+TeXZkTpurH1FLtNuT/tvE0R5TEbUJKX1k=; b=BE+Uf5NcXdL6x6IFUErCSJ1SZo22Yzlt/DSTiiTNHJH1J6YJ8VdWvDX2I8iVvYuRDE 0wFuD3c7dGUNO/v009fJO2/dadMNmp8ouKyfDPmCfgmMgl/yzGuqQfQmP46VjDnGfddD zDjGA0478HU/vftZGHCM68HnyivBhAHaOQNt0= 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=kjyHC2CTB+TeXZkTpurH1FLtNuT/tvE0R5TEbUJKX1k=; b=hhq/F+vUdPlDsD4WmGrzs8RYs+21D3IzXia+9th9JNVoBGkNpf/BSUglzwZJVMqJ57 0+fHMF/Xkrpm98Gr8Gj9eqodzYyR3+1+i1gcjXDQVvfiXPeBj4JAn6pQNn/YGerJ3arR B095IRm9UsX5jJiGpj74FrE4rnYPDz5CrPrkyO7tg30+i2bPqztoXjQ2GLTZ2AxRlwJd 7m9b1wiYIvdZQMkru1ZOOLFOIMBgOItfVnsrAV4SloYeILyYJ0jK6+0cJHLVdKqYjONB 2k3vZxWqIpUSmYeP8rqKQhSKOMDyc7O0omM4Q922Xd1EVDaCqXArJuvAXAtxboJISF09 IEHg== X-Gm-Message-State: AOUpUlEcG5/UX9kBO84G8+ovJ17pvPZjFbDXH448z1UUftl/MMK5EbXK HNxXKNh92mFM9KIEy4Y62OEq3+kKSak= X-Received: by 2002:a17:902:8bc6:: with SMTP id r6-v6mr599428plo.257.1531814935139; Tue, 17 Jul 2018 01:08:55 -0700 (PDT) Received: from localhost.localdomain ([106.51.22.240]) by smtp.gmail.com with ESMTPSA id c85-v6sm2205083pfd.110.2018.07.17.01.08.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jul 2018 01:08:54 -0700 (PDT) From: Amit Pundir To: Greg KH , Stable Cc: Jonas Gorski , "David S . Miller" Subject: [PATCH for-4.14.y 5/5] bcm63xx_enet: do not write to random DMA channel on BCM6345 Date: Tue, 17 Jul 2018 13:38:34 +0530 Message-Id: <1531814914-19191-6-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531814914-19191-1-git-send-email-amit.pundir@linaro.org> References: <1531814914-19191-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: Jonas Gorski commit d6213c1f2ad54a964b77471690264ed685718928 upstream. The DMA controller regs actually point to DMA channel 0, so the write to ENETDMA_CFG_REG will actually modify a random DMA channel. Since DMA controller registers do not exist on BCM6345, guard the write with the usual check for dma_has_sram. Signed-off-by: Jonas Gorski Signed-off-by: David S. Miller Signed-off-by: Amit Pundir --- Cherry-picked from lede tree https://git.lede-project.org/?p=source.git drivers/net/ethernet/broadcom/bcm63xx_enet.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c index b7d8b6600be6..68470c7c630a 100644 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c @@ -1062,7 +1062,8 @@ static int bcm_enet_open(struct net_device *dev) val = enet_readl(priv, ENET_CTL_REG); val |= ENET_CTL_ENABLE_MASK; enet_writel(priv, val, ENET_CTL_REG); - enet_dma_writel(priv, ENETDMA_CFG_EN_MASK, ENETDMA_CFG_REG); + if (priv->dma_has_sram) + enet_dma_writel(priv, ENETDMA_CFG_EN_MASK, ENETDMA_CFG_REG); enet_dmac_writel(priv, priv->dma_chan_en_mask, ENETDMAC_CHANCFG, priv->rx_chan);