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=-14.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 714B0C433DB for ; Wed, 10 Feb 2021 22:16:09 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 351BB64DF0 for ; Wed, 10 Feb 2021 22:16:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 351BB64DF0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baikalelectronics.ru Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/QtwWWVHJP3KIrIVfudXU9hV/iWgToirooOE6sq1HJo=; b=yr+JNBnR9vQ6jTge9wUhMTW+2 kfoyvinnM4a4HW4nFCKVK8d+9XMxJfAO6qKyenIO/Bt93BSUDuDj4xba49FqD+ah/TsEpcx5W41S+ sNwBJqtYuIVSrXhTxPPASFQapGQ+a5X1Dtm/lMQAafQkleGLCQtXOPdU07jhZKNAHsgh23eMJayBq DV0Mk0/TwBzOnb2+YrOS84lI8nPsLCzNynHMYWRZHYz6M84TW+I+/zj/01xfuMFXN7fKR12Osi6hc zzlnvyLNpgi9EVEr5mBHvcnRQ/7Q9FAxVtKksuOR/aZrCiqZUve5ugK/m+GfmLeRdcOU+fFXNOthR ig0Uwe8JQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9xlE-0003JR-Ke; Wed, 10 Feb 2021 22:15:00 +0000 Received: from mail.baikalelectronics.com ([87.245.175.226] helo=mail.baikalelectronics.ru) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9xlB-0003Ig-Tz for linux-arm-kernel@lists.infradead.org; Wed, 10 Feb 2021 22:14:58 +0000 Date: Thu, 11 Feb 2021 01:14:55 +0300 From: Serge Semin To: Jisheng Zhang Subject: Re: [PATCH v2 16/24] net: stmmac: Use optional reset control API to work with stmmaceth Message-ID: <20210210221455.jo22rq6eey3ujqmt@mobilestation> References: <20210208135609.7685-1-Sergey.Semin@baikalelectronics.ru> <20210208135609.7685-17-Sergey.Semin@baikalelectronics.ru> <20210210144924.6b8e7a11@xhacker.debian> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210210144924.6b8e7a11@xhacker.debian> X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210210_171458_231745_A3AB821E X-CRM114-Status: GOOD ( 21.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxime Ripard , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Alexandre Torgue , Joao Pinto , netdev@vger.kernel.org, Lars Persson , linux-stm32@st-md-mailman.stormreply.com, Johan Hovold , Rob Herring , Alexey Malahov , Jose Abreu , Serge Semin , Maxime Coquelin , Jakub Kicinski , Giuseppe Cavallaro , Vyacheslav Mitrofanov , "David S. Miller" , linux-arm-kernel@lists.infradead.org, Pavel Parkhomenko Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Feb 10, 2021 at 02:49:24PM +0800, Jisheng Zhang wrote: > Hi, > > On Mon, 8 Feb 2021 16:56:00 +0300 Serge Semin wrote: > > > > > > Since commit bb3222f71b57 ("net: stmmac: platform: use optional clk/reset > > get APIs") a manual implementation of the optional device reset control > > functionality has been replaced with using the > > devm_reset_control_get_optional() method. But for some reason the optional > > reset control handler usage hasn't been fixed and preserved the > > NULL-checking statements. There is no need in that in order to perform the > > reset control assertion/deassertion because the passed NULL will be > > considered by the reset framework as absent optional reset control handler > > anyway. > > > > Fixes: bb3222f71b57 ("net: stmmac: platform: use optional clk/reset get APIs") > > The patch itself looks good, but the Fix tag isn't necessary since the > patch is a clean up rather than a bug fix. Can you please drop it in next > version? Ok. I'll remove it. -Sergey > > Thanks > > > Signed-off-by: Serge Semin > > --- > > .../net/ethernet/stmicro/stmmac/stmmac_main.c | 19 ++++++++----------- > > 1 file changed, 8 insertions(+), 11 deletions(-) > > > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > > index 4f1bf8f6538b..a8dec219c295 100644 > > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > > @@ -4935,15 +4935,13 @@ int stmmac_dvr_probe(struct device *device, > > if ((phyaddr >= 0) && (phyaddr <= 31)) > > priv->plat->phy_addr = phyaddr; > > > > - if (priv->plat->stmmac_rst) { > > - ret = reset_control_assert(priv->plat->stmmac_rst); > > - reset_control_deassert(priv->plat->stmmac_rst); > > - /* Some reset controllers have only reset callback instead of > > - * assert + deassert callbacks pair. > > - */ > > - if (ret == -ENOTSUPP) > > - reset_control_reset(priv->plat->stmmac_rst); > > - } > > + ret = reset_control_assert(priv->plat->stmmac_rst); > > + reset_control_deassert(priv->plat->stmmac_rst); > > + /* Some reset controllers have only reset callback instead of > > + * assert + deassert callbacks pair. > > + */ > > + if (ret == -ENOTSUPP) > > + reset_control_reset(priv->plat->stmmac_rst); > > > > /* Init MAC and get the capabilities */ > > ret = stmmac_hw_init(priv); > > @@ -5155,8 +5153,7 @@ int stmmac_dvr_remove(struct device *dev) > > stmmac_exit_fs(ndev); > > #endif > > phylink_destroy(priv->phylink); > > - if (priv->plat->stmmac_rst) > > - reset_control_assert(priv->plat->stmmac_rst); > > + reset_control_assert(priv->plat->stmmac_rst); > > if (priv->hw->pcs != STMMAC_PCS_TBI && > > priv->hw->pcs != STMMAC_PCS_RTBI) > > stmmac_mdio_unregister(ndev); > > -- > > 2.29.2 > > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel