From patchwork Mon Feb 8 06:28:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 379985 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2BB2C433E6 for ; Mon, 8 Feb 2021 06:30:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AFDBE64DC4 for ; Mon, 8 Feb 2021 06:30:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229777AbhBHGad (ORCPT ); Mon, 8 Feb 2021 01:30:33 -0500 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:55707 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbhBHGaK (ORCPT ); Mon, 8 Feb 2021 01:30:10 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 7E2EB580216; Mon, 8 Feb 2021 01:29:03 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 08 Feb 2021 01:29:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=v7LiBfCgUaEJW aOObaSvz5xohJwmHhm4OefGv0SLrig=; b=qoncyoLDt1Gec0D8z1qI9m76DUgZH AkcK2HARZzk1TpwKDMUljssSG5kcQUtyehQCFgSy+EjUZrh4NLi27plYLAPqtdcu UXmxyyUyXTycBvCaLgPb3pYRiUIzjbxu7xMiW0DgLzBA0zQhVmRdmPNmfBrFDDJd asGOVQ8mNHPaw31gFmPyf/TSCngT4yyvYeBDJMqMz/4eKkcQ6nCoV1foR5Qcn4l3 1tOGw2aG+miStA018T/bTdMmEspG+F0bULyLRJ2TbTOP2sGKL5lY1IFHG+n2NWvs +T52i9+dAUAGQv+5BTLRT0sYa8GiKKtuwiQ7mvbJKDywcGZZ05zEE++mQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=v7LiBfCgUaEJWaOObaSvz5xohJwmHhm4OefGv0SLrig=; b=rVRG0yEO KHdUgBUHPTc1++49VCRNEbO+y3e0aX5gZ/JEbYwVmOYIulqRcEcVukRQ4q3VxsJH 9hc30dfhJunvaWZxSyiQ4TIfmcrB3nWt6lx0F63j+28NM8rwSuRCVjQvveu1sWCg V09xWH+J2T04uKwYUivhuXzcW5ywgfZinrQZniGivNtKmzXlGiKV8catNR4EGK74 C2bwN7vpkrMlP7nb1KbswywmQ3cBpPQRzdrrF21s+S+n6b5bl6PB7qjfKfrvGiEa e0avLOAJYEx0p40H223kD1VOTj6bkDNIJGupFnO/VGmfDDseFU9xYyGGrWLmAVkP n1uRgh0CGEIm5A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrhedvgdelgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepufgrmhhuvghl ucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecuggftrf grthhtvghrnhepudfhjeefvdfhgfefheetgffhieeigfefhefgvddvveefgeejheejvdfg jeehueeinecukfhppeejtddrudefhedrudegkedrudehudenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehsrghmuhgvlhesshhhohhllhgrnhgu rdhorhhg X-ME-Proxy: Received: from titanium.stl.sholland.net (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) by mail.messagingengine.com (Postfix) with ESMTPA id 865F81080057; Mon, 8 Feb 2021 01:29:01 -0500 (EST) From: Samuel Holland To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Corentin Labbe Cc: Ondrej Jirman , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Samuel Holland Subject: [PATCH net-next RESEND 1/5] net: stmmac: dwmac-sun8i: Return void from PHY unpower Date: Mon, 8 Feb 2021 00:28:55 -0600 Message-Id: <20210208062859.11429-3-samuel@sholland.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210208062859.11429-1-samuel@sholland.org> References: <20210208062859.11429-1-samuel@sholland.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This is a deinitialization function that always returned zero, and that return value was always ignored. Have it return void instead. Reviewed-by: Chen-Yu Tsai Signed-off-by: Samuel Holland --- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index a5e0eff4a387..8e505019adf8 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -820,15 +820,14 @@ static int sun8i_dwmac_power_internal_phy(struct stmmac_priv *priv) return 0; } -static int sun8i_dwmac_unpower_internal_phy(struct sunxi_priv_data *gmac) +static void sun8i_dwmac_unpower_internal_phy(struct sunxi_priv_data *gmac) { if (!gmac->internal_phy_powered) - return 0; + return; clk_disable_unprepare(gmac->ephy_clk); reset_control_assert(gmac->rst_ephy); gmac->internal_phy_powered = false; - return 0; } /* MDIO multiplexing switch function From patchwork Mon Feb 8 06:28:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 379040 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, TVD_SUBJ_WIPE_DEBT, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3686EC433DB for ; Mon, 8 Feb 2021 06:31:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CCB1764DD6 for ; Mon, 8 Feb 2021 06:31:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229648AbhBHGar (ORCPT ); Mon, 8 Feb 2021 01:30:47 -0500 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:41913 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229629AbhBHGaK (ORCPT ); Mon, 8 Feb 2021 01:30:10 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id DAD97580218; Mon, 8 Feb 2021 01:29:03 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 08 Feb 2021 01:29:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=T1+J0aCgQkzwe JaAMrWxKE3uyhlZOFmpO4MFCRMyHkA=; b=DPQZimSHHsLfHQ2hQj/iLuW4PrQxX J/qbq/qWtejw03wpEh8FKYWx1ZlrKa37WPXzeHF+xik81sdOwN64LPLBQDMZDScg q4kXOWJOBYhNooYsG+4Vdpp5F6Escsai8h9iurl2ua5AjTNN+YLEucAHTecGY913 iGCcdOsOjf0jRZq4yMCSjd/tIyOahX160zT/QhzqtCox/EYITsMVbF/QOCQd8SZW 8lZIs72KRENWXj6Gg7CHAtZeeA39XbbpLfbFdtleQSyrCB/18nYYEsJsDH5Drm0g 0+SUVpovsaGmklWIT2FK+eUTJ2Y0WKgX/sK0RHa2TpgZ7sL13zKlUlGcA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=T1+J0aCgQkzweJaAMrWxKE3uyhlZOFmpO4MFCRMyHkA=; b=n6yPfuYD rF9T3VZJ46HKecWAilk+3dNBSleZ+wS2Lr/NGycHOfGgSYbRDFT9o/kgYjaUD4JN jYLCumqMSpDixF1jok6vCXUZCERoQmcOTCNFM1h3qsQOy5sCoScvI8dLLQihMCqG 6bxPLjK+EipXsiJwDaJ6Ec3UCak1S61pwZEU+k8t1qeEUFPJHM1M5TwYUZ4y4s6T Ew5VYN8Nw9HP7UBATlT7SpZGJGDChTroR9ttft3GMx1sfHD6E8xeslzF7r+s7x8L nfFz5n1EF7Dz/FWE8mW3vDZXEGhqidR60U0PYJxVRl0SvQdPioYS9bDJYCaxmZtv LoYNDAi6TQHrZA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrhedvgdelgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepufgrmhhuvghl ucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecuggftrf grthhtvghrnhepudfhjeefvdfhgfefheetgffhieeigfefhefgvddvveefgeejheejvdfg jeehueeinecukfhppeejtddrudefhedrudegkedrudehudenucevlhhushhtvghrufhiii gvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehsrghmuhgvlhesshhhohhllhgrnhgu rdhorhhg X-ME-Proxy: Received: from titanium.stl.sholland.net (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) by mail.messagingengine.com (Postfix) with ESMTPA id 2F20B1080063; Mon, 8 Feb 2021 01:29:02 -0500 (EST) From: Samuel Holland To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Corentin Labbe Cc: Ondrej Jirman , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Samuel Holland Subject: [PATCH net-next RESEND 2/5] net: stmmac: dwmac-sun8i: Remove unnecessary PHY power check Date: Mon, 8 Feb 2021 00:28:56 -0600 Message-Id: <20210208062859.11429-4-samuel@sholland.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210208062859.11429-1-samuel@sholland.org> References: <20210208062859.11429-1-samuel@sholland.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org sun8i_dwmac_unpower_internal_phy already checks if the PHY is powered, so there is no need to do it again here. Reviewed-by: Chen-Yu Tsai Signed-off-by: Samuel Holland --- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index 8e505019adf8..3c3d0b99d3e8 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -1018,10 +1018,8 @@ static void sun8i_dwmac_exit(struct platform_device *pdev, void *priv) { struct sunxi_priv_data *gmac = priv; - if (gmac->variant->soc_has_internal_phy) { - if (gmac->internal_phy_powered) - sun8i_dwmac_unpower_internal_phy(gmac); - } + if (gmac->variant->soc_has_internal_phy) + sun8i_dwmac_unpower_internal_phy(gmac); clk_disable_unprepare(gmac->tx_clk); From patchwork Mon Feb 8 06:28:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 379041 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A33C9C433DB for ; Mon, 8 Feb 2021 06:30:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5BB0F64E66 for ; Mon, 8 Feb 2021 06:30:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229756AbhBHGaW (ORCPT ); Mon, 8 Feb 2021 01:30:22 -0500 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:51299 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229615AbhBHGaJ (ORCPT ); Mon, 8 Feb 2021 01:30:09 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id 7FE54580217; Mon, 8 Feb 2021 01:29:03 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 08 Feb 2021 01:29:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=QaX4dbz8bYwhB LwW47Eu9IxjfHORPdrlkULng/kPy4A=; b=UnD7dvmx6ArgPC+GsxA217yceUwGb Ry6k70nj+VI6I7PPvuMXL0TGgU0tC4a102sFwXTkH0bIxGlqzxwcHpOwOP4IyYFX 6ghs1+JCJR2dlcFrfEvVlhSLG4G69ShY1VjfjXzdz+HEYaror7cyVsowHhjPATcb XcgWU4Ayk7/L31vL3OQocbdrFMY4exxJzAVqOFESyq2BaqOQEBqkyWCPJEg4tjsn EaQIBKfGAyw2WY9n7p0SL+8a1cu8yypPhfCH7e/fWv+UvRtS3W1cnws04bP8oDFw zY1aDJonKhuJ/v+XH4JwW071ee5hXVYY9t+eOg+dIqlu27a+bJBOS/Uhg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=QaX4dbz8bYwhBLwW47Eu9IxjfHORPdrlkULng/kPy4A=; b=K8oabRGp 3sOQhRp85wxt/nJekNb+6Jrhua8orbTtMvMmK9CTRXyiWRD0jTGhYUyt5xxgy7x3 SJbnS3xSaqCqqW6m6O0yTZ7tddGNwdYTj9K9Tf445pZHotD+7c762LbuVahXImNw i5Hbcy9bH1FW43PBcwBFgcUqCt3Kyt6QF6Mv95lUNcZ3qUNnf4QhULJxQtaeB3xK QxGzUVFQtosITnXPt2xWjKC1QHNiwrvLpnCEfStrY4lncDpLKiplD8vBwIZCWJSN ZtTv5ppccybYZ/F8ESUtuPeumwOvKB771mLiw8OiX+R4jniAa9AKDxeutG7RUGy8 Af23Z0YBRuN0hQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrhedvgdelgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepufgrmhhuvghl ucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecuggftrf grthhtvghrnhepudfhjeefvdfhgfefheetgffhieeigfefhefgvddvveefgeejheejvdfg jeehueeinecukfhppeejtddrudefhedrudegkedrudehudenucevlhhushhtvghrufhiii gvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehsrghmuhgvlhesshhhohhllhgrnhgu rdhorhhg X-ME-Proxy: Received: from titanium.stl.sholland.net (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) by mail.messagingengine.com (Postfix) with ESMTPA id BB33F1080064; Mon, 8 Feb 2021 01:29:02 -0500 (EST) From: Samuel Holland To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Corentin Labbe Cc: Ondrej Jirman , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Samuel Holland Subject: [PATCH net-next RESEND 3/5] net: stmmac: dwmac-sun8i: Use reset_control_reset Date: Mon, 8 Feb 2021 00:28:57 -0600 Message-Id: <20210208062859.11429-5-samuel@sholland.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210208062859.11429-1-samuel@sholland.org> References: <20210208062859.11429-1-samuel@sholland.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Use the appropriate function instead of reimplementing it, and update the error message to match the code. Reviewed-by: Chen-Yu Tsai Signed-off-by: Samuel Holland --- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index 3c3d0b99d3e8..0e8d88417251 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -806,11 +806,9 @@ static int sun8i_dwmac_power_internal_phy(struct stmmac_priv *priv) /* Make sure the EPHY is properly reseted, as U-Boot may leave * it at deasserted state, and thus it may fail to reset EMAC. */ - reset_control_assert(gmac->rst_ephy); - - ret = reset_control_deassert(gmac->rst_ephy); + ret = reset_control_reset(gmac->rst_ephy); if (ret) { - dev_err(priv->device, "Cannot deassert internal phy\n"); + dev_err(priv->device, "Cannot reset internal PHY\n"); clk_disable_unprepare(gmac->ephy_clk); return ret; } From patchwork Mon Feb 8 06:28:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 379039 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81881C433DB for ; Mon, 8 Feb 2021 06:32:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3B1DE64DDF for ; Mon, 8 Feb 2021 06:32:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229894AbhBHGbt (ORCPT ); Mon, 8 Feb 2021 01:31:49 -0500 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:48879 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229784AbhBHGah (ORCPT ); Mon, 8 Feb 2021 01:30:37 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id F17D058021E; Mon, 8 Feb 2021 01:29:03 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 08 Feb 2021 01:29:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=99nDwIDYp/GCl fWRHK7X+wEzBpp6sch5zVozu7busRs=; b=V4S7YOjqHaQ9rAddwCoAPp2ieEv+i rSb/VGZULwUEzcD2wrvUHgANYLIyjDQEQdbVVtkBBgrLGzyMIvNIGkXGQn0aVtN+ Xa9FUd0M3e2jCnrojYJ8MhiFcOok8EJtWJYFoye6S9t4PFRsHKvzy6EN/1GT01Wm zLXKF0QnVl0me6x6moD4ZYXUr+hpb2e4tG2l/vNzFwlSWd7AoB9EGqBDETqgyfoL EPDCJhAaInVZOL4rXHCN0lr/BSB2v7GsnBXBEOzeVwQxJS/t+eF6+Xi4h50WxfNy QW2SIsY+0bmU2NdWA7mupEYOZoKUCxup1EfIDtkL/oxGeYagWifvlVd2g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=99nDwIDYp/GClfWRHK7X+wEzBpp6sch5zVozu7busRs=; b=LRUVjT5W gszhJ9l7fXpwW1gwmLcNnkFtyT7IVij5aVePuSuPGqT09CeeWQRCIN6c0ABXEQ8F 9Nvpi6bDy22NytWoeQ5y1xuxOQy5vqVBuI4v8QzEZykdjMMwaV1ib8LLhzw++N7t CcM0tfagzGlvpCIxKo0U8QI//IWyE+JvW8T5dmkr2qbanbeApUXhBQxiAx8eqb2l EF8VcQRI+SMfgUiHVsa0P4QFD+8YpvLbLroRMy1/sGAsZtm8yogK1kznCJ4LxLNv ysLH4m2vueNxEaqt19HxW+B6SjQdMZUyMi9kOJXG6oMUk+OelUjh9fHmdUZEg06t WqnqhrQGUKT5tA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrhedvgdelgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepufgrmhhuvghl ucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecuggftrf grthhtvghrnhepudfhjeefvdfhgfefheetgffhieeigfefhefgvddvveefgeejheejvdfg jeehueeinecukfhppeejtddrudefhedrudegkedrudehudenucevlhhushhtvghrufhiii gvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehsrghmuhgvlhesshhhohhllhgrnhgu rdhorhhg X-ME-Proxy: Received: from titanium.stl.sholland.net (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) by mail.messagingengine.com (Postfix) with ESMTPA id 53D331080059; Mon, 8 Feb 2021 01:29:03 -0500 (EST) From: Samuel Holland To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Corentin Labbe Cc: Ondrej Jirman , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Samuel Holland Subject: [PATCH net-next RESEND 4/5] net: stmmac: dwmac-sun8i: Minor probe function cleanup Date: Mon, 8 Feb 2021 00:28:58 -0600 Message-Id: <20210208062859.11429-6-samuel@sholland.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210208062859.11429-1-samuel@sholland.org> References: <20210208062859.11429-1-samuel@sholland.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Adjust the spacing and use an explicit "return 0" in the success path to make the function easier to parse. Reviewed-by: Chen-Yu Tsai Signed-off-by: Samuel Holland --- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index 0e8d88417251..4638d4203af5 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -1227,6 +1227,7 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) ndev = dev_get_drvdata(&pdev->dev); priv = netdev_priv(ndev); + /* The mux must be registered after parent MDIO * so after stmmac_dvr_probe() */ @@ -1245,7 +1246,8 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) goto dwmac_remove; } - return ret; + return 0; + dwmac_mux: reset_control_put(gmac->rst_ephy); clk_put(gmac->ephy_clk); From patchwork Mon Feb 8 06:28:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 379983 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F190C433DB for ; Mon, 8 Feb 2021 06:32:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 258AC64E61 for ; Mon, 8 Feb 2021 06:32:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229968AbhBHGcR (ORCPT ); Mon, 8 Feb 2021 01:32:17 -0500 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:39493 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229815AbhBHGbC (ORCPT ); Mon, 8 Feb 2021 01:31:02 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id A4E0D58021F; Mon, 8 Feb 2021 01:29:04 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 08 Feb 2021 01:29:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=daqee4/YfWrBT wdQcL/9RUOofu39a/j2M6J+Y7w578s=; b=mOCETWsRHXK4ll6tgx3PBs5WM8BVP Zs68YVF+dr/9lrPoJCJEdqjdPXR2VH9s83/iTQ3KWoNpHuWEoNBsUpAbd1ZOZta9 RV5CHm6CrLjSR7dboVOlXlwV3fFDHSXCIUBYDYpvwSRI1YtYKu2lwWRbWB3c+H0S ZQoFsLf4g1H9MPDhvm0sBQ9cfUIEVfUdME5y6iZ/sdUE4grlXXwwPoAvLWrx5Oh9 BawilUWLAZqRfZq0MEC0glVWE2kdjE8RAZDpvUE3TidIOINH+RMYDzZLlkkLWGgb PIbf5NgsgEUfk1nK0NvOJCGD6NAdj05k1pwDnqOjp8IVEpFpgJCK0y1ww== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=daqee4/YfWrBTwdQcL/9RUOofu39a/j2M6J+Y7w578s=; b=SkxXEBDU XYW9Lht4IOQH8B4AePpTXdKNRNIRVSbSNMdA7fBqYy0WAsv3sZxh6LvXbKoI9CcX Zp79b9bCLCgmwvge0Y5PSHnTsqgTbgtV71cQAmWTA22EmQYgABKhJHOv3xy6r86O Q1SES6deavq0VgDXFBiwylBY0/PaKPRniK3xBbGTAo3VmsWnbWtbgmBgHwfTnrlj fdBnFoZrb1dMPJKX5c9QWR5LkaRf6SjJ9L7boUetvepRT3DvjGlV20nZGvv4DuDm cuX5f4d/1+UxCEB66ikInwLs6L80rb6KZ6Q5fLIntTvjrNEUQLFJx70iA27ApOAF dCIciEAzQ1nxEA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrhedvgdelgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepufgrmhhuvghl ucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecuggftrf grthhtvghrnhepudfhjeefvdfhgfefheetgffhieeigfefhefgvddvveefgeejheejvdfg jeehueeinecukfhppeejtddrudefhedrudegkedrudehudenucevlhhushhtvghrufhiii gvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehsrghmuhgvlhesshhhohhllhgrnhgu rdhorhhg X-ME-Proxy: Received: from titanium.stl.sholland.net (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) by mail.messagingengine.com (Postfix) with ESMTPA id E0BAE1080057; Mon, 8 Feb 2021 01:29:03 -0500 (EST) From: Samuel Holland To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Corentin Labbe Cc: Ondrej Jirman , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Samuel Holland Subject: [PATCH net-next RESEND 5/5] net: stmmac: dwmac-sun8i: Add a shutdown callback Date: Mon, 8 Feb 2021 00:28:59 -0600 Message-Id: <20210208062859.11429-7-samuel@sholland.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210208062859.11429-1-samuel@sholland.org> References: <20210208062859.11429-1-samuel@sholland.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The Ethernet MAC and PHY are usually major consumers of power on boards which may not be able to fully power off (those with no PMIC). Powering down the MAC and internal PHY saves power while these boards are "off". Reviewed-by: Chen-Yu Tsai Signed-off-by: Samuel Holland --- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index 4638d4203af5..926e8d5e8963 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -1282,6 +1282,15 @@ static int sun8i_dwmac_remove(struct platform_device *pdev) return 0; } +static void sun8i_dwmac_shutdown(struct platform_device *pdev) +{ + struct net_device *ndev = platform_get_drvdata(pdev); + struct stmmac_priv *priv = netdev_priv(ndev); + struct sunxi_priv_data *gmac = priv->plat->bsp_priv; + + sun8i_dwmac_exit(pdev, gmac); +} + static const struct of_device_id sun8i_dwmac_match[] = { { .compatible = "allwinner,sun8i-h3-emac", .data = &emac_variant_h3 }, @@ -1302,6 +1311,7 @@ MODULE_DEVICE_TABLE(of, sun8i_dwmac_match); static struct platform_driver sun8i_dwmac_driver = { .probe = sun8i_dwmac_probe, .remove = sun8i_dwmac_remove, + .shutdown = sun8i_dwmac_shutdown, .driver = { .name = "dwmac-sun8i", .pm = &stmmac_pltfr_pm_ops,