Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1370034rwd; Thu, 25 May 2023 11:33:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6K0VCYru+UCYZBm/EDxhxTyxFew1akNev0TZ+qvTD7JqPyqvWqyZFMk3ih+G1useXGH8uk X-Received: by 2002:a17:902:bc8b:b0:1af:b049:b32e with SMTP id bb11-20020a170902bc8b00b001afb049b32emr2705766plb.56.1685039583028; Thu, 25 May 2023 11:33:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685039583; cv=none; d=google.com; s=arc-20160816; b=UrtXZhX/rjoNdIixoJYRabjm8dO3alK/qfwEyZJukr21DOJtLYf55UdsrhcTFfW9w8 tQwgkpIDcosRzp75xmdPVWRIA8Vh5oO0jRUJVTPv0zB+m9j+9+iCLu6+5xisc5CPWDAk 5ZZ9ml3EgTBl085QixRtVij4kDMMkCv0gbUJi3lQzd77ejX5LFCvqsFRW7Kb+Uko97tc Zon0vJ1zXLXts0ddyC7KHQ+MKVpykva8s4vpJunAXIPXLxPZIqZU0TY7Ss2Kz7XsjPMX rri8uPyLVWqZghCWS62JVuJ+zGgmj1sF2gojCv6UKCsZQggcQDLfnf5DY57jSSuo+jzR UXyQ== 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=bo/92fqAK60qaR+iLt8EZXaikaLGeCRcZg1Se+/ddps=; b=NRY/RcKyoMr1cTVD4MZK0AIeUZeULZhfW2xc12NKVeRWK+bayxn5aLWoWqlU66WoiX ea5WBOJaCqBPtCSqX/Y+fjGEH006a+VaSkesDks4Nfcsuq0f+FAWSvjlrOz+JtYqrJE8 DpTNPhjylGYuonZMLG3d7W5pETPRWeaewU1yvs6f8rKYI8FwU2rLJzYRNYxHUKwCgjct tYbP/5WQ13wNdEHIMqLsa8SVw0ZTPdDJpSy6vD1cP84twFy8bit9+t5gxYK3yIpdtkxK wM2igH83B0EhTvd8McIaRWYwriMEpNL/e0KFvaS5JP++DEoC2g/z9QDqygZybiaWqPAh aF9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ferroamp-se.20221208.gappssmtp.com header.s=20221208 header.b=OnKkRBAy; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i6-20020a170902c94600b001a68d4a42c0si2157251pla.560.2023.05.25.11.32.50; Thu, 25 May 2023 11:33:03 -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=@ferroamp-se.20221208.gappssmtp.com header.s=20221208 header.b=OnKkRBAy; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233538AbjEYS0h (ORCPT + 99 others); Thu, 25 May 2023 14:26:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235058AbjEYS0H (ORCPT ); Thu, 25 May 2023 14:26:07 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC943119 for ; Thu, 25 May 2023 11:26:05 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4f3b9e54338so2861274e87.0 for ; Thu, 25 May 2023 11:26:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ferroamp-se.20221208.gappssmtp.com; s=20221208; t=1685039164; x=1687631164; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=bo/92fqAK60qaR+iLt8EZXaikaLGeCRcZg1Se+/ddps=; b=OnKkRBAymV1YDLhgYbcvLmDtFYPzxUui9VvwEnGeGQgCkfvYzSnq0k0Gpcao8eJrf1 XwdcerjNtAmBfAOhixooIlqz83NMoBRuWFEoQxokD8ytJxwMqJa37vvAzoSnKuX2K7tg /UTJ9kceGXXh0S5IFWOWhvQ/wvymvppxEXcORe+Jq/oX0E0qKXrNRDuqVb7daMkpxqnr fKiykLrCQ92n9DqBVlWBhuM/uy4rWrjTAaRW7rAyU7f2JNISrcQbJJCIOrz+s0v08S3K IAx7jHaukTLocwbyzMSyXz/GjJTFCjgnB+FK9qJSDOa8rPj9eJPcHthwjwFKoldunCjW xZ5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685039164; x=1687631164; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=bo/92fqAK60qaR+iLt8EZXaikaLGeCRcZg1Se+/ddps=; b=FvQ1mmaRsbaipUoqNiKX8r0FArBa04sQkLbM0kcEq57x78nJzrwe/kMryRe9oMLRf5 W2KdxI9EIIKIrm65SKXcOZb7zlZ9Hy/Z2ujSLOBDJKb0Uw2NR2/vZzYs3xjnfS7CxZTx mHN8z6F3GCxQ83Vw23C6muRmT4sWhbRbmg2Y40nPzeA7pb4EVBPt9eSy8NuMo2qqPyLB C4jFiIGeG+3Rf2ZIrs3G/PRSI3vY6NFESxRTCtC5i9QSrbXAK4YyJHV3tldWOTFsrO4G RvVXHUhjTI/g4Tbox4p3aJ5N+mU56njzWvOsYnf2eWBiGUV+iD9FF/Lz3Xzn5Lk6tmNK oZPw== X-Gm-Message-State: AC+VfDwCQlGWzuHR3OPDoTS60/pcZp1kAtU8NfrXF8mB0i/P06mY81F8 KywivNRJ2anKYeK1MgMP26KgKA== X-Received: by 2002:a05:6512:4c8:b0:4f3:aaea:6d48 with SMTP id w8-20020a05651204c800b004f3aaea6d48mr7474673lfq.63.1685039164049; Thu, 25 May 2023 11:26:04 -0700 (PDT) Received: from builder (c188-149-203-37.bredband.tele2.se. [188.149.203.37]) by smtp.gmail.com with ESMTPSA id q28-20020ac25a1c000000b004f4cabba7desm296750lfn.74.2023.05.25.11.26.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 11:26:03 -0700 (PDT) Date: Thu, 25 May 2023 20:26:01 +0200 From: =?iso-8859-1?Q?Ram=F3n?= Nordin Rodriguez To: Parthiban Veerasooran Cc: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, horatiu.vultur@microchip.com, Woojung.Huh@microchip.com, Nicolas.Ferre@microchip.com, Thorsten.Kummermehr@microchip.com Subject: Re: [PATCH net-next v3 4/6] net: phy: microchip_t1s: fix reset complete status handling Message-ID: References: <20230524144539.62618-1-Parthiban.Veerasooran@microchip.com> <20230524144539.62618-5-Parthiban.Veerasooran@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230524144539.62618-5-Parthiban.Veerasooran@microchip.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, T_SPF_PERMERROR 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 > + /* Read STS2 register and check for the Reset Complete status to do the > + * init configuration. If the Reset Complete is not set, wait for 5us > + * and then read STS2 register again and check for Reset Complete status. > + * Still if it is failed then declare PHY reset error or else proceed > + * for the PHY initial register configuration. > + */ > + err = phy_read_mmd(phydev, MDIO_MMD_VEND2, LAN867X_REG_STS2); > + if (err < 0) > + return err; > + > + if (!(err & LAN867x_RESET_COMPLETE_STS)) { > + udelay(5); > + err = phy_read_mmd(phydev, MDIO_MMD_VEND2, LAN867X_REG_STS2); > + if (err < 0) > + return err; > + if (!(err & LAN867x_RESET_COMPLETE_STS)) { > + phydev_err(phydev, "PHY reset failed\n"); > + return -ENODEV; > + } > + } This comment explains exactly what the code does, which is also obvious from reading the code. A meaningful comment would be explaining why the state can change 5us later.