From mboxrd@z Thu Jan 1 00:00:00 1970 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.5 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,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 45C6DC433E0 for ; Tue, 9 Feb 2021 03:34:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F23D564E9D for ; Tue, 9 Feb 2021 03:34:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231132AbhBIDdj (ORCPT ); Mon, 8 Feb 2021 22:33:39 -0500 Received: from new2-smtp.messagingengine.com ([66.111.4.224]:33779 "EHLO new2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230491AbhBIDZs (ORCPT ); Mon, 8 Feb 2021 22:25:48 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id 8DDFF58015A; Mon, 8 Feb 2021 22:24:31 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 08 Feb 2021 22:24:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= to:cc:references:from:subject:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=4 DiscTR6+K04v5pQyWV0iTVaBBWAg9lBcNkZsN81LHA=; b=F88+D0aHTMKL++WnJ //N/yaD06mgxOst6EWNCoy54TfJiTwiEgNTkoIaXHJbxWinTfy0agykHsbZj0+6C dSisvfGKwcqoVSW7zk0sL+fjnnb/ZZcQiAg5DG0LHTtLzuXFLBaakdmBAD7aQOAi jUhRjIic6Rau8bphEVExAl3v2rNp5AayWl7cvKdzoSZzQ4xBkgFxK+1SAW6LPZ4D QiiWmt2n3OdFCqerz1YPEAADpTIR1V1IgUYcMcgRHsAf6rYVrH4YIK/66eA8EH5V x0pxbFstD4EFqJXK/bf5GwRT49dXF5WRL6gDcvoP8G1zXOs9hJxdR4Y+xaQjxUyr AZBAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :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=4DiscTR6+K04v5pQyWV0iTVaBBWAg9lBcNkZsN81L HA=; b=bfP1WHpoS9jpHZpGxcwwvDuyDOE0Q0Ip6tGyfjnNgUcVzY7Cg2lYtU6cm mp19CLQQ9Qe/Z/oFt6z/xCbqkb0dFx8b5bVhPhT6py96z01HLu//3RLO5Ur3GC1M OOrlZOTfoh2bva8nZyMQXCbn4Al0mPZO2/5yNP1+5yq1xVR1bznaIk+Wq4KBU2YR iVt2wkdiERMJTKsd8iA310Svci6QTsSIxIuFwhI6xmcoUDjJW3DgNAUAHPOddUnQ P1A5DFWXbtPq87/1IU+05HWslDCLFuVkQ8onfd14kFxQYwgY1no/t/0/tIU/kHL7 zwHKVprFmX8AGPQVOHMJNVuR7ogJg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrheeggdeitdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefvfhfhuffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpedvtddtjeeiuddugfffveetkeffgeffgedutdfgfeekudevudekffeh tdefveeuvdenucfkphepjedtrddufeehrddugeekrdduhedunecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshgrmhhuvghlsehshhholhhlrghn ugdrohhrgh X-ME-Proxy: Received: from [70.135.148.151] (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) by mail.messagingengine.com (Postfix) with ESMTPA id 2FD4B240057; Mon, 8 Feb 2021 22:24:28 -0500 (EST) To: Alexander Duyck Cc: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Corentin Labbe , Ondrej Jirman , Netdev , linux-arm-kernel@lists.infradead.org, LKML , linux-sunxi@googlegroups.com References: <20210208062859.11429-1-samuel@sholland.org> <20210208062859.11429-5-samuel@sholland.org> From: Samuel Holland Subject: Re: [PATCH net-next RESEND 3/5] net: stmmac: dwmac-sun8i: Use reset_control_reset Message-ID: Date: Mon, 8 Feb 2021 21:24:27 -0600 User-Agent: Mozilla/5.0 (X11; Linux ppc64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/8/21 10:29 AM, Alexander Duyck wrote: > On Sun, Feb 7, 2021 at 10:32 PM Samuel Holland wrote: >> >> 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; >> } > > I'm assuming you have exclusive access to the phy and this isn't a > shared line? Just wanting to confirm since the function call has the > following comment in the header for the documentation. Yes, this driver has exclusive access: gmac->rst_ephy = of_reset_control_get_exclusive(iphynode, NULL); And this is a reset line for the Ethernet PHY inside the SoC, that as far as I can tell is not shared with anything else. > * Consumers must not use reset_control_(de)assert on shared reset lines when > * reset_control_reset has been used. > * > > If that is the case it might not hurt to add some documentation to > your call to reset_control_reset here explaining that it is safe to do > so since you have exclusive access. I can expand the comment above this line for v2. Cheers, Samuel