Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp802025rwb; Thu, 27 Jul 2023 23:15:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlEO7d0B+iOet2Xnel6x1TMwC/ABvgT2X6GUbP4AM2xZE1De8h9H5buz6XIfSMpb9ovHimEi X-Received: by 2002:a05:6402:3d6:b0:522:4231:e228 with SMTP id t22-20020a05640203d600b005224231e228mr1032788edw.35.1690524957800; Thu, 27 Jul 2023 23:15:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690524957; cv=none; d=google.com; s=arc-20160816; b=QzcyW5aERHj3uksP1hRpvR8hO5oeZ3jjTyFBIeIPwj32+4CXYfBwuFg1iJpnEVkJjx Nn/CsQugOEYA2Wb1ZllJKwDgkS1EJ/rGbNeKb6wZJ8RDbvIsKqR4MqrTaYUfVbUzFT1t DpWzLIbd8ZHPyfyMnuFxQ5v9FCq64OGJue/kIfXCtlpZ8aVc8bPlTszvX4PTF+cUCruv l/N6j4W0KTzdC99libq77/WNt4QRb59MwS0nBHlS1kfo6E4dBN8uv7FYJgpZ/H1Almel n9Wuy/f/16l+hSp9kNFVaiHUJeA8Htb+isvX2ECm5izjdFdP0c6E1PlH4F7+H5KsXaWR XOBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=0WUSpYyIa1JVz9QLCGepDNF8TnjOOpnUwr/0eBxJiZk=; fh=b1WJaRY9gnZmYXU7Oeouh0iOXJWNx+43mS8VDwUcPbA=; b=RpgWpUZciJKDXBHvc8ilDSO3kAT/PVQqUXbORuDls5rK+O17E0MR/asH+iBwrW+pKW 7nmsWP+KTTx8eso7RFN9J7Xxpz8YUmXVr1LyQb3zWf9ECJ8PYaxUR2lk/Mym/SN/b6cL U+OokjWNamNKTUm8CoU6xhSl4GkcH5Pyrp8CyTEBmYOyIRl0jGINxxdiFlt8aZHvdl3n S94a9uJ7n3nA1u7bpDySvAfCdiv89q7fccIuYwreI6NWTc+tP/rckWKX49+4o0yk2OBf WGX/l4kjkJdeHYydGHdXYyZzE90JB8BlG5b2BGqLsY6DGo7sV2yINjPAdvZPdUEcXqA3 uKPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SFDJsONL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h19-20020a50ed93000000b005221e30af91si1970897edr.253.2023.07.27.23.15.33; Thu, 27 Jul 2023 23:15:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SFDJsONL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233393AbjG1FqD (ORCPT + 99 others); Fri, 28 Jul 2023 01:46:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229946AbjG1FqA (ORCPT ); Fri, 28 Jul 2023 01:46:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F209935AD for ; Thu, 27 Jul 2023 22:45:59 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1153961FCD for ; Fri, 28 Jul 2023 05:45:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62F53C433C8; Fri, 28 Jul 2023 05:45:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690523158; bh=bXg8BOFDCBRkgEdmVW5LzCWvnDGdPy1ePQLapozkYLQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=SFDJsONLk3ChdAsI4YH1Qys0BPE+ne9tSusb25cOXfCqrvkDLsYo32Ty2nGEhM9AH s526ho+IdNDIRNuS+haenPnsOC91cIlBY1E1QHNvFKuuK/fAO+Qx7mNUtmS3i86lUq zGI4MDgainrt902m6p2U6kCqjQ2dyUoxiWFVARqDtHE6I/igGMD4BkTxXCuGUqpGEW GcMVD6yHR6vQZAXkvMhaHA8AvBuj5bcQVPCdnd8zt3if5XbrRi6dyyYMPB8IKHKUq+ XwiuybhCfXvvUTbM5vjJpBH95uY08X6baby2BprNkcbQj0vhNs32+BVEVrWRtiiYWr rT7z+JtpfHNhw== Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-4fdd31bf179so2959616e87.2; Thu, 27 Jul 2023 22:45:58 -0700 (PDT) X-Gm-Message-State: ABy/qLb42qgOgv/7i+Kr8AlvA4sAAzW776yaK0cI2h1sgout0SypMfpa /rTqNgQu1rMrHbj+5bCE/nN4j1XcoW68RLf7iM8= X-Received: by 2002:a19:e041:0:b0:4f8:70f8:d424 with SMTP id g1-20020a19e041000000b004f870f8d424mr751228lfj.65.1690523156367; Thu, 27 Jul 2023 22:45:56 -0700 (PDT) MIME-Version: 1.0 References: <20230727-synquacer-net-v1-1-4d7f5c4cc8d9@kernel.org> In-Reply-To: <20230727-synquacer-net-v1-1-4d7f5c4cc8d9@kernel.org> From: Ard Biesheuvel Date: Fri, 28 Jul 2023 07:45:44 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] net: netsec: Ignore 'phy-mode' on SynQuacer in DT mode To: Mark Brown , Masahisa Kojima Cc: Jassi Brar , Ilias Apalodimas , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 (cc Masahisa) On Thu, 27 Jul 2023 at 23:52, Mark Brown wrote: > > As documented in acd7aaf51b20 ("netsec: ignore 'phy-mode' device > property on ACPI systems") the SocioNext SynQuacer platform ships with > firmware defining the PHY mode as RGMII even though the physical > configuration of the PHY is for TX and RX commits. Since > bbc4d71d63549bc ("net: phy: realtek: fix rtl8211e rx/tx delay config") > this has caused misconfiguration of the PHY, rendering the network > unusable. > > This was worked around for ACPI by ignoring the phy-mode property but > the system is also used with DT. Since the firmware used with DT is the > same (the firmware interface is selectable in the firmware > configuration) and the firmware configures the PHY prior to running the > OS we can use the same workaround. > Wouldn't this break SynQuacers booting with firmware that lacks a network driver? (I.e., u-boot?) I am not sure why, but quite some effort has gone into porting u-boot to this SoC as well. > Limit this to the SynQuacer, though practically speaking this is the > only currently known system using this device. > > Fixes: 533dd11a12f6 ("net: socionext: Add Synquacer NetSec driver") > Signed-off-by: Mark Brown > --- > drivers/net/ethernet/socionext/netsec.c | 18 ++++++++++++++---- > 1 file changed, 14 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c > index 2d7347b71c41..ae4d336efaa4 100644 > --- a/drivers/net/ethernet/socionext/netsec.c > +++ b/drivers/net/ethernet/socionext/netsec.c > @@ -1845,10 +1845,20 @@ static int netsec_of_probe(struct platform_device *pdev, > { > int err; > > - err = of_get_phy_mode(pdev->dev.of_node, &priv->phy_interface); > - if (err) { > - dev_err(&pdev->dev, "missing required property 'phy-mode'\n"); > - return err; > + if (of_machine_is_compatible("socionext,developer-box")) { > + /* > + * SynQuacer reports RGMII but is physically > + * configured with TX and RX delays, since the > + * firwmare configures the PHY prior to boot just > + * ignore the configuration. > + */ > + priv->phy_interface = PHY_INTERFACE_MODE_NA; > + } else { > + err = of_get_phy_mode(pdev->dev.of_node, &priv->phy_interface); > + if (err) { > + dev_err(&pdev->dev, "missing required property 'phy-mode'\n"); > + return err; > + } > } > > priv->phy_np = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0); > > --- > base-commit: 6eaae198076080886b9e7d57f4ae06fa782f90ef > change-id: 20230727-synquacer-net-e241f34baceb > > Best regards, > -- > Mark Brown >