From nobody Sat Nov 23 05:25:31 2024 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 029EC1F709E; Thu, 14 Nov 2024 08:17:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731572254; cv=none; b=GJg8jKa0g7h6GkkdBA8QYMfNiMm3P9tlptEzLSEheoXx/Qhlb/yfv0APeztrgq/cCoct4DaWXne4k3rO8EjZycVHxsG/PhaWYCVz/Wb/8MCb8uUuoCLn+vN89IUEI4nP7KwV5okboMrOFSD7E2R1mIFqzrlIN4NRu1AxWhPNiM8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731572254; c=relaxed/simple; bh=ocQgpKPOx0XcLpqISFGSjESyE6sRma++231CI0veC/0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jJw+4mSdiVDa3N4PVJuAhgxJljB5SdPqR7R50VoplQdVTTm8RwWSKIdWF4H6cDfhfAQt8T60CaSkxSOgk+CeF5aTGeh1VFftXtADoTT6f0RdjYIrzkY8aaV2ljBuHmxMjtgHHn+J3QggR4rYBy+J21Yt5l72wTmmyQT11VSEhWE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=hfgN+nDl; arc=none smtp.client-ip=198.175.65.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="hfgN+nDl" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1731572253; x=1763108253; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ocQgpKPOx0XcLpqISFGSjESyE6sRma++231CI0veC/0=; b=hfgN+nDl07zccguuw8LjFfd7wxMBH1VexQBS393Vd64slqX9DuVqT+Tk WBIjBdnkzhgyf4xaESgGL6rl3c3OsQAg66k3inyZ2uRbp4FrE2+wJcVRN EKvIuH9PMu06YmLezl9Uq6UhWF6OX28Cdxk+sIVhXk1jDyyU89yW9u9Ho 5fbdP1hXpNB/Hso9lMe9pdRaV9efZZYPAWCPzv2XLpil2RLPGlPacgYFy TclG/NjXTZ+eoofnR73sf4f51Y0f31XMrX4ECt1TPabj1A7ECo8ke86Pk IJxWD+Zf8/6IVR/MUC4C3AikJXqjmiq3plkUXMofxFdEq178lzluwX8x4 w==; X-CSE-ConnectionGUID: rM3KLc72T0Kvw1bq3BxO/g== X-CSE-MsgGUID: sp+wGm2/SzmumRiq0nfE1w== X-IronPort-AV: E=McAfee;i="6700,10204,11255"; a="42921269" X-IronPort-AV: E=Sophos;i="6.12,153,1728975600"; d="scan'208";a="42921269" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Nov 2024 00:17:33 -0800 X-CSE-ConnectionGUID: jJowESe6TKC+BYh6mIOHXA== X-CSE-MsgGUID: gp9mz9c4SoifszaSS/wpSA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,153,1728975600"; d="scan'208";a="88553860" Received: from unknown (HELO YongLiang-Ubuntu20-iLBPG12.png.intel.com) ([10.88.229.33]) by fmviesa010.fm.intel.com with ESMTP; 14 Nov 2024 00:17:29 -0800 From: Choong Yong Liang To: Andrew Lunn , Heiner Kallweit , Russell King , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Oleksij Rempel Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH net v1 1/2] net: phy: set eee_cfg based on PHY configuration Date: Thu, 14 Nov 2024 16:16:52 +0800 Message-Id: <20241114081653.3939346-2-yong.liang.choong@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241114081653.3939346-1-yong.liang.choong@linux.intel.com> References: <20241114081653.3939346-1-yong.liang.choong@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Not all PHYs have EEE enabled by default. For example, Marvell PHYs are designed to have EEE hardware disabled during the initial state, and it needs to be configured to turn it on again. This patch reads the PHY configuration and sets it as the initial value for eee_cfg.tx_lpi_enabled and eee_cfg.eee_enabled instead of having them set to true by default. Fixes: 49168d1980e2 ("net: phy: Add phy_support_eee() indicating MAC suppor= t EEE") Cc: Signed-off-by: Choong Yong Liang --- drivers/net/phy/phy_device.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 499797646580..b4fa40c2371a 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -3010,9 +3010,12 @@ EXPORT_SYMBOL_GPL(phy_advertise_eee_all); */ void phy_support_eee(struct phy_device *phydev) { + bool is_enabled =3D true; + + genphy_c45_eee_is_active(phydev, NULL, NULL, &is_enabled); linkmode_copy(phydev->advertising_eee, phydev->supported_eee); - phydev->eee_cfg.tx_lpi_enabled =3D true; - phydev->eee_cfg.eee_enabled =3D true; + phydev->eee_cfg.tx_lpi_enabled =3D is_enabled; + phydev->eee_cfg.eee_enabled =3D is_enabled; } EXPORT_SYMBOL(phy_support_eee); =20 --=20 2.34.1 From nobody Sat Nov 23 05:25:31 2024 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 69A001F76A6; Thu, 14 Nov 2024 08:17:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731572258; cv=none; b=IA5wcKgdPvIgwRpV+0xTmGOLA0mz/8q1yHBgrr2wXawoNAfgcYhJEUyoPfLznqbbb4tmdOxo2BDw+fFmtPCOoeiXywgk+VUR+1ypoS5NMmqh/2XEqfeX6eHsFg3FlDYnM3Uq0p0b7apd2M4flgWiB+aEbHM7eH+nFXZe9R+ws+c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731572258; c=relaxed/simple; bh=xrJukahaxgNQYaY6Ib9PxdkI6uOeHardKxoJD+xZf7U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DW/6d/cmmyr6gtM1ybktGowBbGaqBy9XH8v4sBfxWWPfbiVMR9Io4eweEbQHHpSydVuz5UHljX7O3KMP+P01eays35yL1KK+qF9qhGcXZ3ZIlf0/uaaZxUFgqv4ToWVzXCcp7Lp9D2PrpeMMwymYd3vlDAbryJNRPJF3a0reWlw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=MlMrFEFB; arc=none smtp.client-ip=198.175.65.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="MlMrFEFB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1731572258; x=1763108258; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xrJukahaxgNQYaY6Ib9PxdkI6uOeHardKxoJD+xZf7U=; b=MlMrFEFBLT9YeaZKjbMOg9TyU/k3CxrAr49Y6F3jevhDMtCud1BYgELT jjnJ5JLoiNenYZj3GxAsHJZHG0qjC9swX0fiJtxbULw7rpHMbbBxBQ9uj dcp4pbAN3Hq1MPuJ14Qp6WIOeR5xHroFWwVGT/JESCGjUc8SNY5wcFF0A trwwN4HDvXxGhjHCXKHq4rt0bqH8B9x4iMhPOvd6wNn3Z1FTzovRdes/Z s3/pam1vdAuw8C0ZjdHwnMOSYEVNSMaVdJaRHgEzSu0/CAzMcG33Dlqgy IO8qsXg0rQZx4HbFpmBem3gfJVcQhdIKB8fntthSC8CoxRFX8YkRlS/2L w==; X-CSE-ConnectionGUID: d1AZ6g1XQzKBqEcxTgrqBA== X-CSE-MsgGUID: bvkG2yKXT9+LIvEYxaV3RQ== X-IronPort-AV: E=McAfee;i="6700,10204,11255"; a="42921287" X-IronPort-AV: E=Sophos;i="6.12,153,1728975600"; d="scan'208";a="42921287" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Nov 2024 00:17:37 -0800 X-CSE-ConnectionGUID: 6xlRLCGzRvCeAy4d+oc+aA== X-CSE-MsgGUID: U32PUQYWQBSJGnHUzKVuGQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,153,1728975600"; d="scan'208";a="88553864" Received: from unknown (HELO YongLiang-Ubuntu20-iLBPG12.png.intel.com) ([10.88.229.33]) by fmviesa010.fm.intel.com with ESMTP; 14 Nov 2024 00:17:33 -0800 From: Choong Yong Liang To: Andrew Lunn , Heiner Kallweit , Russell King , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Oleksij Rempel Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH net v1 2/2] net: stmmac: set initial EEE policy configuration Date: Thu, 14 Nov 2024 16:16:53 +0800 Message-Id: <20241114081653.3939346-3-yong.liang.choong@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241114081653.3939346-1-yong.liang.choong@linux.intel.com> References: <20241114081653.3939346-1-yong.liang.choong@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Set the initial eee_cfg values to have 'ethtool --show-eee ' display the initial EEE configuration. Fixes: 49168d1980e2 ("net: phy: Add phy_support_eee() indicating MAC suppor= t EEE") Cc: Signed-off-by: Choong Yong Liang --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_main.c index 7bf275f127c9..5fce52a9412e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1204,7 +1204,7 @@ static int stmmac_init_phy(struct net_device *dev) netdev_err(priv->dev, "no phy at addr %d\n", addr); return -ENODEV; } - + phy_support_eee(phydev); ret =3D phylink_connect_phy(priv->phylink, phydev); } else { fwnode_handle_put(phy_fwnode); --=20 2.34.1