From patchwork Tue Jul 17 08:19:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 142122 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3369156ljj; Tue, 17 Jul 2018 01:19:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfvrq6OJQTgkLv1Hmuza2xlmIYF6ndHrrCi1NF06JS8dkEKZ1bVw9G9tVh9jhA3bcl/1Ve4 X-Received: by 2002:a62:23d1:: with SMTP id q78-v6mr661250pfj.179.1531815581567; Tue, 17 Jul 2018 01:19:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531815581; cv=none; d=google.com; s=arc-20160816; b=uVVARBAoqAv1KeDcOu8zcZ/MNfdxpPASVY6lXGEHH9ALiY3wO1CnEDe9nvRcCr5zMp lQrlqVZE/zibUDO+zOHjRbbEHvtoiT3yV+uvWswCSQ2s0e/4ILuDDR6Cnz0sPaf32Too CxVrebBqckfAWzd70SIwgo5z0HS5GVSBG+4JYBTaSdauSM0egZQP74StyZPDn35g8mmu WkHoint4cqgxKplWZ34nlpm77glYfxA91ygoC0MFzUyl3JEylWhH9Q1lwkTrVXX+LcNT +d6ocAuMbbCf41iRLN4qDE3Vu2gnjBN0C1w6Z2R4oaQb8ELaslpRnE59tl0nao8q+2k0 5NjQ== 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=GshohvMhDiL/WN0iCk7pjvbp+xlgmjSqDRZxOPduqZA=; b=r5+tpzPIQ01Mn3C9cCVuJJE7E5cSjit8KqJP6wiX20aTXBt/UgLkC4z6C3h9pmoWmX Kn8/iG01aTMy+Zvg/kPCM/GFew7euPwe0eL6BI6pjX3wdLuMDA8mQhUwEcWlA1GAJd08 QU6EeiBOjb8eRMuzAip2yf6kJm0Vty52t9AdwQlqQxekDPr38ldmfqGAV/dbzH3oMAe1 R/qAPQ/mp7XaMs1RI5D+4g2ChpkdsuS070n08119Nl06fhxuUdQO4O1SNeocvBr8elVe yRhNFR/1nCWyF61Ud9pmz9xn0G/pBcZpfCK7tWTtJD3gJeZpSHommvVlBEkUtCljuPto He7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H8lNDjkF; 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 r65-v6si381493pfe.298.2018.07.17.01.19.41; Tue, 17 Jul 2018 01:19:41 -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=H8lNDjkF; 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 S1729666AbeGQIvF (ORCPT + 13 others); Tue, 17 Jul 2018 04:51:05 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:36931 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729389AbeGQIvF (ORCPT ); Tue, 17 Jul 2018 04:51:05 -0400 Received: by mail-pl0-f68.google.com with SMTP id 31-v6so137379plc.4 for ; Tue, 17 Jul 2018 01:19:40 -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=GshohvMhDiL/WN0iCk7pjvbp+xlgmjSqDRZxOPduqZA=; b=H8lNDjkFzQdZt12352bzp7SRPU1CiY+N9R0AIJ/e8rFo/FytefzIFrImyrHzAwBEpI 1T8csGRHYYlCFAKV4LjU3BGQ4mTXZF/x/mqRomguO/ik8oHGxexVMWACTJWPlek0XBiD fOfIxELbV7djRsT1C5ryd1RlfEJ1TYpS4B4vE= 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=GshohvMhDiL/WN0iCk7pjvbp+xlgmjSqDRZxOPduqZA=; b=bJ8fQEXMq7REdapA+iq5cILrtQUh6FjKjgAJ+2r2WcY69CMYzoAVUSvcSagjv/JF6d uevkPija2X1dbKYvOxHaZF3HXT8ZCeTSN1N32VQTt98Lso18ZoXGhEKbj4pYrbxdcjv4 I2J+v6yiWthI5r6q4yYbBJYhYHtHrInTL3TDZV7Sp4w3xrGf8pDlDqWu0hgFufbc/WP4 7dGvs8UnQUsy4QyI1GRlLDkpTFjgVPYk9yyrkatCWNgIdlwWcVjlf2h5oXf9F/K6QzOc HKbogXFZENMnwM0YysMih3OP/HlKMUZ9Kv5XXFeIu54ZF7SM3MUzZsU4UMU1jC9rwlYQ jByQ== X-Gm-Message-State: AOUpUlHGN3rnrOSwK3JzDIEDltEGkc6Frhf99uKW5upshNddrJsiVEa/ HWXXQ4MP6JLhn3jCf+m0ZlZWgA== X-Received: by 2002:a17:902:5a1:: with SMTP id f30-v6mr662121plf.167.1531815580188; Tue, 17 Jul 2018 01:19:40 -0700 (PDT) Received: from localhost.localdomain ([106.51.22.240]) by smtp.gmail.com with ESMTPSA id z2-v6sm740263pgv.12.2018.07.17.01.19.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jul 2018 01:19:39 -0700 (PDT) From: Amit Pundir To: Greg KH , Stable Cc: Jonas Gorski , "David S . Miller" Subject: [PATCH for-4.9.y 5/5] bcm63xx_enet: do not write to random DMA channel on BCM6345 Date: Tue, 17 Jul 2018 13:49:18 +0530 Message-Id: <1531815558-20002-6-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531815558-20002-1-git-send-email-amit.pundir@linaro.org> References: <1531815558-20002-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 3760a2be5dbc..c4078401b7de 100644 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c @@ -1063,7 +1063,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);