From: Jonas Gorski <jonas.gorski@gmail.com>
To: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.or
Cc: "David S. Miller" <davem@davemloft.net>,
Florian Fainelli <f.fainelli@gmail.com>,
bcm-kernel-feedback-list@broadcom.com
Subject: [PATCH 2/6] bcm63xx_enet: do not write to random DMA channel on BCM6345
Date: Sun, 1 Oct 2017 13:02:16 +0200 [thread overview]
Message-ID: <20171001110220.27668-3-jonas.gorski@gmail.com> (raw)
In-Reply-To: <20171001110220.27668-1-jonas.gorski@gmail.com>
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 <jonas.gorski@gmail.com>
---
drivers/net/ethernet/broadcom/bcm63xx_enet.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index a45ec97b5b1e..a1e1e12e187a 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);
--
2.13.2
next prev parent reply other threads:[~2017-10-01 11:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-01 11:02 [PATCH 0/6] bcm63xx_enet: small fixes and cleanups Jonas Gorski
2017-10-01 11:02 ` [PATCH 1/6] bcm63xx_enet: correct clock usage Jonas Gorski
2017-10-01 11:02 ` Jonas Gorski [this message]
2017-10-01 11:02 ` [PATCH 3/6] bcm63xx_enet: do not rely on probe order Jonas Gorski
2017-10-01 11:02 ` [PATCH 4/6] bcm63xx_enet: use managed functions for clock/ioremap Jonas Gorski
2017-10-01 11:02 ` [PATCH 5/6] bcm63xx_enet: drop unneeded NULL phy_clk check Jonas Gorski
2017-10-01 11:02 ` [PATCH 6/6] bcm63xx_enet: remove unneeded include Jonas Gorski
2017-10-02 6:06 ` [PATCH 0/6] bcm63xx_enet: small fixes and cleanups David Miller
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=20171001110220.27668-3-jonas.gorski@gmail.com \
--to=jonas.gorski@gmail.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.or \
--cc=netdev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).