Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6607025rdb; Fri, 15 Dec 2023 03:39:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IEgTJTak5JQ9XNLrt9BymQAFQN7VJLeAnC+DdvzfnO9uxyCkxgguwNUnCB4gSuO/ii9rgoR X-Received: by 2002:a9d:7b43:0:b0:6da:54b3:740a with SMTP id f3-20020a9d7b43000000b006da54b3740amr237583oto.36.1702640345800; Fri, 15 Dec 2023 03:39:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702640345; cv=none; d=google.com; s=arc-20160816; b=Hbw+zZP6YV5tG2bmQom1NQ6oRtpwQ/KpkBHi+BuSZRw1jt7M2RAj+UYfM1LbeN4ePK ADC3LF689n2RPBXddDe+tFjTGroemj9O08nbEbDE5sr5NSXe/C+i8SOn59Iap3kQj62O 5NNr7TEg0mQGMvo/HhdeFt4za7jSL/aPYcEvreMwdBzIiChGOYMLbBCEumoGEmI0wKgF yIZj723/USWYJERCDFzSq1p+Q5jnDlqQme5kg9o6i0B07hL4jDL1Hxd6EwkRsTS6EFEz RwqF3PYjTMGr/jEH8vtRRaBc0UCU04piXjzNHy62axbXCCHKngqf1WsT7vvjh/RFM4gx PgeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=S3YT1yTjiwZn9PyE86GiClk+IflwHY+oj6xB+7OwSYY=; fh=+ktn8/XgmLQJ+rHqoLyn+GqJRqkd/YOC0gRePOCquIc=; b=Lzk/+1Aka7vKYJ3dKtgegZv8S8gWt6RIbIZTFAX1cGb05fH/gRPg0KOnH5yolCRr2I XssXhTRVYMn8hlZxfuyKw77A/X9J0sO3CfXnLaUlwx5BvTGyNqnyRBeCLuv5YEidA1S2 uSoCjiyLgVlzo/lG9lhCFRz5RZiQPMZgKo2dQWioMLtLMxzEsbzyWCjAjZcf1lmqWIq7 RAbx2qTQrz8Q9uD/vzQbyb0eJvBmPawbA8ufNx76UctL2d6JpNPmVk8XDalfdEUoLy2Q VfshmCdmrq/zklZzm/0wTJA3gjfCpoexs7HWbOZvfBcGjGYTaRJoa7bZ72MqPdS31P9E VQdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=qJ9uxFzy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id o18-20020a634e52000000b0055be9543340si12620901pgl.872.2023.12.15.03.39.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 03:39:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=qJ9uxFzy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 918868042581; Thu, 14 Dec 2023 05:03:05 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573255AbjLNNCy (ORCPT + 99 others); Thu, 14 Dec 2023 08:02:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573218AbjLNNCk (ORCPT ); Thu, 14 Dec 2023 08:02:40 -0500 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3523012E for ; Thu, 14 Dec 2023 05:02:45 -0800 (PST) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-50bee606265so8646413e87.2 for ; Thu, 14 Dec 2023 05:02:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1702558963; x=1703163763; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=S3YT1yTjiwZn9PyE86GiClk+IflwHY+oj6xB+7OwSYY=; b=qJ9uxFzyuFo+sa3gwD1mF9/laRcSoXDjEoIN7asUTxwpRlH9UH0y3VJR32Iqst8YwR iv57JpEg9rtuS/U9yoHLn2HCBp6RKmFOG05qCfjAYVuAkCbdXf6rWHsSv3EgUn4UrB4y DidaAmLKqsPac8kkOI2LxI/jDLFX8FeqVH0OvA46z6BnjvJeWLgQ2hngBX816LEFRodl a5NKWAMpaPag05WcOE1QmccMR4vwBPQGY34a6XOA/kigWa8qWlgfYYk6HX6BYOxFvjpF r2llRp148CIZrORXmJYBQCj3/qp+B0XLhTaqe3BjwJRbl1o0zVd3sWiuMFNPlZr/uPXd pzOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702558963; x=1703163763; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=S3YT1yTjiwZn9PyE86GiClk+IflwHY+oj6xB+7OwSYY=; b=mDCSwYaE4AESpIyXylFC04w51vbFQltfIdXnVKW5yV0dyHVx1mP0SMq9knjnpK3Kmh qIjiwCbDP6tdYXLLGojsN0EdDy+cYoMORj6c239U9JAIQmfYv11gmhzzeYmUA89q4Juv TCTQ3+PDwWZmonUNAxFE1ExZZrn3lSNdnoC4JmEgBaTeg7gJwH11v4otmXS3dHguxJ0H FFuHHQiMLSpDqI/TtONFsaaJWUMLceShqUP3Sv/BTUQ+PrVpNyzhz1Lf/j+yPOtH64LV xL+ijYpkZVg+wYhj8cHU0iPV5ZZrrzmlie3womEb0SEqGWpwh5oCy/1fvk2pm3cOI12b CBWQ== X-Gm-Message-State: AOJu0Yy621XZY0BKO1drX6ksOm9eOoXEaZsbFym/NXx+/4YhzBE1TnWT 4FBSPofk039L1fInZcmyhfltMA== X-Received: by 2002:a05:6512:3d07:b0:50b:e637:b315 with SMTP id d7-20020a0565123d0700b0050be637b315mr6385869lfv.79.1702558963314; Thu, 14 Dec 2023 05:02:43 -0800 (PST) Received: from [192.168.50.4] ([82.78.167.103]) by smtp.gmail.com with ESMTPSA id uh17-20020a170906b39100b00a1d5063b01csm9321453ejc.190.2023.12.14.05.02.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Dec 2023 05:02:42 -0800 (PST) Message-ID: Date: Thu, 14 Dec 2023 15:02:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net 2/2] net: ravb: Check that GTI loading request is done Content-Language: en-US To: =?UTF-8?Q?Niklas_S=C3=B6derlund?= Cc: s.shtylyov@omp.ru, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, claudiu.beznea.uj@bp.renesas.com, yoshihiro.shimoda.uh@renesas.com, wsa+renesas@sang-engineering.com, biju.das.jz@bp.renesas.com, prabhakar.mahadev-lad.rj@bp.renesas.com, mitsuhiro.kimura.kc@renesas.com, geert+renesas@glider.be, netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231214113137.2450292-1-claudiu.beznea.uj@bp.renesas.com> <20231214113137.2450292-3-claudiu.beznea.uj@bp.renesas.com> <20231214123315.GL1863068@ragnatech.se> From: claudiu beznea In-Reply-To: <20231214123315.GL1863068@ragnatech.se> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 (snail.vger.email [0.0.0.0]); Thu, 14 Dec 2023 05:03:05 -0800 (PST) On 14.12.2023 14:33, Niklas Söderlund wrote: > Hi Claudiu, > > Thanks for your work. > > On 2023-12-14 13:31:37 +0200, Claudiu wrote: >> From: Claudiu Beznea >> >> Hardware manual specifies the following for GCCR.LTI bit: >> 0: Setting completed >> 1: When written: Issue a configuration request. >> When read: Completion of settings is pending > > This is hard to parse at first glance, the last row have odd indentation > and the mixing of read and write info is odd. I know this reflects how > it's written in the datasheet, but at least there the indentation is > correct. Also missing here is the fact that only 1 can be written to the > bit. > >> >> Thus, check the completion status when setting 1 to GCCR.LTI. > > Can you describe in the commit why this fix is needed. I agree it is, > but would be nice to record why. As this have a fixes tags have you hit > an issue? Or are you correcting the driver based on the datasheet? Yes, this is a issue I faced while working on runtime PM support for this driver. > > Maybe a more informative commit message could be to describe the change > and why it's needed instead of the register layout? ok > > The driver do not wait for the confirmation of the configuring request > of the gPTP timer increment before moving on. Add a check to make sure > the request completes successfully. > >> >> Fixes: 7e09a052dc4e ("ravb: Exclude gPTP feature support for RZ/G2L") >> Fixes: 568b3ce7a8ef ("ravb: factor out register bit twiddling code") >> Fixes: 0184165b2f42 ("ravb: add sleep PM suspend/resume support") >> Signed-off-by: Claudiu Beznea >> --- >> drivers/net/ethernet/renesas/ravb_main.c | 8 ++++++++ >> 1 file changed, 8 insertions(+) >> >> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c >> index ce95eb5af354..1c253403a297 100644 >> --- a/drivers/net/ethernet/renesas/ravb_main.c >> +++ b/drivers/net/ethernet/renesas/ravb_main.c >> @@ -2819,6 +2819,10 @@ static int ravb_probe(struct platform_device *pdev) >> >> /* Request GTI loading */ >> ravb_modify(ndev, GCCR, GCCR_LTI, GCCR_LTI); >> + /* Check completion status. */ >> + error = ravb_wait(ndev, GCCR, GCCR_LTI, 0); >> + if (error) >> + goto out_disable_refclk; > > nit: Maybe create a helper for this so future fixes only need to be > addressed in one location? The code intended for runtime PM support addresses this. > >> } >> >> if (info->internal_delay) { >> @@ -3041,6 +3045,10 @@ static int __maybe_unused ravb_resume(struct device *dev) >> >> /* Request GTI loading */ >> ravb_modify(ndev, GCCR, GCCR_LTI, GCCR_LTI); >> + /* Check completion status. */ >> + ret = ravb_wait(ndev, GCCR, GCCR_LTI, 0); >> + if (ret) >> + return ret; >> } >> >> if (info->internal_delay) >> -- >> 2.39.2 >> >