From patchwork Wed Feb 17 04:20:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 12090949 X-Patchwork-Delegate: kuba@kernel.org 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 B96D1C433E0 for ; Wed, 17 Feb 2021 04:27:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 75CFF64DF3 for ; Wed, 17 Feb 2021 04:27:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230315AbhBQE0g (ORCPT ); Tue, 16 Feb 2021 23:26:36 -0500 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:47597 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231218AbhBQEVP (ORCPT ); Tue, 16 Feb 2021 23:21:15 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 599C0580376; Tue, 16 Feb 2021 23:20:09 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 16 Feb 2021 23:20:09 -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=fm2; bh=n2MqGhQ5o4Ylt VCPJ1jY0hzOaCnyziRkK7pQjX/OSoE=; b=bdWVV8mYOlJeYKBDDjEBZE1OZGm/H VyVacPJAcKwStlWAYmVO4J0XEKavxZyFvlUqZ2O/geyoI/nJEWr5Cm/e3euGhGaj Da4hSRGjKmMIuyA8by20VEgXb7Es5I7lnFl7Dgy3Q4wEp4q4x9IjOfUFgcMLmhyr DJMyziqKAqBJWaH/2HWnAwcFIagsAvT51DnQ1TA7qUYjUAjtjmY/U+lRfieSKxmG SBCkrJOLfcEVci0dL0Gb+oOv/Me/5gqAAukOqpVopXojgxa77XcBn3F4SHc1k9aU m9xDmgornL/t3byZL1CMLxwoJxnS3LKR+kmYmaTK57hJD/z0yooZETBQQ== 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=n2MqGhQ5o4YltVCPJ1jY0hzOaCnyziRkK7pQjX/OSoE=; b=j6p8JpPl us5XEIAth3QRuQQxrso0QlVc5oXFivMY87+BZ/HSYvR2dOV/4b9XREtOnqGh/mm8 G5tZxWdzbJTG9xh9LRhsvPWMDbyDrvRg4RGGDeH5B4SeyAGi/xU+h1Qak9LVYyJF gULM8XgoGrz+UIk/83zbHf7snVojKcfW+9J9yr+ZsCKHVdrwADPMH8bcmN31RWpn AQiKBdugfr72dJ8Wuh4tuudumrxR2WmngtH657WR64uYPGFBBCx96eZZkFaKFw/p l6UA0ZBLFd/vcWMfNp3NVp+TXyQByV7gQn/v2tyVPnoJ/ntqe9PohzzUXMts+3yB DruiMqX/vkx6ew== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrjedugdeikecutefuodetggdotefrodftvf 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 AA6AC240062; Tue, 16 Feb 2021 23:20:07 -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 v2 1/5] net: stmmac: dwmac-sun8i: Return void from PHY unpower Date: Tue, 16 Feb 2021 22:20:02 -0600 Message-Id: <20210217042006.54559-2-samuel@sholland.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210217042006.54559-1-samuel@sholland.org> References: <20210217042006.54559-1-samuel@sholland.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@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 a5e0eff4a3874..8e505019adf85 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 Wed Feb 17 04:20:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 12090935 X-Patchwork-Delegate: kuba@kernel.org 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 A048BC433DB for ; Wed, 17 Feb 2021 04:21:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 54DB064DA8 for ; Wed, 17 Feb 2021 04:21:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231253AbhBQEVZ (ORCPT ); Tue, 16 Feb 2021 23:21:25 -0500 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:54133 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231195AbhBQEVN (ORCPT ); Tue, 16 Feb 2021 23:21:13 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 47724580374; Tue, 16 Feb 2021 23:20:09 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 16 Feb 2021 23:20:09 -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=fm2; bh=OdOwRMbhjRgte /bLoZP0VS2UuOzAJR1c1RX9afQgw+k=; b=awSL0WIhHp0aMGesl//hxx3CGq4JF hI0dIO+pGWIE1lNy9lXcFVlm84lQOql/rDMPTr8s69B741sON3AzaPd+fEgmtVdn ohcZ/Y0ffPZEdcDuuM49m8uBx5+Y64CrKAz2sv0m0QEoVc/xawlnfIg+MI3y+ks8 KiZ5JFFzoEXDloB1wjgMPPo/MZmh1LrdNl5WJHRbB1RSz7m04OLKuZGvemc9/I/e E1xhdQP8hKZdYPXBhCrNUhEvgTqq5xrZcv65+CzJMwj9/feMNAg58r4UPRn44hDH tajHnjIqzsOBJWcvHXchVqNvdzC5LYScprFsgaBwgIOoFZrVj8NO+BHmA== 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=OdOwRMbhjRgte/bLoZP0VS2UuOzAJR1c1RX9afQgw+k=; b=uWOk9hDG 4QxAgqSZ1Kd60sXXxFouoc8WUrta0lHAN6d9obSZL1C0254qdQA/K9PVeGSv2LUZ +3Kx4oxAyKp8KGUJ0bLptfwIt5lmhWsyH9GhUSYAfBm+M2ELfDDwTLVqx964ch6a Rz92s3Mvx2iglGtu9giMiVo5gEritSFfUpNdFcSl8YdMUzDDaliaAPyR9kV+AoZ5 1cSqIdKSyeEc/HgYJQUjkpasH/bkhGon/2SR3XUqbCzN3MQkTtVUh/GRhLvgcGml R6tofDRQfaDGeradgl8FEMnDESwdbIhNbQz/qQP31gtBS50EVJcYCZaWSe4aJtUa ZXynMqrzNklVyw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrjedugdeikecutefuodetggdotefrodftvf 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 45A37240066; Tue, 16 Feb 2021 23:20:08 -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 v2 2/5] net: stmmac: dwmac-sun8i: Remove unnecessary PHY power check Date: Tue, 16 Feb 2021 22:20:03 -0600 Message-Id: <20210217042006.54559-3-samuel@sholland.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210217042006.54559-1-samuel@sholland.org> References: <20210217042006.54559-1-samuel@sholland.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@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 8e505019adf85..3c3d0b99d3e8c 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 Wed Feb 17 04:20:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 12090941 X-Patchwork-Delegate: kuba@kernel.org 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 64625C433DB for ; Wed, 17 Feb 2021 04:24:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 23B5D64DF3 for ; Wed, 17 Feb 2021 04:24:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231169AbhBQEYD (ORCPT ); Tue, 16 Feb 2021 23:24:03 -0500 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:44405 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231224AbhBQEVP (ORCPT ); Tue, 16 Feb 2021 23:21:15 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 763B3580377; Tue, 16 Feb 2021 23:20:09 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 16 Feb 2021 23:20:09 -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=fm2; bh=QxEMMj3Dp9DFj qxYAtIXcSZ4AlixuxTBgKzn45m1S4o=; b=Zv1TjsD6JixTxUQLR7+KV2ldmp0k7 dWfz6Q3T+/eabAN/gygQdgwe77GjcHq/WPbKUZgQtdAU0oHP3Y4wulR7qwhhKf/R e6qAyvtz1YiNX37phIKZ7bz0vYRY7sg35r2ObioVsv82XI+L29IC5W35j04uoB1i XgU5/+qNMT3/eZd1GGfBVGRByay4Pncr7fJE+0BnvIbkZn2eOiXJnLoBZxrEnsq0 YodautgslkgL7dqRizER0oDhqfGFDk6Ixqpm7FEiKuHwQ8OiJNL5MThxeVsArEDW 3mnlBRtMziT7sBtVLovuFapXpx+RLSAPDf9/Ue/Va0He47XwglSxU7nXw== 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=QxEMMj3Dp9DFjqxYAtIXcSZ4AlixuxTBgKzn45m1S4o=; b=htDgzHnq QEFjpNJf1TgckBXIaseY0dgZKHoooiRvz5loptxGbamcAYHeh5USB8C0Fx1DwxQe q2oZ5WxzhIQ7pF4s8KQ+oErcKOMI9y8dGDLXaTaCiC+evNbJH0CyGUUUh4FKPGEh jIV26td48NSyUBLygaPvFlYl15cYJwBidWRVjdtJByPpU7v3rXLT9IjVQ4d10slb +G/I6ELUGpWGmATqays8vKYh1lJJxt8KDSnlHJC8FyPq+rIcowcQuCutwZQbQPMd DRMBtoMteZEC88l7Hg/5L//Dsvql7FwVPvgJs/EWLfd+06ts4qLhOunHMEtPXbH8 6XXFgRy59FxdPQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrjedugdeikecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepufgrmhhuvghl ucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecuggftrf grthhtvghrnhepudfhjeefvdfhgfefheetgffhieeigfefhefgvddvveefgeejheejvdfg jeehueeinecukfhppeejtddrudefhedrudegkedrudehudenucevlhhushhtvghrufhiii gvpedvnecurfgrrhgrmhepmhgrihhlfhhrohhmpehsrghmuhgvlhesshhhohhllhgrnhgu 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 D22EA240064; Tue, 16 Feb 2021 23:20:08 -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 v2 3/5] net: stmmac: dwmac-sun8i: Use reset_control_reset Date: Tue, 16 Feb 2021 22:20:04 -0600 Message-Id: <20210217042006.54559-4-samuel@sholland.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210217042006.54559-1-samuel@sholland.org> References: <20210217042006.54559-1-samuel@sholland.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index 3c3d0b99d3e8c..b61f442ed3033 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -805,12 +805,12 @@ 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. + * + * This assumes the driver has exclusive access to the EPHY reset. */ - 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 Wed Feb 17 04:20:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 12090937 X-Patchwork-Delegate: kuba@kernel.org 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 E2495C433DB for ; Wed, 17 Feb 2021 04:22:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9305F64DF5 for ; Wed, 17 Feb 2021 04:22:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230392AbhBQEWE (ORCPT ); Tue, 16 Feb 2021 23:22:04 -0500 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:49197 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231196AbhBQEVN (ORCPT ); Tue, 16 Feb 2021 23:21:13 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id 70600580379; Tue, 16 Feb 2021 23:20:10 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 16 Feb 2021 23:20:10 -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=fm2; bh=OhQXn3RW7Fq5W eW0YK8stGZwIJtakGlXtoagEETPVuo=; b=qoE60RQqZ21sHfSUKGIC/fJqsB9c5 JLsjRbftMIjxgXG/ts3LQ/1pJhcXTQVh69mrprhXt+86Tb7/AmPZmxYP3tyW/42d sV0iTbePstr5lTOZrxy0hTCdL/oaqqJ7eTWAdwZYtwzQaJtnnQFKkBghFEzM9dyy blbONK0FFXcJ2OFRUax16yzOKXZQQ7wZ64rGotg2WUrL3LnaXvM9HqjSpQH7teq6 YV+lAupP4qLLhgUE1+f6+hAMBCcH2jtwxKAGIdqz/1RiR1dLZ5aDfagRaspUclIl fMkJww20JBBG788xf3KlaKKyTLuwzJMCdo+mCRRp6E7ZfrDVhJN5GdgTg== 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=OhQXn3RW7Fq5WeW0YK8stGZwIJtakGlXtoagEETPVuo=; b=iIrmR/ut BXb1/NPJptHndtb32v18Z6QbJWQzkTmsE0VqqVviJv4b3EChctquJx33xboJ3shK A87AV+HWXEJill+eSuOKi75C54MHXedpqRvCE2BHhC+vB2+ZdeOeQC8FbRj47lVc qtYHQo88LckJfu47l7ZprYGeQB+56oEzU9p2M20DX4yX4Ta/DexZhk1oqhnx+yS4 SOG5c7gF2o2NYQBAewfCX4ROfHjLIg+wltx6s79AmObKlQCK757DV8FFs5x73fi9 byobBoWbhpAsp4e9TL4sNqzNmLWMylOqIH/ZOREIMMzRidl1ANn0Q/nijnCj//aG 8FjfjBpwgVIJEQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrjedugdeijecutefuodetggdotefrodftvf 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 692C024005D; Tue, 16 Feb 2021 23:20:09 -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 v2 4/5] net: stmmac: dwmac-sun8i: Minor probe function cleanup Date: Tue, 16 Feb 2021 22:20:05 -0600 Message-Id: <20210217042006.54559-5-samuel@sholland.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210217042006.54559-1-samuel@sholland.org> References: <20210217042006.54559-1-samuel@sholland.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@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 b61f442ed3033..a3d333b652836 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -1229,6 +1229,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() */ @@ -1247,7 +1248,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 Wed Feb 17 04:20:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 12090951 X-Patchwork-Delegate: kuba@kernel.org 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 1FF47C433E6 for ; Wed, 17 Feb 2021 04:28:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E324464DF5 for ; Wed, 17 Feb 2021 04:28:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231309AbhBQE2A (ORCPT ); Tue, 16 Feb 2021 23:28:00 -0500 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:34083 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231185AbhBQEWU (ORCPT ); Tue, 16 Feb 2021 23:22:20 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 89A7258037B; Tue, 16 Feb 2021 23:20:10 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 16 Feb 2021 23:20:10 -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=fm2; bh=/Ll9sOu6/aNt8 sKVthTKqJ9f/C+c6WcSRYeGV0Onyhk=; b=IcCMWw+oIFDwum354Zkm3Z/pcQJ06 ZI+zzhRgnmzqSSEivC6y2fhlJ1uiigjNjUBwwzbyNdXgX9XX7vquCYo2jU7h0hWk fVkVYBGhMFwoQ/8Iw/WUSSpfvJ2vdV8TY6wUsiAWsYRAjsgSCVwr3FMaM7GQw/mt zq0s11o9WRfh43LxexLB6T8sdWJEEOIphZKmCP34DRAoJ4UNwFKvtOlgq8D8Fdf5 WLENXI5nmD9AGe0mDUfz2/IzSaHOiSeqxNeWe2m/GiIALhDhmmwh+Tbw1z7td8L7 InA/KqNOByil73kSoWoBQ1tLHLRCCpiX64TbrjTdh8wKdayB3oKQWWFmA== 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=/Ll9sOu6/aNt8sKVthTKqJ9f/C+c6WcSRYeGV0Onyhk=; b=FIYYxLsR gnCz93LHiPBAQVKUjCg1/rC6m8VIu1YGLNNhaKJdy7+PzIC5yl2tCxTcRnrW0sSv Ix5tbGdaZ1Elle9p8JCvI4aWZGNK/nJTyPrsA+pX7x5OrzlAXWk12mvkqFu7JmU2 dYrpIYTrt0a/HJR1/aKI2aFVjDXCEyK3Chgps5T+aRDl88jhdd9jsAD/1qSHeeQu 64YWZmF38J4Y63JMYLlxUXXUH+NeYeIFYWVwscuwcxu0UX9A5KkkmHeDKBRvZjFf xrFZIuSYwIRjbehJ7rRBDUqso98ucPGAu8FSTnAaUu2saz30+l6JyNhiyi51jmP9 hF2nrKxCFnqlVA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrjedugdeikecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepufgrmhhuvghl ucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecuggftrf grthhtvghrnhepudfhjeefvdfhgfefheetgffhieeigfefhefgvddvveefgeejheejvdfg jeehueeinecukfhppeejtddrudefhedrudegkedrudehudenucevlhhushhtvghrufhiii gvpedvnecurfgrrhgrmhepmhgrihhlfhhrohhmpehsrghmuhgvlhesshhhohhllhgrnhgu 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 015A2240064; Tue, 16 Feb 2021 23:20:09 -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 v2 5/5] net: stmmac: dwmac-sun8i: Add a shutdown callback Date: Tue, 16 Feb 2021 22:20:06 -0600 Message-Id: <20210217042006.54559-6-samuel@sholland.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210217042006.54559-1-samuel@sholland.org> References: <20210217042006.54559-1-samuel@sholland.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@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 a3d333b652836..6b75cf2603ffc 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -1284,6 +1284,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 }, @@ -1304,6 +1313,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,