Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3560678rdh; Thu, 28 Sep 2023 15:59:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGz89p52FsnfRlGbT1ogUxXL86ikKWQQAt7fyI/lqTedfvXltByzDya6+hn41y6YUlspyFA X-Received: by 2002:a17:902:ce84:b0:1c5:7d49:570e with SMTP id f4-20020a170902ce8400b001c57d49570emr4487795plg.29.1695941959553; Thu, 28 Sep 2023 15:59:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695941959; cv=none; d=google.com; s=arc-20160816; b=y34iT78LCwXaB1Scao5wdoqnkwboM6G+0TbhqOVjikCP8dW1jPcgMaYs/smKV1QvwG +upfsVoiIpDMk3E92I/awyD1ld7M552tYJgS9MXv6lPcCUSoadFwLO3YPx+Kzn7fBt9k hJ9OQQo68PIoTuUgp5NrNo2h28La5mpfM39zuylOYriPRSiBkKx2Y68m4ExLGRs9G+fr 40y+AEsr8CQjW86d0K0PCZ8mHQxxSBZGCRCSOX+n5WKWNOLYW8SE7hlFlLVVCuv0tvXr I+0mrQuddG/3pFay6zvpA6irUaM6Vl3Db5LyIcBP7kSNOgDdHBFH8wDXv8E+PWZETqi0 euoQ== 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:dkim-signature; bh=+2NeppKoPOd4YQz6nJcEifAHl4BALODLgDqAjaWDWoI=; fh=75T00YJZjP1VnnukYxwUJJMr+VOVWvyplUnZyxgYQRM=; b=LEhHyVzyB+CtZTi47pbj8mCTTCKXq/u120t5skYFRIXkln0hZ4E7upSwgh9VbBJyMz X8LWBF9U2H+eEczY1Tc53M7w9PqP+OGd0l325g8M/p24NrWqiLP8sQAvFv4gk1P611vJ Dy2c7u1RuLNWrKQAceul9YdVxuMkaYFm7nx98oLVMuxuuMReq2+zwGUmcDXsdDG4ucfz cv6IeErJ7w5F7jeNJ3nNSBHbYiG6k8gtyjC+WRn3eW8h4pfBJE/X4eMBu0PfEpxQiJGQ JsNO2cEGJ4Y2BTUOg2ce63ehlz64CX+NRDxd39/lfztdIN0ekQdcqOsiYHtJuKtTlHvm hYnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=hrdrym07; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id i11-20020a17090332cb00b001c3323ff53asi20774137plr.139.2023.09.28.15.59.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 15:59:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=hrdrym07; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 1883D8534667; Thu, 28 Sep 2023 10:53:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231451AbjI1Rxa (ORCPT + 99 others); Thu, 28 Sep 2023 13:53:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbjI1Rx3 (ORCPT ); Thu, 28 Sep 2023 13:53:29 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A083ADD; Thu, 28 Sep 2023 10:53:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=+2NeppKoPOd4YQz6nJcEifAHl4BALODLgDqAjaWDWoI=; b=hrdrym07dNmzgGqtwMAO60ISgD BlYZHtJj4WC2/8gMiEeDgWqc2qtFqVwDKDBO59FFnyAql0YQCGHRMEyJjJflbIpTwvjXwNS4TITuM N3IrZ7HVlXMZwqLIWthKUGWgamXkjw9uV9uImyFa54FeOcueBja9Wr5QSo2a9SXxdflk=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1qlvCG-007leL-E5; Thu, 28 Sep 2023 19:53:08 +0200 Date: Thu, 28 Sep 2023 19:53:08 +0200 From: Andrew Lunn To: Christophe Roullier Cc: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maxime Coquelin , Alexandre Torgue , Richard Cochran , Jose Abreu , Liam Girdwood , Mark Brown , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 08/12] net: ethernet: stmmac: stm32: support the phy-supply regulator binding Message-ID: <12332a87-e8c3-4cf3-849a-080e4e3f4521@lunn.ch> References: <20230928122427.313271-1-christophe.roullier@foss.st.com> <20230928122427.313271-9-christophe.roullier@foss.st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230928122427.313271-9-christophe.roullier@foss.st.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS autolearn=ham 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 28 Sep 2023 10:53:35 -0700 (PDT) > +static int phy_power_on(struct stm32_dwmac *bsp_priv, bool enable) I find this function name confusing, since 50% of the time it does not actually power the PHY on. You never call it with anything other than a static true/false value. So it might was well be two functions, phy_power_on() and phy_power_off(). > +{ > + int ret; > + struct device *dev = bsp_priv->dev; > + > + if (!bsp_priv->regulator) > + return 0; > + > + if (enable) { > + ret = regulator_enable(bsp_priv->regulator); > + if (ret) > + dev_err(dev, "fail to enable phy-supply\n"); Not all PHYs are usable in 0 picoseconds. You probably want a delay here. Otherwise the first few accesses to it might not work. Andrew