lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 7 Feb 2024 15:44:56 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Csókás Bence <csokas.bence@...lan.hu>
Cc: netdev@...r.kernel.org, Jakub Kicinski <kuba@...nel.org>,
	"David S. Miller" <davem@...emloft.net>,
	Wei Fang <wei.fang@....com>, Shenwei Wang <shenwei.wang@....com>,
	Clark Wang <xiaoning.wang@....com>,
	NXP Linux Team <linux-imx@....com>,
	Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
	Francesco Dolcini <francesco.dolcini@...adex.com>,
	Marc Kleine-Budde <mkl@...gutronix.de>
Subject: Re: [PATCH resubmit] net: fec: Add ECR bit macros, fix
 FEC_ECR_EN1588 being cleared on link-down

On Wed, Feb 07, 2024 at 01:36:11PM +0100, Csókás Bence wrote:
> FEC_ECR_EN1588 bit gets cleared after MAC reset in `fec_stop()`, which
> makes all 1588 functionality shut down on link-down. However, some
> functionality needs to be retained (e.g. PPS) even without link.

This is the second version of the patch, so the subject should say v2
within the [PATCH ].

Is this fixing a regression, or did it never work correctly?

> Signed-off-by: Csókás Bence <csokas.bence@...lan.hu>
> ---
>  drivers/net/ethernet/freescale/fec_main.c | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
> index 63707e065141..652251e48ad4 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -273,8 +273,11 @@ MODULE_PARM_DESC(macaddr, "FEC Ethernet MAC address");
>  #define FEC_MMFR_TA		(2 << 16)
>  #define FEC_MMFR_DATA(v)	(v & 0xffff)
>  /* FEC ECR bits definition */
> -#define FEC_ECR_MAGICEN		(1 << 2)
> -#define FEC_ECR_SLEEP		(1 << 3)
> +#define FEC_ECR_RESET   BIT(0)
> +#define FEC_ECR_ETHEREN BIT(1)
> +#define FEC_ECR_MAGICEN BIT(2)
> +#define FEC_ECR_SLEEP   BIT(3)
> +#define FEC_ECR_EN1588  BIT(4)

There was a request to keep the indentation the same. So the BIT()
need moving right.

>  
>  #define FEC_MII_TIMEOUT		30000 /* us */
>  
> @@ -1213,7 +1216,7 @@ fec_restart(struct net_device *ndev)
>  	}
>  
>  	if (fep->bufdesc_ex)
> -		ecntl |= (1 << 4);
> +		ecntl |= FEC_ECR_EN1588;

Please could you split this into two patches. The first patch
introduced the new #defines, and uses them in the existing code. That
should be obviously correct. And a second patch adding the new
functionality, with a good commit message explaining the change,
particularly the Why?

>  
>  	if (fep->quirks & FEC_QUIRK_DELAYED_CLKS_SUPPORT &&
>  	    fep->rgmii_txc_dly)
> @@ -1314,6 +1317,7 @@ fec_stop(struct net_device *ndev)
>  	struct fec_enet_private *fep = netdev_priv(ndev);
>  	u32 rmii_mode = readl(fep->hwp + FEC_R_CNTRL) & (1 << 8);
>  	u32 val;
> +	u32 ecntl = 0;

Reverse Christmas tree, as pointed out in your first version of the
patch.

Thanks
    Andrew

---
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ