Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp635590img; Thu, 28 Feb 2019 05:31:56 -0800 (PST) X-Google-Smtp-Source: AHgI3IYvn8VqA+tnfAq7Law+JM36SD5OoxrYDZCXAr7IHjLteOQj+5t+x/JmZLGb42wZuEcix8ES X-Received: by 2002:aa7:8849:: with SMTP id k9mr7435032pfo.149.1551360716166; Thu, 28 Feb 2019 05:31:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551360716; cv=none; d=google.com; s=arc-20160816; b=aRAqn2BRt0IUQHf0a/BC97yjuslk6jon8PWwukU7TvvnVMeS8Sb6VON0syjV+IdtI3 6pqPSHK/8tFRhXNrYYp+k3u+FvMRcdi+UG+SYRV1+PvlY62oK+r4HoQzZdm7sc6LESfS vwmFtLk00UsO3gQUElPqiZpb/aiebYwYOWPq3ktOZCbqDliEbv9UrnxzWjDlqzFH92s/ 7NOZeQjOyEIgz5hUmwhix1imcdeM0QsuhiT2a4IWzbV+j+mJbteHLWtoHRgYjARoc0Cu uJfo2JX3bGNYoKDqHiD9UZuB2hWQagQiYca01XLOJZSP7tsdrAkym3k4UyC5Il4SA+Rp S10w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=zva7pU8MPayaoNhXQ+lxOMvy/n9APdGGk7pVRcyCCEs=; b=lLExFtbtJkouIeNwWxHxyK635cM0aOrE3SLGDCUn6FAVNdiSaYLW8098pf8sz7lVll MCClf0BGmvEFfW7Gc4EqfU4SnUGgRof5NUIPNZTx+AFjFmBq9jS99vVxC05AIfctgNiC ghftRKJUIlg+rhLCJHBFgL34S7rPoVy19wtGBQfcentP2ol8CZ2L/WOLmUdmDslUYqmb 9Kn3hYcGWsAPvte40wIoqrI1oPfQyXLiLQloUg0JWkY+0vtfshkwXPk+P9h0c1wECTSF wvPRM1D4aZv7FunutLqErrv4BXnmZSrjxWTw+rcaNj1rQKggPuSFZc3ieC1mE48o+QF0 KDvA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f21si15597362pgv.28.2019.02.28.05.31.40; Thu, 28 Feb 2019 05:31:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730284AbfB1NZc (ORCPT + 99 others); Thu, 28 Feb 2019 08:25:32 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:55253 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732834AbfB1NZ1 (ORCPT ); Thu, 28 Feb 2019 08:25:27 -0500 X-Originating-IP: 90.88.147.150 Received: from localhost (aaubervilliers-681-1-27-150.w90-88.abo.wanadoo.fr [90.88.147.150]) (Authenticated sender: antoine.tenart@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id E1417240019; Thu, 28 Feb 2019 13:25:23 +0000 (UTC) From: Antoine Tenart To: davem@davemloft.net, linux@armlinux.org.uk Cc: Antoine Tenart , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, maxime.chevallier@bootlin.com, gregory.clement@bootlin.com, miquel.raynal@bootlin.com, nadavh@marvell.com, stefanc@marvell.com, ymarkman@marvell.com, mw@semihalf.com Subject: [PATCH net-next 09/15] net: mvpp2: always disable both MACs when disabling a port Date: Thu, 28 Feb 2019 14:21:22 +0100 Message-Id: <20190228132128.30154-10-antoine.tenart@bootlin.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190228132128.30154-1-antoine.tenart@bootlin.com> References: <20190228132128.30154-1-antoine.tenart@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch modifies the port_disable() helper to always disable both the GMAC and the XLG MAC when called. At boot time we do not know of a port was enabled in the firmware/bootloader, and if so what mode was used (hence which of the two MACs was used). This also help in implementing a logic where all blocks are disabled when not used, and only enabled regarding the current mode used on a given port. Signed-off-by: Antoine Tenart --- drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c index 11284918d907..b27966355df9 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c @@ -1214,11 +1214,11 @@ static void mvpp2_port_disable(struct mvpp2_port *port) /* Disable & reset should be done separately */ val &= ~MVPP22_XLG_CTRL0_MAC_RESET_DIS; writel(val, port->base + MVPP22_XLG_CTRL0_REG); - } else { - val = readl(port->base + MVPP2_GMAC_CTRL_0_REG); - val &= ~(MVPP2_GMAC_PORT_EN_MASK); - writel(val, port->base + MVPP2_GMAC_CTRL_0_REG); } + + val = readl(port->base + MVPP2_GMAC_CTRL_0_REG); + val &= ~(MVPP2_GMAC_PORT_EN_MASK); + writel(val, port->base + MVPP2_GMAC_CTRL_0_REG); } /* Set IEEE 802.3x Flow Control Xon Packet Transmission Mode */ -- 2.20.1