Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp537535pxb; Tue, 19 Oct 2021 08:00:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVboFCOnPJ7I8enyu/7NfW4sn8tUuQJHSXdTXVMzXYdosZK0jMa/0xXkvnvRU46n8nuKqQ X-Received: by 2002:a50:d8c2:: with SMTP id y2mr54203574edj.360.1634655640927; Tue, 19 Oct 2021 08:00:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634655640; cv=none; d=google.com; s=arc-20160816; b=aYHdBHOKE8fYeypIevtbrAdd3QHqIf1jh/Lu4vh7j7KhonIK8i14tFUaXHISS3+6zR T2ekD4qundUIx3u6+k80/CLURk8p/fp5U6jgZKNnGWJrYAr+2nmie/LkQv/PPJhfFghP 6Kv6QJKer0ncAVV4wGhJ83KUL55CB3JG2ftbydNXPK1EqBo2s7nwbXDQ7/Z6hZ2nDRxC 8mcK+JBJmgOYf2LtdcK+9Cp2f7GZX/YlwUejl1Ht5Ei6rq1HrmJxaB3p9DE/qr4+tYov 4Vs+z3VOVht04BvnBXQOEHfV3EsRUIjrtRGXoCYwi3Lbg2SMdyvifgL82NQ4i39W8QPw 0xCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=ERzqwboSGd/SJR901J9wmBQkGOQJnGCMPAq124+PTKg=; b=ce1IPiRKsLOTVSB0zPK/oLAX4+uregSm95ILpXKzvXiDDXCSpVlNZ1MiDoPFzDdNF6 foKIVsA2iP2NWuH76LdBwevLiRms/5w24OY2P8dv7Lf0NR8XVhzpR/Ak5rnXhr+c0JMr mC5RrcDzVRizXi8kd2DKDFj36s3KTwf/Vdpqm2Kerdn9snYe9bCoeIFFuxOOeoAPcZqV fdX85VvbxynasGEKHHsVRW5bPUqc9Bn96qH0Jk0wpW/k2lC58Ve6dLy+1XFdT9dnhVzd rv+pqpkjZ+AcHjD7f2ToCX7cWtiMkIqrKA/oX5DEmdTqEZuo9d/6LHdVJvwMSz951UIU oHLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gz15si27238001ejc.141.2021.10.19.08.00.16; Tue, 19 Oct 2021 08:00:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232349AbhJSO7l (ORCPT + 99 others); Tue, 19 Oct 2021 10:59:41 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:52997 "EHLO relay11.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232333AbhJSO7h (ORCPT ); Tue, 19 Oct 2021 10:59:37 -0400 Received: (Authenticated sender: kory.maincent@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 93D4E100007; Tue, 19 Oct 2021 14:57:19 +0000 (UTC) From: Kory Maincent To: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: thomas.petazzoni@bootlin.com, Sergey Shtylyov , "David S. Miller" , Jakub Kicinski , Lad Prabhakar , Biju Das , Sergei Shtylyov , Andrew Lunn , Adam Ford , Yoshihiro Shimoda , Geert Uytterhoeven , Yang Yingliang Subject: [PATCH] net: renesas: Fix rgmii-id delays Date: Tue, 19 Oct 2021 16:57:17 +0200 Message-Id: <20211019145719.122751-1-kory.maincent@bootlin.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Invert the configuration of the RGMII delay selected by RGMII_RXID and RGMII_TXID. The ravb MAC is adding RX delay if RGMII_RXID is selected and TX delay if RGMII_TXID but that behavior is wrong. Indeed according to the ethernet.txt documentation the ravb configuration should be inverted: * "rgmii-rxid" (RGMII with internal RX delay provided by the PHY, the MAC should not add an RX delay in this case) * "rgmii-txid" (RGMII with internal TX delay provided by the PHY, the MAC should not add an TX delay in this case) This patch inverts the behavior, i.e adds TX delay when RGMII_RXID is selected and RX delay when RGMII_TXID is selected. Signed-off-by: Kory Maincent --- drivers/net/ethernet/renesas/ravb_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index 0f85f2d97b18..89cd88e5b450 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -2114,13 +2114,13 @@ static void ravb_parse_delay_mode(struct device_node *np, struct net_device *nde /* Fall back to legacy rgmii-*id behavior */ if (priv->phy_interface == PHY_INTERFACE_MODE_RGMII_ID || priv->phy_interface == PHY_INTERFACE_MODE_RGMII_RXID) { - priv->rxcidm = 1; + priv->txcidm = 1; priv->rgmii_override = 1; } if (priv->phy_interface == PHY_INTERFACE_MODE_RGMII_ID || priv->phy_interface == PHY_INTERFACE_MODE_RGMII_TXID) { - priv->txcidm = 1; + priv->rxcidm = 1; priv->rgmii_override = 1; } } -- 2.25.1