linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: pcs: Enable pre-emption packet for 10/100Mbps
@ 2021-04-22  7:48 mohammad.athari.ismail
  2021-04-22  8:16 ` Leon Romanovsky
  0 siblings, 1 reply; 2+ messages in thread
From: mohammad.athari.ismail @ 2021-04-22  7:48 UTC (permalink / raw)
  To: Jose Abreu, Andrew Lunn, Heiner Kallweit, David S . Miller,
	Jakub Kicinski, Russell King
  Cc: Ong Boon Leong, Voon Weifeng, vee.khee.wong, netdev,
	linux-kernel, mohammad.athari.ismail

From: Mohammad Athari Bin Ismail <mohammad.athari.ismail@intel.com>

Set VR_MII_DIG_CTRL1 bit-6(PRE_EMP) to enable pre-emption packet for
10/100Mbps by default. This setting doesn`t impact pre-emption
capability for other speeds.

Signed-off-by: Mohammad Athari Bin Ismail <mohammad.athari.ismail@intel.com>
---
 drivers/net/pcs/pcs-xpcs.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c
index 944ba105cac1..2dbc1d46821e 100644
--- a/drivers/net/pcs/pcs-xpcs.c
+++ b/drivers/net/pcs/pcs-xpcs.c
@@ -66,6 +66,7 @@
 
 /* VR_MII_DIG_CTRL1 */
 #define DW_VR_MII_DIG_CTRL1_MAC_AUTO_SW		BIT(9)
+#define DW_VR_MII_DIG_CTRL1_PRE_EMP		BIT(6)
 
 /* VR_MII_AN_CTRL */
 #define DW_VR_MII_AN_CTRL_TX_CONFIG_SHIFT	3
@@ -666,6 +667,10 @@ static int xpcs_config_aneg_c37_sgmii(struct mdio_xpcs_args *xpcs)
 	 *	 PHY about the link state change after C28 AN is completed
 	 *	 between PHY and Link Partner. There is also no need to
 	 *	 trigger AN restart for MAC-side SGMII.
+	 *
+	 * For pre-emption, the setting is :-
+	 * 1) VR_MII_DIG_CTRL1 Bit(6) [PRE_EMP] = 1b (Enable pre-emption packet
+	 *    for 10/100Mbps)
 	 */
 	ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_AN_CTRL);
 	if (ret < 0)
@@ -686,7 +691,7 @@ static int xpcs_config_aneg_c37_sgmii(struct mdio_xpcs_args *xpcs)
 	if (ret < 0)
 		return ret;
 
-	ret |= DW_VR_MII_DIG_CTRL1_MAC_AUTO_SW;
+	ret |= (DW_VR_MII_DIG_CTRL1_MAC_AUTO_SW | DW_VR_MII_DIG_CTRL1_PRE_EMP);
 
 	return xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_DIG_CTRL1, ret);
 }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: pcs: Enable pre-emption packet for 10/100Mbps
  2021-04-22  7:48 [PATCH net-next] net: pcs: Enable pre-emption packet for 10/100Mbps mohammad.athari.ismail
@ 2021-04-22  8:16 ` Leon Romanovsky
  0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2021-04-22  8:16 UTC (permalink / raw)
  To: mohammad.athari.ismail
  Cc: Jose Abreu, Andrew Lunn, Heiner Kallweit, David S . Miller,
	Jakub Kicinski, Russell King, Ong Boon Leong, Voon Weifeng,
	vee.khee.wong, netdev, linux-kernel

On Thu, Apr 22, 2021 at 03:48:51PM +0800, mohammad.athari.ismail@intel.com wrote:
> From: Mohammad Athari Bin Ismail <mohammad.athari.ismail@intel.com>
> 
> Set VR_MII_DIG_CTRL1 bit-6(PRE_EMP) to enable pre-emption packet for
> 10/100Mbps by default. This setting doesn`t impact pre-emption
> capability for other speeds.
> 
> Signed-off-by: Mohammad Athari Bin Ismail <mohammad.athari.ismail@intel.com>
> ---
>  drivers/net/pcs/pcs-xpcs.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c
> index 944ba105cac1..2dbc1d46821e 100644
> --- a/drivers/net/pcs/pcs-xpcs.c
> +++ b/drivers/net/pcs/pcs-xpcs.c
> @@ -66,6 +66,7 @@
>  
>  /* VR_MII_DIG_CTRL1 */
>  #define DW_VR_MII_DIG_CTRL1_MAC_AUTO_SW		BIT(9)
> +#define DW_VR_MII_DIG_CTRL1_PRE_EMP		BIT(6)
>  
>  /* VR_MII_AN_CTRL */
>  #define DW_VR_MII_AN_CTRL_TX_CONFIG_SHIFT	3
> @@ -666,6 +667,10 @@ static int xpcs_config_aneg_c37_sgmii(struct mdio_xpcs_args *xpcs)
>  	 *	 PHY about the link state change after C28 AN is completed
>  	 *	 between PHY and Link Partner. There is also no need to
>  	 *	 trigger AN restart for MAC-side SGMII.
> +	 *
> +	 * For pre-emption, the setting is :-
> +	 * 1) VR_MII_DIG_CTRL1 Bit(6) [PRE_EMP] = 1b (Enable pre-emption packet
> +	 *    for 10/100Mbps)
>  	 */
>  	ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_AN_CTRL);
>  	if (ret < 0)
> @@ -686,7 +691,7 @@ static int xpcs_config_aneg_c37_sgmii(struct mdio_xpcs_args *xpcs)
>  	if (ret < 0)
>  		return ret;
>  
> -	ret |= DW_VR_MII_DIG_CTRL1_MAC_AUTO_SW;
> +	ret |= (DW_VR_MII_DIG_CTRL1_MAC_AUTO_SW | DW_VR_MII_DIG_CTRL1_PRE_EMP);

() are useless here.

Thanks

>  
>  	return xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_DIG_CTRL1, ret);
>  }
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-22  8:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-22  7:48 [PATCH net-next] net: pcs: Enable pre-emption packet for 10/100Mbps mohammad.athari.ismail
2021-04-22  8:16 ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).