Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1524286rda; Mon, 23 Oct 2023 15:43:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGYyoF++tpFYLFN6aWMRAaJnsLfIR/vMJqqDhEl01Bv6BoF+hSWNStbuVMDqDPIhF/7Bnu/ X-Received: by 2002:a17:903:41cc:b0:1c7:3526:dfcd with SMTP id u12-20020a17090341cc00b001c73526dfcdmr9503838ple.52.1698101018716; Mon, 23 Oct 2023 15:43:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698101018; cv=none; d=google.com; s=arc-20160816; b=pHlhgyCvsnbhVa0DutXdCuPVtE8zNlPIKmtmqT0k+hgFGnrNHTrSxGjXAPn+o7G6Ru l0+pbYDeNY4+5Lcs9qTTqx/Puaz/HV4p4CtHcWdI7rdwhhBPyfhjWAiUpr8gdFu7vvWb q6yr3LttdONiAod3hunMHEhp1cBn1diDil3uFzQpcSeSUBkOK0iZUhA3r8u45PlAccMb +qeuQHszwBwo79a+frhFv5mBEonNvZ1yz9rNMxDMp6GHseCapvpPTpm2PF+0UOVt90rG LjaIOkOHzNtoKhJnBJSHsaj+/DjOUptfG789ICuQUxWWHsxPX9m7V+dmVs1X0HA9ZVzr G7YA== 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=24p8BHx6MaOc5tKzsfG7lYznwTHMjop8dTU1j4DR320=; fh=HP0u6UTDta/+GqBM4mahf5Lc0EVr0KtIYijFiIYMcHg=; b=ZtuZ+dGTFZyCq2jrB/rsh/wCm0AXpTqXMzSv6i3/B7ORwpZict6e8rmYVhBzQkhlf3 +VXtZuxwapYvtdMIF1YTmVczqt/8nOA22Mc4Gv3To4EeC3cv9TU9OKlNX7zt2CxD1WEi Hz7DMHD4x/Db2wKXikxVo/sCB8S7z0gmYLbc1/iLql3ZLBA/ZoPbNHx/uqTglHgl9yp5 0lYp6mpR4cRjcMaxBdYfI4Vxvrqd8kRji4nlNBLs08qj2Ox9zPihcAE5BA1I2hpCMUJW fjx2qn+qOlJ7/0cuUcapzHFv7Qjy4MPKWACF7pr+ztXgyVsD2DWEeN+rcpsJn8QwRHLX Wklg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=ZgFIcAUV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id w12-20020a170902d3cc00b001b556b0d0b7si6968055plb.480.2023.10.23.15.43.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 15:43:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=ZgFIcAUV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id 5B70780B908F; Mon, 23 Oct 2023 15:43:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233381AbjJWWn2 (ORCPT + 99 others); Mon, 23 Oct 2023 18:43:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232098AbjJWWnY (ORCPT ); Mon, 23 Oct 2023 18:43:24 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41BB910D; Mon, 23 Oct 2023 15:43:21 -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=24p8BHx6MaOc5tKzsfG7lYznwTHMjop8dTU1j4DR320=; b=ZgFIcAUVRCZO2ubTTUA88FsjRr Y4LTCoihimQS+pWb8UxiOZOXhMJACHJddOFM1AVa6z1Ex62njjJ/TrOEXurT311O6aIVo8Azxei64 Xr57fgZAmOOrwvrI/dpWXXP1axHELW7Zj3bAASc52WT8q3QNSKUny7+tz7+ubYwk48tA=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1qv3dZ-0001HN-Ba; Tue, 24 Oct 2023 00:43:05 +0200 Date: Tue, 24 Oct 2023 00:43:05 +0200 From: Andrew Lunn To: Parthiban Veerasooran Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, corbet@lwn.net, steen.hegelund@microchip.com, rdunlap@infradead.org, horms@kernel.org, casper.casan@gmail.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, horatiu.vultur@microchip.com, Woojung.Huh@microchip.com, Nicolas.Ferre@microchip.com, UNGLinuxDriver@microchip.com, Thorsten.Kummermehr@microchip.com Subject: Re: [PATCH net-next v2 2/9] net: ethernet: oa_tc6: implement mac-phy software reset Message-ID: <219ae3d7-0c75-49c0-b791-5623894ba318@lunn.ch> References: <20231023154649.45931-1-Parthiban.Veerasooran@microchip.com> <20231023154649.45931-3-Parthiban.Veerasooran@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231023154649.45931-3-Parthiban.Veerasooran@microchip.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email 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 (morse.vger.email [0.0.0.0]); Mon, 23 Oct 2023 15:43:36 -0700 (PDT) > + ret = oa_tc6_perform_ctrl(tc6, RESET, ®val, 1, true, true); > + ret = oa_tc6_perform_ctrl(tc6, RESET, ®val, 1, true, false); Just looking at this, it is not clear what these true/false mean. Maybe add some #defines #define TC6_READ true #define TC6_WRITE false #define TC6_PROTECTED true #define TC6_UNPROTECTED false > + if (ret) > + return ret; > + > + /* The chip completes a reset in 3us, we might get here earlier than > + * that, as an added margin we'll conditionally sleep 5us. > + */ > + udelay(5); > + > + ret = oa_tc6_perform_ctrl(tc6, STATUS0, ®val, 1, false, false); > + if (ret) > + return ret; > + > + /* Check for reset complete interrupt status */ > + if (regval & RESETC) { > + regval = RESETC; People don't always agree, but i found STATUS0_RESETC easier to see you have the correct bit for the register you just read. Andrew