From patchwork Thu Mar 30 08:39:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sit, Michael Wei Hong" X-Patchwork-Id: 13193615 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 EC200C761AF for ; Thu, 30 Mar 2023 08:40:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229459AbjC3Ikz (ORCPT ); Thu, 30 Mar 2023 04:40:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229680AbjC3Ikx (ORCPT ); Thu, 30 Mar 2023 04:40:53 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85FCB5B92; Thu, 30 Mar 2023 01:40:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680165652; x=1711701652; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=E/3JzKj/ftYcVD0rt0pT36PrSlnk43aIECQPEWDRFIQ=; b=JzOZt2KAvux5JvhmzLaD49g9OsmPW1NlqS614U/OhUtOKB0ucZmwGVZb DQM0qYQ261UnYGAKP6QYC+jxAmbesyRwBuLWy/f8CPV0woDtn8apC0/PP XvuLiybS6AEOqRp/uCSziOSvQGYLJrAkiXCRi9U4mnt6gvM+53ykOnwz7 Bmsj9Rl4nZdNaVEyCOvNYfiXh71eF0Y8ZGdMACBd2mAtv7jy74HjPfhxf dsGlzedwvC961EtrystnMTBFzD3333Wr9JyV+cJvb/evW30WneRY3F1Yv dkuUfqZ1AKdoQlclVoq6Uxg0QQ6RzZxCY617n55me/f5WSCrD0E9xc7TT A==; X-IronPort-AV: E=McAfee;i="6600,9927,10664"; a="343559359" X-IronPort-AV: E=Sophos;i="5.98,303,1673942400"; d="scan'208";a="343559359" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2023 01:40:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10664"; a="684618810" X-IronPort-AV: E=Sophos;i="5.98,303,1673942400"; d="scan'208";a="684618810" Received: from mike-ilbpg1.png.intel.com ([10.88.227.76]) by orsmga002.jf.intel.com with ESMTP; 30 Mar 2023 01:40:46 -0700 From: Michael Sit Wei Hong To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Ong Boon Leong , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux@armlinux.org.uk, hkallweit1@gmail.com, andrew@lunn.ch Cc: Looi Hong Aun , Voon Weifeng , Lai Peter Jun Ann Subject: [PATCH net v4 0/3] Fix PHY handle no longer parsing Date: Thu, 30 Mar 2023 16:39:57 +0800 Message-Id: <20230330084000.3292487-1-michael.wei.hong.sit@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org After the fixed link support was introduced, it is observed that PHY no longer attach to the MAC properly. So we introduce a helper function to determine if the MAC should expect to connect to a PHY and proceed accordingly. Michael Sit Wei Hong (3): net: phylink: add phylink_expects_phy() method net: stmmac: check if MAC needs to attach to a PHY net: stmmac: remove redundant fixup to support fixed-link mode .../net/ethernet/stmicro/stmmac/dwmac-intel.c | 1 - .../net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +++- drivers/net/phy/phylink.c | 17 +++++++++++++++++ include/linux/phylink.h | 1 + 4 files changed, 21 insertions(+), 2 deletions(-) v2: Initialize fwnode before using the variable v3: Introduced phylink_expects_phy() method as suggested by Russell King remove xpcs_an_inband fixup instead of moving the fixed-link check as suggested by Andrew Lunn v4: Modify phylink_expects_phy() to check for more complete set of conditions when no PHY is needed and return false if met.