Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3413115ioa; Tue, 26 Apr 2022 03:14:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVNTF/yaU3zaDV4ezwDG73rkfQgsfrSuikskhoLM3+iEzuMOd1Oli8Ot51e3uI8Ufe4Cyk X-Received: by 2002:a17:90b:388f:b0:1d2:7381:3b41 with SMTP id mu15-20020a17090b388f00b001d273813b41mr37104831pjb.72.1650968076807; Tue, 26 Apr 2022 03:14:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650968076; cv=none; d=google.com; s=arc-20160816; b=cyneIA/w4eZKqVoTrlrmr1m3IijKBGWn6irpRfCVfk8twq4k171DK6XqgA+mcxJ99r UkTA8/T7yjVCWuETFbVRZM/LZzB1q8NMdyljR1iZRhFP3HS9leci1spX9c7hC8OaONRU WC5gKDAA60JaD+nL6GoPtBRVU7ecOENG0OQM+9otNKarG0kpIvMDZk6J5E5ipbl9o1j7 IP3GNxx6fH0R/n53nIG9sL5eTwi3TMss75HoPCAIq8LC75GHediy71kxG2VwsAkwWHWW FVSuyQXUDs/2RoVxS/pfVeWDAxaRWJ9lM+DCoSW98eCXIvaNmafXmvsot60TE4iWl3fi dHeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/OEYqO64YVQPMTkNwYlix5vg9xkRLTmhfpPR9LWVEho=; b=BMwRsaIyKZSctomPPdtQmxqdKBgj7wgM8WM0pDVIHInKnw8F58L0I1G0aSZn3bQAPP 9T6unpiCD3kjKA9/DyHeLVpdfQFY0D2KiCce83PKh/7585o8mXrbddZCqT98GdLvn/Do Zg8tWRg26pF1ScPMJI8K6ApxYhxD3x1Kemt4sSWWRyadN13ii2S3tMNmRHgTD0puvJtW X2xMUTEsMwiYqIpSaTJ36sz8SyC4j+tgLEJmXsAiaFll2bSEeJncRR9qHMhSuuvU3Gbl 4r5V2RDqdFwNfgyHs2hE/aacXAaE86q1W3Vl4chvrtf9PJOxiC/lb4wazBLgPwivBuIJ fXNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@metrotek.ru header.s=mail header.b=caZLIG7X; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w2-20020a170902e88200b00156ef408753si3131166plg.238.2022.04.26.03.14.20; Tue, 26 Apr 2022 03:14:36 -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=fail header.i=@metrotek.ru header.s=mail header.b=caZLIG7X; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344252AbiDZHtx (ORCPT + 99 others); Tue, 26 Apr 2022 03:49:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343874AbiDZHtw (ORCPT ); Tue, 26 Apr 2022 03:49:52 -0400 Received: from mail.pr-group.ru (mail.pr-group.ru [178.18.215.3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91B53193DE; Tue, 26 Apr 2022 00:46:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=metrotek.ru; s=mail; h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to: references; bh=jdeIL4APlI7ICUopY2YQhQe6o+8TJoupKLnVkfKcSl4=; b=caZLIG7XwxfomNotUAL9qP9VTjUQIRfxK6A662fV6pAh8nRTlrbXhoDl6MX1FoHNzdpI/edmsUVWz ANqh+BZ5kd5pcHTvEmqXXLPDr4Sodl1s9gUtECWbmqIXyZj8ODcuvGhKRoutJ/bUuxBD+XI1wHWqEh u9GKJvP2jH0qLOGJc7P4h1kAi45kNiD4M9NlWL8b/raneXkP1atL1A2AjXOfX4T7DMA25mjeytkXMq oTocpm9oebiGNzy8VRS9ktV4/aDEKGaKsUt2+aUK2gGvtln0bS7fH1uRaTGM5F71HmFbku40i8UR4/ C0/HQvE5kusrn2Bf4BY8xtQFuSa3tvA== X-Kerio-Anti-Spam: Build: [Engines: 2.16.2.1410, Stamp: 3], Multi: [Enabled, t: (0.000008,0.007255)], BW: [Enabled, t: (0.000015,0.000001)], RTDA: [Enabled, t: (0.063913), Hit: No, Details: v2.36.0; Id: 15.52k1ok.1g1idbgdp.3m7n0; mclb], total: 0(700) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Level: X-Footer: bWV0cm90ZWsucnU= Received: from h-e2.ddg ([85.143.252.66]) (authenticated user i.bornyakov@metrotek.ru) by mail.pr-group.ru with ESMTPSA (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)); Tue, 26 Apr 2022 10:46:11 +0300 Date: Tue, 26 Apr 2022 10:46:00 +0300 From: Ivan Bornyakov To: "Russell King (Oracle)" Cc: Andrew Lunn , Heiner Kallweit , "David S. Miller" , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, system@metrotek.ru Subject: Re: [PATCH net-next RESEND] net: phy: marvell-88x2222: set proper phydev->port Message-ID: <20220426074600.p3za7apdxxvjbq3z@h-e2.ddg> References: <20220405150305.151573-1-i.bornyakov@metrotek.ru> <20220425041637.5946-1-i.bornyakov@metrotek.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 On Mon, Apr 25, 2022 at 10:33:06PM +0100, Russell King (Oracle) wrote: > On Mon, Apr 25, 2022 at 07:16:37AM +0300, Ivan Bornyakov wrote: > > phydev->port was not set and always reported as PORT_TP. > > Set phydev->port according to inserted SFP module. > > > > Signed-off-by: Ivan Bornyakov > > --- > > drivers/net/phy/marvell-88x2222.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/net/phy/marvell-88x2222.c b/drivers/net/phy/marvell-88x2222.c > > index ec4f1407a78c..9f971b37ec35 100644 > > --- a/drivers/net/phy/marvell-88x2222.c > > +++ b/drivers/net/phy/marvell-88x2222.c > > @@ -603,6 +603,7 @@ static int mv2222_sfp_insert(void *upstream, const struct sfp_eeprom_id *id) > > dev = &phydev->mdio.dev; > > > > sfp_parse_support(phydev->sfp_bus, id, sfp_supported); > > + phydev->port = sfp_parse_port(phydev->sfp_bus, id, sfp_supported); > > sfp_interface = sfp_select_interface(phydev->sfp_bus, sfp_supported); > > > > dev_info(dev, "%s SFP module inserted\n", phy_modes(sfp_interface)); > > @@ -639,6 +640,7 @@ static void mv2222_sfp_remove(void *upstream) > > > > priv->line_interface = PHY_INTERFACE_MODE_NA; > > linkmode_zero(priv->supported); > > + phydev->port = PORT_OTHER; > > Can this PHY be used in dual-media mode, auto-switching between copper > and fibre? I believe, it can not. > If so, is PORT_OTHER actually appropriate here, or should > the old value be saved when the module is inserted and restored when > it's removed? Would PORT_NONE be appropriate? Saving old value would be ok also.