Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4444929ioa; Wed, 27 Apr 2022 04:09:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrZRFPXbc4EghtYZ86ww0FDY9HPYfMjzND+3UQvsyoH4z4tyrqku7X+GGaB/eDPQ0xLty2 X-Received: by 2002:a17:90a:e510:b0:1d8:39b3:280b with SMTP id t16-20020a17090ae51000b001d839b3280bmr30035566pjy.142.1651057740373; Wed, 27 Apr 2022 04:09:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651057740; cv=none; d=google.com; s=arc-20160816; b=jPJcMCCnMSUFxpcInvHSd894216JmjoASW0k4TsJhqjKwec8COLBMrn59woVMXdGhl OS/NYKCuCyY2kvvEHDtbZbhhhetmwsiFq1OhhPO2BxumvS/lLew1gfU9jfoDT7YpiQFP 8U9aVjNpPcHcHt04L2aDr7D1itrU9dOg6J40RCaYWMIPDrRSCdYttJuwrJyB7/a4whLg hr25cru7pwB4kx40KTt3zjuCgN/MKUFCUMIxwoo0EltBudN6sfafyq8HqKbjJ5+dxZ99 YerEGU8TImMv0ogD4soe4iD9/5DACvWFVAfAQj9yCOo3CmBizGq3SfXCXp9F9UnFMQFY XiqA== 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=hYFXEchTbGOdJ3MTA3MM0r318Y2HGalUUBOLK/nlz3g=; b=UNjEgxa22+JY8+OfYPmnnYX7Ux244aJSb2y8ylpXbC9mnsC7TFezZEfzkQYC6980AV NAyzz5ye4or5RnGtJ+94Vw1nAsqiV/IeMeymFb/wK1z2pF1zEz8UBnRResuTIwDc99AK cutFlzPnDPYr+xt8/+cIzS0mHtV5ZTNRbAyKGg/LtpD/0Qx1DEqechTh9WbwlwCYqj2R L08HVRIFxh82LKDvRqiNcO/AnNpAZFnsRrnrXZ+FYg7XIKJB7Ih4+HV+vZcPbF9aKXSG 0P6jfHPp1picJZsjDCY0CvIKMbloIXxD/YZvfbJ6B/migPqUo61uiuHlFcdcdRXelCVm tIug== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=eq+eJVNf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i123-20020a639d81000000b0039822e42cbasi1226683pgd.427.2022.04.27.04.08.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 04:09:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=eq+eJVNf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E48BDAAE21; Wed, 27 Apr 2022 03:03:17 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231678AbiDYW0E (ORCPT + 99 others); Mon, 25 Apr 2022 18:26:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343573AbiDYVgX (ORCPT ); Mon, 25 Apr 2022 17:36:23 -0400 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 B9F0F388E; Mon, 25 Apr 2022 14:33:16 -0700 (PDT) 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=hYFXEchTbGOdJ3MTA3MM0r318Y2HGalUUBOLK/nlz3g=; b=eq+eJVNfAchZOCMK2PfLw/ViC4 FqqEtR0ntH8u4sABg3uXKzvzSDpJbJFYSRaUZ7vXwf0Wt4nKHa16GUlxeisFwlC14+0wbl2rRDEGI c7pyUs0WMY/H3gTsBOaedbgbcWBU4XJYbe086I1KlLTecMOWJSRaGNjBcmjp9h4A9s5dZsbTJ5GPX JSxoI6/Utt7I1IYXjf5VL/lCU2QChzUsSG1XKGufSOwDDEENPxk9prQnZw0qtAezg+I3yzk0KlT7R tO1rXcxkOBAFOCC4hNvypTpH+HmUaBu//ebVJQyuwaKEyHaWdYhSikRhmVc4qPZ1bwRaU0+v69YOk 2eFnJhqQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:58404) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nj6KT-0007oZ-Te; Mon, 25 Apr 2022 22:33:09 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1nj6KQ-0006rn-LS; Mon, 25 Apr 2022 22:33:06 +0100 Date: Mon, 25 Apr 2022 22:33:06 +0100 From: "Russell King (Oracle)" To: Ivan Bornyakov 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: 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: <20220425041637.5946-1-i.bornyakov@metrotek.ru> Sender: Russell King (Oracle) X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no 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 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? 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? -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!