From patchwork Thu Dec 14 11:31:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu X-Patchwork-Id: 13492845 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="XlBkhy2X" Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C9B5118 for ; Thu, 14 Dec 2023 03:35:23 -0800 (PST) Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a22ed5f0440so389089166b.1 for ; Thu, 14 Dec 2023 03:35:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1702553721; x=1703158521; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jKjeAY34llcGOWUq2lKYylvmKvhjwRpxdh2PzgtUzQM=; b=XlBkhy2XpWw9PEY6gUXcvcKOS9DJWtbpAMhBhU++2Y0Vter51xEydZEZwK/AMP09sj VdHjisE8wFD3q/UbyArxhR9/QojwJju5Q+hHj+g7SlUBiFUhUOb5c0tGFEyrXlN3hb5O n3iIeGWN/7VoDIk0E4hCqNO0AlT9LrEs7j+ILM31SqRYsx2ltVkFPdQbzX3SxFlFssXQ h0hfUGo8n5Y9N/xGcd1XZp3HFvE7QVHftcjiLF4f5muXccPWBqpO1IBn34r3DwjTehNE 0a2dR8kxCN79/e0LzF5PWtKoCHH3hb/TlErmqGLj13aRDcvASBG9Mtbu92xupkYvxIe5 U4qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702553721; x=1703158521; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jKjeAY34llcGOWUq2lKYylvmKvhjwRpxdh2PzgtUzQM=; b=ddsESrdwCcAcmox8XoRtVz8zaHnYlrNmGopK4xaSIAFCz1Xh+69mEC1bAYrLAb8Q0c 7SqKq9zphcEBrH4PVkYgNBLPqgcAo/7srcj0XYnADMUESmomhEI4mz0G7Aa1h/XHZVfe qM/gxUCY08hQun7er0FrPbBEiGfVl6r44CTzwyPz3toWjak1vKDWG5JMmPA/0ECHkP/n qt0n5Y3HgK/zVO8SaHlRC6yZvvsSUbBrQGVseDrEDrIZJdatLVEJVLSaNVToKC3akUFl HrDW/s5SWMJC89noyRZFgdaz1KrmqTipJUNTCqm8RWFJoWFzFCvbGnx0S+ah1iJkuMWz Q6Rw== X-Gm-Message-State: AOJu0YwsHHhkn8OdRXhIIIw/FYZbGQ8zxfhO+W+iOjcW9JpEOZh3bd7i C2Z5/dX4ETlfshD6veffS90jjw== X-Google-Smtp-Source: AGHT+IHVKCNMY9YBEDCrCTyqOqL3DNWn2qqH3wXx2mquhgdz/j50tlo3i1QCOR6Gnh2H4SupB1aloA== X-Received: by 2002:a17:907:2da1:b0:a0d:39c6:1f67 with SMTP id gt33-20020a1709072da100b00a0d39c61f67mr3996296ejc.76.1702553721371; Thu, 14 Dec 2023 03:35:21 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.103]) by smtp.gmail.com with ESMTPSA id vx12-20020a170907a78c00b00a1ddb5a2f7esm9290656ejc.60.2023.12.14.03.35.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 03:35:21 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: 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, niklas.soderlund+renesas@ragnatech.se, biju.das.jz@bp.renesas.com, prabhakar.mahadev-lad.rj@bp.renesas.com, mitsuhiro.kimura.kc@renesas.com, geert+renesas@glider.be Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net 2/2] net: ravb: Check that GTI loading request is done Date: Thu, 14 Dec 2023 13:31:37 +0200 Message-Id: <20231214113137.2450292-3-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231214113137.2450292-1-claudiu.beznea.uj@bp.renesas.com> References: <20231214113137.2450292-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org 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 Thus, check the completion status when setting 1 to GCCR.LTI. 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; } 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)