* [PATCH net-next 0/2] net: stmmac: further ptp cleanups
@ 2026-03-07 10:52 Russell King (Oracle)
2026-03-07 10:53 ` [PATCH net-next 1/2] net: stmmac: ptp: rearrange n_ext_ts initialisation Russell King (Oracle)
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Russell King (Oracle) @ 2026-03-07 10:52 UTC (permalink / raw)
To: Andrew Lunn
Cc: Alexandre Torgue, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, linux-arm-kernel, linux-stm32, netdev,
Paolo Abeni
Hi,
A couple of extra PTP cleanup patches.
The first uses a local variable when setting n_ext_ts which is a minor
simplification of the code. The second removes the now unnecessary
"available" flag for the PPS outputs.
drivers/net/ethernet/stmicro/stmmac/dwmac5.c | 2 --
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 2 --
drivers/net/ethernet/stmicro/stmmac/stmmac.h | 1 -
drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 10 ++++------
4 files changed, 4 insertions(+), 11 deletions(-)
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net-next 1/2] net: stmmac: ptp: rearrange n_ext_ts initialisation
2026-03-07 10:52 [PATCH net-next 0/2] net: stmmac: further ptp cleanups Russell King (Oracle)
@ 2026-03-07 10:53 ` Russell King (Oracle)
2026-03-07 10:53 ` [PATCH net-next 2/2] net: stmmac: ptp: remove redundant priv->pps[].available Russell King (Oracle)
2026-03-10 3:00 ` [PATCH net-next 0/2] net: stmmac: further ptp cleanups patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Russell King (Oracle) @ 2026-03-07 10:53 UTC (permalink / raw)
To: Andrew Lunn
Cc: Alexandre Torgue, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, linux-arm-kernel, linux-stm32, netdev,
Paolo Abeni
Use local variables for n_ext_ts rather than referencing the DMA
capability several times.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
index 98da499ba3b1..654d04f8c373 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
@@ -335,6 +335,7 @@ const struct ptp_clock_info dwmac1000_ptp_clock_ops = {
void stmmac_ptp_register(struct stmmac_priv *priv)
{
unsigned int pps_out_num = priv->dma_cap.pps_out_num;
+ unsigned int n_ext_ts;
int i;
if (pps_out_num > STMMAC_PPS_MAX) {
@@ -358,8 +359,9 @@ void stmmac_ptp_register(struct stmmac_priv *priv)
if (pps_out_num)
priv->ptp_clock_ops.n_per_out = pps_out_num;
- if (priv->dma_cap.aux_snapshot_n)
- priv->ptp_clock_ops.n_ext_ts = priv->dma_cap.aux_snapshot_n;
+ n_ext_ts = priv->dma_cap.aux_snapshot_n;
+ if (n_ext_ts)
+ priv->ptp_clock_ops.n_ext_ts = n_ext_ts;
if (priv->plat->ptp_max_adj)
priv->ptp_clock_ops.max_adj = priv->plat->ptp_max_adj;
--
2.47.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net-next 2/2] net: stmmac: ptp: remove redundant priv->pps[].available
2026-03-07 10:52 [PATCH net-next 0/2] net: stmmac: further ptp cleanups Russell King (Oracle)
2026-03-07 10:53 ` [PATCH net-next 1/2] net: stmmac: ptp: rearrange n_ext_ts initialisation Russell King (Oracle)
@ 2026-03-07 10:53 ` Russell King (Oracle)
2026-03-10 3:00 ` [PATCH net-next 0/2] net: stmmac: further ptp cleanups patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Russell King (Oracle) @ 2026-03-07 10:53 UTC (permalink / raw)
To: Andrew Lunn
Cc: Alexandre Torgue, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, linux-arm-kernel, linux-stm32, netdev,
Paolo Abeni
priv->pps[].available is set in stmmac_ptp_register() for all PPS
outputs reported by hardware up to STMMAC_PPS_MAX.
Since we now set priv->ptp_clock_ops.n_per_out to the number of PPS
outputs that both the hardware and driver can support to prevent
array overflow in stmmac_enable(), this makes priv->pps[].available
redundant. Remove this struct member.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
drivers/net/ethernet/stmicro/stmmac/dwmac5.c | 2 --
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 2 --
drivers/net/ethernet/stmicro/stmmac/stmmac.h | 1 -
drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 4 ----
4 files changed, 9 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac5.c b/drivers/net/ethernet/stmicro/stmmac/dwmac5.c
index 1c431b918719..f1bb981cab7c 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac5.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac5.c
@@ -525,8 +525,6 @@ int dwmac5_flex_pps_config(void __iomem *ioaddr, int index,
u32 val = readl(ioaddr + MAC_PPS_CONTROL);
u64 period;
- if (!cfg->available)
- return -EINVAL;
if (tnsec & TRGTBUSY0)
return -EBUSY;
if (!sub_second_inc || !systime_flags)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
index 915e7c2ab11f..efa76b147f9e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
@@ -1162,8 +1162,6 @@ static int dwxgmac2_flex_pps_config(void __iomem *ioaddr, int index,
u32 val = readl(ioaddr + XGMAC_PPS_CONTROL);
u64 period;
- if (!cfg->available)
- return -EINVAL;
if (tnsec & XGMAC_TRGTBUSY0)
return -EBUSY;
if (!sub_second_inc || !systime_flags)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index 1fe96cd24b4f..335e60439b42 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -181,7 +181,6 @@ struct stmmac_tc_entry {
#define STMMAC_PPS_MAX 4
struct stmmac_pps_cfg {
- bool available;
struct timespec64 start;
struct timespec64 period;
};
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
index 654d04f8c373..960249960004 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
@@ -336,7 +336,6 @@ void stmmac_ptp_register(struct stmmac_priv *priv)
{
unsigned int pps_out_num = priv->dma_cap.pps_out_num;
unsigned int n_ext_ts;
- int i;
if (pps_out_num > STMMAC_PPS_MAX) {
dev_warn(priv->device,
@@ -345,9 +344,6 @@ void stmmac_ptp_register(struct stmmac_priv *priv)
pps_out_num = STMMAC_PPS_MAX;
}
- for (i = 0; i < pps_out_num; i++)
- priv->pps[i].available = true;
-
/* Calculate the clock domain crossing (CDC) error if necessary */
priv->plat->cdc_error_adj = 0;
if (priv->plat->core_type == DWMAC_CORE_GMAC4)
--
2.47.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next 0/2] net: stmmac: further ptp cleanups
2026-03-07 10:52 [PATCH net-next 0/2] net: stmmac: further ptp cleanups Russell King (Oracle)
2026-03-07 10:53 ` [PATCH net-next 1/2] net: stmmac: ptp: rearrange n_ext_ts initialisation Russell King (Oracle)
2026-03-07 10:53 ` [PATCH net-next 2/2] net: stmmac: ptp: remove redundant priv->pps[].available Russell King (Oracle)
@ 2026-03-10 3:00 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-03-10 3:00 UTC (permalink / raw)
To: Russell King
Cc: andrew, alexandre.torgue, andrew+netdev, davem, edumazet, kuba,
linux-arm-kernel, linux-stm32, netdev, pabeni
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Sat, 7 Mar 2026 10:52:56 +0000 you wrote:
> Hi,
>
> A couple of extra PTP cleanup patches.
>
> The first uses a local variable when setting n_ext_ts which is a minor
> simplification of the code. The second removes the now unnecessary
> "available" flag for the PPS outputs.
>
> [...]
Here is the summary with links:
- [net-next,1/2] net: stmmac: ptp: rearrange n_ext_ts initialisation
https://git.kernel.org/netdev/net-next/c/b560d4434f98
- [net-next,2/2] net: stmmac: ptp: remove redundant priv->pps[].available
https://git.kernel.org/netdev/net-next/c/687e7863f027
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-03-10 3:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-07 10:52 [PATCH net-next 0/2] net: stmmac: further ptp cleanups Russell King (Oracle)
2026-03-07 10:53 ` [PATCH net-next 1/2] net: stmmac: ptp: rearrange n_ext_ts initialisation Russell King (Oracle)
2026-03-07 10:53 ` [PATCH net-next 2/2] net: stmmac: ptp: remove redundant priv->pps[].available Russell King (Oracle)
2026-03-10 3:00 ` [PATCH net-next 0/2] net: stmmac: further ptp cleanups patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox