[PATCH net-next 3/8] net: stmmac: move PTP interrupt handling to IP-specific DWMAC file

Simon Horman simon.horman at corigine.com
Fri Jun 16 06:34:01 PDT 2023


On Fri, Jun 16, 2023 at 12:04:04PM +0200, alexis.lothore at bootlin.com wrote:
> From: Alexis Lothoré <alexis.lothore at bootlin.com>
> 
> As for auxiliary snapshot triggers configuration, reading snapshots depends
> on specific registers addresses and layout. As a consequence, move
> PTP-specific part of stmmac interrupt handling to specific DWMAC IP file
> 
> Signed-off-by: Alexis Lothoré <alexis.lothore at bootlin.com>

Hi Alexis,

thanks for your patch.

...

> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
> index 01c0822d37e6..b36fbb0fa5da 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c

...

> +static void dwmac4_ptp_isr(struct stmmac_priv *priv)
> +{
> +	u32 num_snapshot, ts_status;
> +	struct ptp_clock_event event;
> +	unsigned long flags;
> +	u64 ptp_time;
> +	int i;

Please use reverse xmas tree - longest line to shortest - for new
Networking code.

	struct ptp_clock_event event;
	u32 num_snapshot, ts_status;
	unsigned long flags;
	u64 ptp_time;
	int i;

...

> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h
> index 9e0ff2cec352..92ed421702b9 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h
> @@ -23,9 +23,6 @@
>  #define	PTP_STSUR	0x10	/* System Time – Seconds Update Reg */
>  #define	PTP_STNSUR	0x14	/* System Time – Nanoseconds Update Reg */
>  #define	PTP_TAR		0x18	/* Timestamp Addend Reg */
> -#define	PTP_ACR		0x40	/* Auxiliary Control Reg */

Unfortunately this seems to break the build of
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
on an x86_64 alllodconfig, as PTP_ACR is used in that file.

> -#define	PTP_ATNR	0x48	/* Auxiliary Timestamp - Nanoseconds Reg */
> -#define	PTP_ATSR	0x4c	/* Auxiliary Timestamp - Seconds Reg */
>  
>  #define	PTP_STNSUR_ADDSUB_SHIFT	31
>  #define	PTP_DIGITAL_ROLLOVER_MODE	0x3B9ACA00	/* 10e9-1 ns */

--
pw-bot: changes-requested




More information about the linux-arm-kernel mailing list