Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1684832pxb; Wed, 10 Feb 2021 14:17:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJxeHGUVfJSFSmjDOBWwE9zDf3UKfivAeNQHmvAwVHg+56E9GUDQWJfg2l47Sl73bYeQc6tH X-Received: by 2002:a05:6402:2285:: with SMTP id cw5mr5281494edb.275.1612995433575; Wed, 10 Feb 2021 14:17:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612995433; cv=none; d=google.com; s=arc-20160816; b=c50Spv+e2zZKH1n+A5eJKmlxHtE3Zo0DUTb7402YhclMvC7ttzZZT86lyDqNbyNzTU la12UOXxy5gIlxgEK2FggVq+Lew0FTmAnXHfjLEIjLtwhQaQ7wtILE/w8vINIfe7eUw9 c1GzPZQQID1M4l4XDBGKNnaiuhOnaxuHSV5FSvz0xOarwHQ0TyFoY7m5Xd3wyUod2oiW HQcQczrhwhwFFYNJT6yUw9GQGKWCQZvHeRng3oLHEkuJ4iJzh+pdUwgWXatDxvVQ1f/4 Quod2QIXzbvzYtsQH3lcKxlAJQPMGegUerOMltaYTdvlGT4bfef0vYvIYh5TQ2xXM8QW SJUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=PaLOa/S1w4DYmyK1OhTbsz/imnCavnMf6Yt4Pjf3iHg=; b=xmpXMoDiG2H1B6Ojk2ETzQBSkhTKr9imLpEYwMM9ZTP4VDm3inRoKdip58PyIpBpRV rtjtm69SZxf7JFBEQg39fdqvS+/3BSrO4+G1U1C5pLNycmkKZ6z0VB7keZlPSAh0Qqrx hnsVKB07s6nCeMvxWwfBthSj4RAC9r40fijOpgw/UXGaVP1eziRDuW95wEj12mkHYcNO ezX6RT/a5xMxlyJ+xoZe6AqaFgGE3O9PzQA/VLw4et86FNMnDGZ1CAFIjaLaOdiSpeM7 Ne3mCm0sLz73WNnc1dRNIWvXs1SURgKUnOAm/pGfFKbqaZmGJDRRsj/zhP0ZzPIGA9GA J5Gw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m15si2235848edc.599.2021.02.10.14.16.49; Wed, 10 Feb 2021 14:17:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233189AbhBJWPm (ORCPT + 99 others); Wed, 10 Feb 2021 17:15:42 -0500 Received: from mail.baikalelectronics.com ([87.245.175.226]:35476 "EHLO mail.baikalelectronics.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230229AbhBJWPk (ORCPT ); Wed, 10 Feb 2021 17:15:40 -0500 Date: Thu, 11 Feb 2021 01:14:55 +0300 From: Serge Semin To: Jisheng Zhang CC: Serge Semin , Rob Herring , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Johan Hovold , Maxime Ripard , Joao Pinto , Lars Persson , Maxime Coquelin , Alexey Malahov , Pavel Parkhomenko , Vyacheslav Mitrofanov , , , , , 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-Type: text/plain; charset="us-ascii" 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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 > > >