Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp636858img; Thu, 28 Feb 2019 05:33:07 -0800 (PST) X-Google-Smtp-Source: AHgI3IY1WIc7FRgr2PE35fQdSaXF55thTPpy8CUT1Shl7fb17awCo7A46iAkk0Ega6bsb4sHAfCS X-Received: by 2002:a17:902:2a47:: with SMTP id i65mr8130433plb.237.1551360787854; Thu, 28 Feb 2019 05:33:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551360787; cv=none; d=google.com; s=arc-20160816; b=us8zGG7QLbnI2zxlMpTRXaw/StbxOieB1h0+pEFGwpEH33X2wsG7dV8JzyM4SfYxmT WjOsSJRxComaE/Pis/ZTW13JpGrjknHCzVxxu8kauawknvjfeJdezPcECf5HwzngNWmN yjxapy6rPUAs07G43ymfMW5QE7lJqIpU1r0AmIdIxHgbhRIOSW1DwJ+ixzJgzb6DOkBS L9de+djufCHzxeoX0M/m6YKNbgsgKlA602BPCj6SasRy3y5bbp0Qfo/uDtV0574tGrEr Ha33g6io9BKeqrMTqBdwV+eLU90sxUoC0yLLCzT7Xur7sZ7cLf9P7Z29jJ9RLsHUun4P M9Cg== 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=rWNwEMTrPJjVPsYk865HNZRanUGEEoZOtvC598VScNQ=; b=0AnB/UPmHHB9a1S3MG9PhyWHjGxb6pvaC9Ct6I3KTIqQXNQAZ5WogUxt10wX5OBDV+ dXLNVEK514qil0idzy2KiJroECY3aAYygxQ8ZR/sOWOE8YrYduRoJKa6KVpK1VjWmm1X ESMeHtGUKlWsxSW86qgvgqtHMseBSUvf8yunQj2ogyMtw6N8+3rpMD31JM98+wIXrN24 Yq7zeowkSeb1U6AxmxSfo8hYB4hbvu0+XTDL6fe2qJNEua2NL0D8izBsC+wbWBvcgkhG 51OvIx9Q3lqPRfUwvUDYDkzmttTLgo7VrCx8hOZQLWsAC4HRoObZGd+076HfVGeeQdzc k5Ow== 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 n20si17867192pgb.78.2019.02.28.05.32.52; Thu, 28 Feb 2019 05:33:07 -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 S1732949AbfB1NZr (ORCPT + 99 others); Thu, 28 Feb 2019 08:25:47 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:50299 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732911AbfB1NZp (ORCPT ); Thu, 28 Feb 2019 08:25:45 -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 relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 0F31EFF80F; Thu, 28 Feb 2019 13:25:41 +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 15/15] net: mvpp2: set the GMAC, XLG MAC, XPCS and MPCS in reset when a port is down Date: Thu, 28 Feb 2019 14:21:28 +0100 Message-Id: <20190228132128.30154-16-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 adds calls in the stop() helper to ensure both MACs and both PCS blocks are set in reset when the user manually sets a port down. This is done so that we have the exact same block reset states at boot time and when a port is set down. Signed-off-by: Antoine Tenart --- drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c index 29d32cb3d52b..c10fd894c86f 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c @@ -3257,6 +3257,7 @@ static void mvpp2_stop_dev(struct mvpp2_port *port) if (port->phylink) phylink_stop(port->phylink); + phy_power_off(port->comphy); } @@ -3520,6 +3521,9 @@ static int mvpp2_stop(struct net_device *dev) mvpp2_cleanup_rxqs(port); mvpp2_cleanup_txqs(port); + mvpp2_mac_reset(port); + mvpp22_pcs_reset(port); + cancel_delayed_work_sync(&port->stats_work); return 0; -- 2.20.1