Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7973211rwr; Wed, 10 May 2023 15:50:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6JBd7DRNI8TCEvYT42OlYGOJFKl3DxJUJFfI3NpsildnUfAMMlTOmdvzwldcNeyZMd2qsZ X-Received: by 2002:a17:902:c115:b0:1a0:4ebd:15d5 with SMTP id 21-20020a170902c11500b001a04ebd15d5mr18391634pli.67.1683759016259; Wed, 10 May 2023 15:50:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683759016; cv=none; d=google.com; s=arc-20160816; b=fyefzwMI1sHfHB/QOMgNFdqFRdVY9eE+Yq0xGGCr43hQd+/p1IBoiGa6LZdRySkpGM nJ75e78DUcRpCrKKaEeSfrlzv2XRv0wi6lSOJhcI3z37iwVllJ+UU78/0YTcrNPAFoJm 1673T9z1OMZFggaQLmqgFHGkCF97JyOZY3eM7KLxr9OPyMru06P4znqdOTraRi0gmu7t SG/2RVE3wCLwLyUWo4eQuFfzZjefSYIiCrnG229mPZN67GtMAsKhDeAZLbVLyJZ/cRvW RbMWfVgo4+Uhyszfsyv/rHYspmlcggm+beC9QJaxPRxEkVTOhMIhlFg7x0+68caZPD+J xMzA== 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=gwaXBBg4XskKxM6U1vhH6WQb0H4bfCyfoRanAQAkWWU=; b=M/+FhdLgmDhzHBs6S9s5bAm+/dtDp72y2VeSBcUKcOdqSZnyLqe3FJtOM5cM+vzz17 maEFK/BIkCHtz8jAUkoj0LKMKx9+UgjfzbMwMEfK02uOCYZOLnxZNCzxhZA4ua/H7BlR +JzodUw8dcIcwWprSw42lFoKe0FjfrbvodovmYCGvZLF2x6gBEVnxE/7afpZhVyIXD/u 6/acQIj7OJ0P48fKTm8RcRxr6flGlLY77FGnM9ruvH357FSjYmovqrDGQLMWbpamoUcQ cfbb38ft4eiUMHyMcFXMrJKhBenbIzGI2aUSwVBW+He51TtGVkhUuD4OPMuR+OEZZS7j c0Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=btLw9dYI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p4-20020a170902e74400b001ac83d2b076si5818386plf.337.2023.05.10.15.50.03; Wed, 10 May 2023 15:50:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=btLw9dYI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229825AbjEJWPf (ORCPT + 99 others); Wed, 10 May 2023 18:15:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjEJWPe (ORCPT ); Wed, 10 May 2023 18:15:34 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8672E5C; Wed, 10 May 2023 15:15:33 -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=gwaXBBg4XskKxM6U1vhH6WQb0H4bfCyfoRanAQAkWWU=; b=btLw9dYIp3jL127E1nzU23MyaU 09V4k4g9F2Jqr7BbrH308Ol4HGgyDfjQgeMigsr/GIxutbydkVCJiCR3E3s32gIv4ATDkEAkcxQyY M1WUyM8nB9qbaTejuf3VDqWT3/nYYJhV8N/vifqEJymCOXRZMCgmR8GrcqJYcYjh6bJU=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1pws5h-00CUOm-Ek; Thu, 11 May 2023 00:15:21 +0200 Date: Thu, 11 May 2023 00:15:21 +0200 From: Andrew Lunn To: Yan Wang Cc: hkallweit1@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux@armlinux.org.uk Subject: Re: [PATCH v3] net: mdiobus: Add a function to deassert reset Message-ID: <5b6eb4c3-1ef8-4ed5-bcf3-0bb11897ce24@lunn.ch> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 > +static void fwnode_mdiobus_pre_enable_phy(struct fwnode_handle *fwnode) > +{ > + struct gpio_desc *reset; > + > + reset = fwnode_gpiod_get_index(fwnode, "reset", 0, GPIOD_OUT_HIGH, NULL); > + if (IS_ERR(reset) && PTR_ERR(reset) != -EPROBE_DEFER) > + return; > + > + usleep_range(100, 200); > + gpiod_set_value_cansleep(reset, 0); > + /*Release the reset pin,it needs to be registered with the PHY.*/ > + gpiod_put(reset); You are still putting it into reset, and then taking it out of reset. This is what i said should not be done. Please only take it out of reset if it is in reset. Also, you ignored my comments about delay after reset. Documentation/devicetree/bindings/net/ethernet-phy.yaml says: reset-gpios: maxItems: 1 description: The GPIO phandle and specifier for the PHY reset signal. reset-assert-us: description: Delay after the reset was asserted in microseconds. If this property is missing the delay will be skipped. reset-deassert-us: description: Delay after the reset was deasserted in microseconds. If this property is missing the delay will be skipped. You are deasserting the reset, so you should look for this property, and if it is there, delay for that amount. Some PHYs take a while before they will respond on the bus. Andrew