From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61A6EC4332F for ; Wed, 20 Oct 2021 12:17:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4A7DB61359 for ; Wed, 20 Oct 2021 12:17:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230246AbhJTMTR (ORCPT ); Wed, 20 Oct 2021 08:19:17 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:48550 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230205AbhJTMTQ (ORCPT ); Wed, 20 Oct 2021 08:19:16 -0400 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=32GYkFGawk1EHwubKe3VWlQKW04GyjW6olYclX1Tk34=; b=RtVOIeZ3PSCRdaK6EFw6Mufldc FCR2wMQvAml1Qlq2OYjJgctYcQ5iMmh7GJmitlPzROfHxV7aBjd2hV9GNCMR/KxBQjSp8DlhClDvf +zi4IBK2/Lm4fk0gkMzLfzztsOGGqA+xRx/ioUUkN7cB284Gh0EsuFEEADsUCUpI7oNM=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1mdAWd-00BBMp-US; Wed, 20 Oct 2021 14:16:55 +0200 Date: Wed, 20 Oct 2021 14:16:55 +0200 From: Andrew Lunn To: =?iso-8859-1?Q?K=F6ry?= Maincent Cc: Geert Uytterhoeven , Thomas Petazzoni , netdev , Linux-Renesas , Linux Kernel Mailing List , Sergey Shtylyov , "David S. Miller" , Jakub Kicinski , Lad Prabhakar , Biju Das , Sergei Shtylyov , Adam Ford , Yoshihiro Shimoda , Yang Yingliang Subject: Re: [PATCH] net: renesas: Fix rgmii-id delays Message-ID: References: <20211019145719.122751-1-kory.maincent@bootlin.com> <20211019173520.0154a8cb@kmaincent-XPS-13-7390> <20211019175746.11b388ce@windsurf> <20211020105328.411a712f@kmaincent-XPS-13-7390> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211020105328.411a712f@kmaincent-XPS-13-7390> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > BTW, it's still not clear to me why the inversion would be needed. > > Cfr. Andrew's comment: > > > > | So with rgmii-rxid, what is actually passed to the PHY? Is your > > | problem you get twice the delay in one direction, and no delay in the > > | other? > > Yes, it was the problem I got. > The PHY I use have RX delay enabled by default, currently the PHY driver does > not support delay configuration, therefore I let the MAC handle TX delay. I > have stumbling over that legacy/wrong DTS on the old Kernel. This is where we get into the horrible mess of RGMII delays. The real solution is to fix the PHY driver. If it is asked to do rgmii, but is actually doing rgmii-id, the PHY driver is broken. It either should do what it is told, or return -EINVAL/-EOPNOTSUPP etc to indicate it does not support what it is asked to do. But fixing things like this often breaks working systems, because the DT says rgmii, the PHY actually does rgmii-id, the board works, until the PHY is fixed to do what it is told, and all the bugs in the DT suddenly come to light. Now, you said you are using an old kernel. So it could be we have already fixed this, and had the pain of fixing broken DT. Please look at the current kernel PHY driver, and see if all you need to do is back port some PHY fixes, or better still, throw away your old kernel and use a modern one. Andrew