Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp1316221iol; Sun, 12 Jun 2022 12:19:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrOWUJhrquMKDD9an7ruZJ5cicfqTA1hJX38EQM+z47pp7L5uLZT5oVuLe8UK7L3Jk8ora X-Received: by 2002:a17:90b:4d0a:b0:1e2:c0b4:8bb8 with SMTP id mw10-20020a17090b4d0a00b001e2c0b48bb8mr11648451pjb.94.1655061555633; Sun, 12 Jun 2022 12:19:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655061555; cv=none; d=google.com; s=arc-20160816; b=lkwiBmHvnU/vi2aOfZNIpCiFKDXQbdYrS6DkjScTQpklf+c0+57RugQbsUD2vkGvXL pa7EGmjkax8QV82AjJY/+nvN/2z2hFk9Tst5eDpwpf5gK5mwbSVEczDV3qLBMshghdp1 ce2sweibTOeJJyNWmgZI+teZFkfJO/ymY7vQEMMi/26240ilsVP3UIDvmAXChxkvQpVU i+Gy1FbueZfgqWa0+DuNSniWcf6Nt3P+uVFabz30EUR67YZrBVf9/OaN5tyAHVoIe/hw QMSZxDobhf3Zhq+LogOiaNOhuOc9N6afwU3N/0LOsgvFLkib2gH8tut3ON266JiZcNa7 juAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yGbnPQsK3FXtOSZ3LhkbUPBBx+9nO9XDtAByspzcZzE=; b=QTMFZfA5Gnd1HlNZePlT4awhRQAK8Ua7STWaXlQ/GZ9mR0ryaxA99i7VG3YLV/jgfH 3Xzd+uK4tqpjLu4WTGPw5rFsjro/qH5oJrhzA26MW7hbNM3Pa2tCst72K8baPwKlFR8I zB9twRizRMw3HtEvhL7tUE29WqK0LhXNekxbVZBiZuY1R6Z7Jv/vDDAsP2POq4YKETI8 3kJk15nqSFbV/9qVF3fX80uh/CUUBtyc86blvBXSTDZZFX9kCBolDPxBoCRqIT3P6PcZ 9kiJp4svGOnkQORl1TKBd8VjYMmS0KsEepyoejN5zUVQoc+BGOIJ2kXZw/9TBO7jzpX4 fmPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@metrotek.ru header.s=mail header.b=AY+hPgxs; 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 jg5-20020a17090326c500b001569af11990si6382041plb.507.2022.06.12.12.18.53; Sun, 12 Jun 2022 12:19:15 -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=AY+hPgxs; 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 S231491AbiFLSnC (ORCPT + 99 others); Sun, 12 Jun 2022 14:43:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230245AbiFLSnB (ORCPT ); Sun, 12 Jun 2022 14:43:01 -0400 Received: from mail.pr-group.ru (mail.pr-group.ru [178.18.215.3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1486E5C655 for ; Sun, 12 Jun 2022 11:42:56 -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-transfer-encoding: in-reply-to:references; bh=guMf6OcVsQo+fLPJ8fpWWk/lWDBt604Wog1wB5emRic=; b=AY+hPgxsiVnrj94ILi8pKd69FPYAd0XK3/azrmP4QWByfXS/WWxRi9MttWwGwgGSZWfRAhJaB4g4J 5urGIKO1NzIzqKajwwCEL1O72G+8lGeGT4WOXFo1MuVyMTsut6A+VybRpPIw5Kn14ebaQTguuLmCHe UUYJfPq/vfQct/4NNW7Ua0WigFYSOIgjLp36BdvtA8KMDy5+ItTaSZsXPLmryNPbpLm0GsbbPT92Qf r6QRqLcyZSIV/TEPxjsRBPbJU/v/OaornsmqNB04FwNdd1hPF/h500EPQgEubFVAos2NBCNoud7bpI hyoiHyMfb00ZJKMOuM6JdFlTdGrixwQ== X-Kerio-Anti-Spam: Build: [Engines: 2.16.3.1424, Stamp: 3], Multi: [Enabled, t: (0.000008,0.006650)], BW: [Enabled, t: (0.000026,0.000001), skipping (From == To)], RTDA: [Enabled, t: (0.117134), Hit: No, Details: v2.40.0; Id: 15.52k031.1g5cjj1ha.dhp1; 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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Level: X-Footer: bWV0cm90ZWsucnU= Received: from localhost.localdomain ([178.70.36.174]) (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)); Sun, 12 Jun 2022 21:42:27 +0300 From: Ivan Bornyakov To: i.bornyakov@metrotek.ru Cc: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, system@metrotek.ru Subject: [PATCH v2 net-next] net: phy: marvell-88x2222: set proper phydev->port Date: Sun, 12 Jun 2022 21:19:34 +0300 Message-Id: <20220612181934.665-1-i.bornyakov@metrotek.ru> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405150305.151573-1-i.bornyakov@metrotek.ru> References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 phydev->port was not set and always reported as PORT_TP. Set phydev->port according to inserted SFP module. Signed-off-by: Ivan Bornyakov --- Changelog: v1 -> v2: set port as PORT_NONE on SFP removal, instead of PORT_OTHER 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 d8b31d4d2a73..f070776ca904 100644 --- a/drivers/net/phy/marvell-88x2222.c +++ b/drivers/net/phy/marvell-88x2222.c @@ -490,6 +490,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)); @@ -526,6 +527,7 @@ static void mv2222_sfp_remove(void *upstream) priv->line_interface = PHY_INTERFACE_MODE_NA; linkmode_zero(priv->supported); + phydev->port = PORT_NONE; } static void mv2222_sfp_link_up(void *upstream) -- 2.35.1