From patchwork Sun Oct 1 11:02:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Gorski X-Patchwork-Id: 9979671 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B4DB560365 for ; Sun, 1 Oct 2017 11:03:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A90D228B77 for ; Sun, 1 Oct 2017 11:03:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9DE4428B7F; Sun, 1 Oct 2017 11:03:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 353F828B77 for ; Sun, 1 Oct 2017 11:03:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=FYE4rRmVCVDKE/RHqXLuaw7IKatEkXpvosQ4wwGI4y4=; b=qtiJ8fWyNaLnikLt4zBBaKCD1B MC8CkO2vmLylgUbiJNea+q9TA6JIX0nsMH/DbyRE9zrZei8I3x+XEvIpgm7zpFGsTi1Drf+oAs+5F HMS7crv3z1W5s34G7Rvaf+Z6DxJJtCMsgPMYEqyvjdZJhAoiHPIryn7Q92o0ZFfTk7Tvs+ooEP+fX XiiVjOL0YlxZYSWrDdHuo/vGVT8gaW8YLvL0C/ja8tzdkqqIMA7mgdj8zfCBEtpYnWds6bDBAL/Jj eVjBpxZuPlBl1yCPsGXtita/6+es5NYRUTD3XR2pjGkqaYG+XSS25S2KWXRbFslfe7i46jaDunL4r zemKeI3w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dyc1m-0005dY-Rb; Sun, 01 Oct 2017 11:03:18 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dyc14-0004vX-5g for linux-arm-kernel@lists.infradead.org; Sun, 01 Oct 2017 11:02:37 +0000 Received: by mail-wm0-x242.google.com with SMTP id i131so1869674wma.1 for ; Sun, 01 Oct 2017 04:02:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fMtTGZPtLfZvaGIYRlnEi9ltVaVqCjAut5cDcthBemM=; b=jDmg8GP8Tu1gElgIphNSz0uCeBBqE/UUmS/8nkzbjSV+DSXaXIGTlnuBS2p5T+cPmC kSIWv2XOzzBt4RJ7ALtZ1iTCxDouer1h48jN8a9/ogE/hyiRdQr1ysa4fCrQKaWORNoa LQ2FVc00lyDDVmjBEFY7IMQaHkbv+X2OGjaBOcG+aUU7STa8HfL52Lc+q0JG8jrWznfP 8225uv9AhDiTQUO3CRNCwuQedhpjEaqiIsuIA5qX8tqhv2lZzt1J/mn/vsm/0/C1hhqg OafsEOviH29jYtjx6/6DNJroGaUpVqnkk7fGkgnED8M3Bv7Kh2JlXp6f6m3RqYtMLBwK 3vRg== 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=fMtTGZPtLfZvaGIYRlnEi9ltVaVqCjAut5cDcthBemM=; b=YbP69ZgS4ynHZoyOqIa4psbURJADkkdfTPnS+v5UBKKPxU3bRoDjJDjOmh0ap6aPKY 70DZo/Wxsym8tlUzYqRFBC+Elnx2Le+5weAKehItolBA8QkRep9ANmJgqC7SCiSnegDO OO5UXIz006IB7hx6M1gc7seABQq2Z9cYtRxPuGner9g+pvI7SWJzn3hdbn5UZy8iYhVN YLfBvO9U48nT2VULORsP/J7EM0xD+1cn47FMgyW8TMeIOPSaulHPM/0XItt1/UJ5Au2X hYwS590DqzvQ/c9zBUwlgEcUVSs/eaRWr1RajPXkTRNbjznB0ElhJf7e5V4uGfGHhKsW ajBQ== X-Gm-Message-State: AHPjjUg88oh6sO2vKmCkFZRLXATokY1bMP3QXwzxcjGp+Kjh73IoZ7yT KyXOrCP+8gUnv9d299HxZPg= X-Google-Smtp-Source: AOwi7QAIctEB0fWGWUk3Cc6xi5NElqsrsZz9h0u73gjf5uBegOcx7cqAjEe23ZJ3AgU4O5Zz7p1pDw== X-Received: by 10.80.165.23 with SMTP id y23mr16569732edb.155.1506855733260; Sun, 01 Oct 2017 04:02:13 -0700 (PDT) Received: from localhost.localdomain ([2001:470:9e39::48e]) by smtp.gmail.com with ESMTPSA id 26sm7404270eds.5.2017.10.01.04.02.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Oct 2017 04:02:12 -0700 (PDT) From: Jonas Gorski To: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.or Subject: [PATCH 2/6] bcm63xx_enet: do not write to random DMA channel on BCM6345 Date: Sun, 1 Oct 2017 13:02:16 +0200 Message-Id: <20171001110220.27668-3-jonas.gorski@gmail.com> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20171001110220.27668-1-jonas.gorski@gmail.com> References: <20171001110220.27668-1-jonas.gorski@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171001_040234_425940_C7EB27DF X-CRM114-Status: GOOD ( 11.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, "David S. Miller" MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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);