Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1728022rdh; Sat, 25 Nov 2023 00:28:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IE+RHvWDest+kon7OVrro0e73QArR/3kP74Du6TVIjhPSm6/tOUiDsgDcg2Hf/8HDf0LDdO X-Received: by 2002:a05:6a20:734d:b0:18b:5390:293a with SMTP id v13-20020a056a20734d00b0018b5390293amr5926188pzc.3.1700900931257; Sat, 25 Nov 2023 00:28:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700900931; cv=none; d=google.com; s=arc-20160816; b=vLdMjaFd98SLopzvbozNjdFMVgu1S431eZtfNzY3nkd/nsqq48QzNSjBsk5IMAJlDm H+5t+c/wq5aymGbEtn3NLo7U2xIHhAEF2DR5nYHkIgkjwpAFVNBCw0dPZf5xb+THiLMl 3duO0avKjXhwh5ROh5i+43fbHagAluMi0O8FdKFuTgCVZvJdCbSx4vlAXLRLt2N/GMlw 0+JbFKM26qDuBjQb2ZfYkg2g7lK430C1ClZV1pOC6jdG9vUii5CDyJFKOtU6oeRbDRrO UJlX0jTgdxLLQ63YGfcMmVHVS5BNhPTOUMz8Ds7XY8b/wy0GRz+o720/gTKiW8u2JhWY qWqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=LnkUemW/Vw0dvMf2LUd65BmRZrXY7Oum0dFDnN5qya8=; fh=2YntdpZEYJawT8Yq88zuELoI69uSIbF3d+O3p+oHGGc=; b=i1FAbLfX9wZExbZNqKq8d6Ju2BnaattADlr2AnqUOGvtzMgXlhpCtZtw5GCK6EgzYe hZn1LMyOe9j0MKu0XNP7Ur03R3gsDBMDhihn2E8sS/Ec4iged2akwS7gtp1lglHEEv4z jc4/0txRFS0BuDdnsZ3BEH5/4d06aZZ3VVzl6DyAUV2LYL44h3ldW4fDTvtqjo3J0lBd gmMAZVJI321evESBk+ezR4VzCv/SsweK7Ldj4QXjdOrw4r/QP8JqpO2PC09/QR9L4oss ARWQ+uDserTX4KkiE8hmcgC90bP+a5Jk1AW5ZYKOQsTqMANBXQAYU/BzbO2tQBPx3rCX oL+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=KQBYSbI9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id t14-20020a1709027fce00b001ce5b7bd150si4987670plb.607.2023.11.25.00.28.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 00:28:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=KQBYSbI9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id B3DC0808985A; Sat, 25 Nov 2023 00:28:48 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229569AbjKYI2d (ORCPT + 99 others); Sat, 25 Nov 2023 03:28:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229458AbjKYI2b (ORCPT ); Sat, 25 Nov 2023 03:28:31 -0500 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A6BCD7; Sat, 25 Nov 2023 00:28:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=LnkUemW/Vw0dvMf2LUd65BmRZrXY7Oum0dFDnN5qya8=; b=KQBYSbI9QZztfFhSHGvAUeRMYZ 7jHyQtGiI65lm5ctT6V8610pJW+pqce4qTD1S52beIYZ/U5L66YodxgUPf7qMMJPFuOkJiMi1Sizm KFshsjsAT+DrJPN75J+MwXTx5QHTPT9nr9WC8bv4fp2YvIbUTd75Pg/FDogyN5QHY2QU/78tUWRGW OcX7D4PjeI66CXO55FPOzX+K4+J2EkZ6m/91h7PacciK5Y/17YZuqGRdlLhiF/29i/Kg0koanREF6 AqETyop2yBW1YXS8j/rs7CZGwtSxNOoMuWM6C1hwjCP+liE24EjZrEpQmNcaHJWGgZTeZTtvvERx6 YQy1SD+Q==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:41546) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1r6o1U-0003rI-2A; Sat, 25 Nov 2023 08:28:20 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1r6o1U-000875-5m; Sat, 25 Nov 2023 08:28:20 +0000 Date: Sat, 25 Nov 2023 08:28:20 +0000 From: "Russell King (Oracle)" To: Daniel Golle Cc: Andrew Lunn , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Marek =?iso-8859-1?Q?Beh=FAn?= , Pali =?iso-8859-1?Q?Roh=E1r?= , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Eric Woudstra , John Crispin Subject: Re: [PATCH net] net: phylink: set phy_state interface when attaching SFP Message-ID: References: <8abed37d01d427bf9d27a157860c54375c994ea1.1700887953.git.daniel@makrotopia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8abed37d01d427bf9d27a157860c54375c994ea1.1700887953.git.daniel@makrotopia.org> Sender: Russell King (Oracle) X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Sat, 25 Nov 2023 00:28:48 -0800 (PST) On Sat, Nov 25, 2023 at 04:56:20AM +0000, Daniel Golle wrote: > Assume 'usxgmii' being set as initial interface mode in DTS. Now plug > a 2.5GBase-T SFP module with exposed PHY. Currently this results in > a rather bizare situation: > > RTL8221B-VB-CG 2.5Gbps PHY (C45) i2c:sfp1-wan:11: rtl822x_c45_get_features: supported=00,00000000,00008000,000080ef > mtk_soc_eth 15100000.ethernet eth2: requesting link mode phy/2500base-x with support 00,00000000,00008000,0000e0ef > mtk_soc_eth 15100000.ethernet eth2: switched to phy/2500base-x link mode <<< !!!!!! > mtk_soc_eth 15100000.ethernet eth2: major config usxgmii <<< !!!!!! > mtk_soc_eth 15100000.ethernet eth2: phylink_mac_config: mode=phy/usxgmii/none adv=00,00000000,00000000,00000000 pause=00 > mtk_soc_eth 15100000.ethernet eth2: PHY [i2c:sfp1-wan:11] driver [RTL8221B-VB-CG 2.5Gbps PHY (C45)] (irq=POLL) > mtk_soc_eth 15100000.ethernet eth2: phy: 2500base-x setting supported 00,00000000,00008000,0000e0ef advertising 00,00000000,00008000,0000e0ef > > Then the link seemingly comes up (but is dead) because no subsequent > call to phylink_major_config actually configured MAC and PCS for > 2500base-x mode. > > This is because phylink_mac_initial_config() considers > pl->phy_state.interface if in MLO_AN_PHY mode while > phylink_sfp_set_config() only sets pl->link_config.interface. > > Also set pl->phy_state.interface in phylink_sfp_set_config(). Does it _actually_ matter? When the PHY's link comes up, doesn't it get sorted out for the real mode that will be used? -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!