From nobody Fri Sep 5 20:09:26 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7ECA6C32772 for ; Tue, 23 Aug 2022 11:12:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242919AbiHWLMl (ORCPT ); Tue, 23 Aug 2022 07:12:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351349AbiHWLIs (ORCPT ); Tue, 23 Aug 2022 07:08:48 -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 2CF88B5E7C; Tue, 23 Aug 2022 02:16:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EF89461224; Tue, 23 Aug 2022 09:16:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7D48C433D6; Tue, 23 Aug 2022 09:16:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661246188; bh=mpEHv+2osM9qlxR5+ep/wk80+Y9tSPcDK7YRuosmWwk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FbW6uDDdl0Zjyp15PjYde+7Ejp++SInzna31s1eTR4JsrxAOuZfdt7Wa4a4iJ+wpR /EbzSkEyTtL2hE0Xj3vAgm/wgSXYUlYgocs7lGVn6YrXJH/02Wy5oETSHDJwrX4f4z u0Eeletld5e9xzh8eaaElg2awb2JbY2FLv4MziUI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sasha Neftin , Dvora Fuxbrumer , Tony Nguyen , Linjun Bao Subject: [PATCH 5.4 005/389] igc: Remove _I_PHY_ID checking Date: Tue, 23 Aug 2022 10:21:23 +0200 Message-Id: <20220823080115.865660221@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080115.331990024@linuxfoundation.org> References: <20220823080115.331990024@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Sasha Neftin commit 7c496de538eebd8212dc2a3c9a468386b264d0d4 upstream. i225 devices have only one PHY vendor. There is no point checking _I_PHY_ID during the link establishment and auto-negotiation process. This patch comes to clean up these pointless checkings. Signed-off-by: Sasha Neftin Tested-by: Dvora Fuxbrumer Signed-off-by: Tony Nguyen Cc: Linjun Bao Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/igc/igc_base.c | 10 +--------- drivers/net/ethernet/intel/igc/igc_main.c | 3 +-- drivers/net/ethernet/intel/igc/igc_phy.c | 6 ++---- 3 files changed, 4 insertions(+), 15 deletions(-) --- a/drivers/net/ethernet/intel/igc/igc_base.c +++ b/drivers/net/ethernet/intel/igc/igc_base.c @@ -187,15 +187,7 @@ static s32 igc_init_phy_params_base(stru =20 igc_check_for_copper_link(hw); =20 - /* Verify phy id and set remaining function pointers */ - switch (phy->id) { - case I225_I_PHY_ID: - phy->type =3D igc_phy_i225; - break; - default: - ret_val =3D -IGC_ERR_PHY; - goto out; - } + phy->type =3D igc_phy_i225; =20 out: return ret_val; --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -2884,8 +2884,7 @@ bool igc_has_link(struct igc_adapter *ad break; } =20 - if (hw->mac.type =3D=3D igc_i225 && - hw->phy.id =3D=3D I225_I_PHY_ID) { + if (hw->mac.type =3D=3D igc_i225) { if (!netif_carrier_ok(adapter->netdev)) { adapter->flags &=3D ~IGC_FLAG_NEED_LINK_UPDATE; } else if (!(adapter->flags & IGC_FLAG_NEED_LINK_UPDATE)) { --- a/drivers/net/ethernet/intel/igc/igc_phy.c +++ b/drivers/net/ethernet/intel/igc/igc_phy.c @@ -235,8 +235,7 @@ static s32 igc_phy_setup_autoneg(struct return ret_val; } =20 - if ((phy->autoneg_mask & ADVERTISE_2500_FULL) && - hw->phy.id =3D=3D I225_I_PHY_ID) { + if (phy->autoneg_mask & ADVERTISE_2500_FULL) { /* Read the MULTI GBT AN Control Register - reg 7.32 */ ret_val =3D phy->ops.read_reg(hw, (STANDARD_AN_REG_MASK << MMD_DEVADDR_SHIFT) | @@ -376,8 +375,7 @@ static s32 igc_phy_setup_autoneg(struct ret_val =3D phy->ops.write_reg(hw, PHY_1000T_CTRL, mii_1000t_ctrl_reg); =20 - if ((phy->autoneg_mask & ADVERTISE_2500_FULL) && - hw->phy.id =3D=3D I225_I_PHY_ID) + if (phy->autoneg_mask & ADVERTISE_2500_FULL) ret_val =3D phy->ops.write_reg(hw, (STANDARD_AN_REG_MASK << MMD_DEVADDR_SHIFT) |