Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2278604pxp; Mon, 21 Mar 2022 15:42:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzahkefF5peQcKnFoZR1OTeUYYVTOodbrmNCAeHt07Yj/bCx9TqTuFJK1fFqzJXQtzIrY86 X-Received: by 2002:a05:6a00:1695:b0:4f7:decc:506b with SMTP id k21-20020a056a00169500b004f7decc506bmr26123097pfc.7.1647902564864; Mon, 21 Mar 2022 15:42:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647902564; cv=none; d=google.com; s=arc-20160816; b=u+CuCGETwjuoqQl+eWxSji+imt5fCM40ZdGF2nUhWYC/4nSorv4qMQAToKZ3zXbwu3 pivG2RnFC/UdWrG9Dtx8S4eZ0ZZmkao/Bb0yN8+nN1UN2LXFtA0LudksKkof3OfGELLs 6ErhFX6fZP+1qCJRCXd9ZJl+NdTz+bUDBQmiY3vDe2qtiUSiz7zzIkuWno921Ery57zy gJLPlgU9b29MIL1jkq2BPHBAzX0YWCQCqv8rKkFk/Kbl5heYZoFPvEhH0sz2oizyHVYV vcHzLPCW0DYpmrA7gc1HQLDKZOG4rNeiICjEcwHWp9noPibyvLRFNo5ecuuYIHJwPIrD Fd2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=0lV6oqOb/gA0P3GBGNozH0pFCDiLl4ZbALU/dFO5iCM=; b=AJYjeDQ2D/c6JIuKkvFlsnRSWQBcKLYc+WuE8XU0cQ0wUe4hKt0TQHq12XgAyeNZl9 D9Zhd58dsmIkpVIgpga1KYaDXAk39XDluCIOV7q0IYgyjgbHeVnlXWJe2ekSl3H8geiv RcMg4Qb8xk3t+o3nFvx/Sm60dFsK2Xav+ZJiTJAND/7H0KWNn5vMGMvlGnSCWqQMW4Pg hx5Y7iYWR/YXjeQsJpCJc2mKOOb8FRYG8/Uo9ft+EN4iwEoCdhzqEW56UCuoeNZz994Q dHHGiRBxPqYZUuNQtBqecIB+lCjNmLl5Op/f3FFxBu2rgjSP0bPW7MmS23Zdq9snikVR 7RoA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id v4-20020a1709028d8400b00153b2d164f9si11388105plo.257.2022.03.21.15.42.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 15:42:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C49382ECF8B; Mon, 21 Mar 2022 14:55:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345161AbiCUIRS convert rfc822-to-8bit (ORCPT + 99 others); Mon, 21 Mar 2022 04:17:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345199AbiCUIRI (ORCPT ); Mon, 21 Mar 2022 04:17:08 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C98A12153C for ; Mon, 21 Mar 2022 01:15:18 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nWDBd-0004Zy-AB; Mon, 21 Mar 2022 09:14:45 +0100 Received: from [2a0a:edc0:0:900:1d::4e] (helo=lupine) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1nWDBW-0023Fj-7t; Mon, 21 Mar 2022 09:14:39 +0100 Received: from pza by lupine with local (Exim 4.94.2) (envelope-from ) id 1nWDBW-0001PK-AO; Mon, 21 Mar 2022 09:14:38 +0100 Message-ID: <84f2c72ced35506522ea3a6be72879d1699f885b.camel@pengutronix.de> Subject: Re: [PATCH 1/2] net: mdio: add reset deassertion for Aspeed MDIO From: Philipp Zabel To: Dylan Hung , robh+dt@kernel.org, joel@jms.id.au, andrew@aj.id.au, andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: BMC-SW@aspeedtech.com, stable@vger.kernel.org Date: Mon, 21 Mar 2022 09:14:38 +0100 In-Reply-To: <20220321070131.23363-2-dylan_hung@aspeedtech.com> References: <20220321070131.23363-1-dylan_hung@aspeedtech.com> <20220321070131.23363-2-dylan_hung@aspeedtech.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dylan, On Mo, 2022-03-21 at 15:01 +0800, Dylan Hung wrote: > Add reset deassertion for Aspeed MDIO.  There are 4 MDIO controllers > embedded in Aspeed AST2600 SOC and share one reset control register > SCU50[3]. So devm_reset_control_get_shared is used in this change. > > Signed-off-by: Dylan Hung > Cc: stable@vger.kernel.org > --- >  drivers/net/mdio/mdio-aspeed.c | 8 ++++++++ >  1 file changed, 8 insertions(+) > > diff --git a/drivers/net/mdio/mdio-aspeed.c b/drivers/net/mdio/mdio- > aspeed.c > index e2273588c75b..8ac262a12d13 100644 > --- a/drivers/net/mdio/mdio-aspeed.c > +++ b/drivers/net/mdio/mdio-aspeed.c > @@ -3,6 +3,7 @@ >   >  #include >  #include > +#include >  #include >  #include >  #include > @@ -37,6 +38,7 @@ >   >  struct aspeed_mdio { >         void __iomem *base; > +       struct reset_control *reset; >  }; >   >  static int aspeed_mdio_read(struct mii_bus *bus, int addr, int > regnum) > @@ -120,6 +122,12 @@ static int aspeed_mdio_probe(struct > platform_device *pdev) >         if (IS_ERR(ctx->base)) >                 return PTR_ERR(ctx->base); >   > +       ctx->reset = devm_reset_control_get_shared(&pdev->dev, NULL); The device tree bindings should have a required reset control property documented before this is added. > +       if (IS_ERR(ctx->reset)) > +               return PTR_ERR(ctx->reset); > + > +       reset_control_deassert(ctx->reset); > + This is missing a corresponding reset_control_assert() in aspeed_mdio_remove() and in the error path of of_mdiobus_register(). That would allow to assert the reset line again after all MDIO controllers are unbound. regards Philipp