[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e485d74c-198d-48ee-a889-a4f2831506b9@foss.st.com>
Date: Wed, 30 Jul 2025 11:01:21 +0200
From: Gatien CHEVALLIER <gatien.chevallier@...s.st.com>
To: Simon Horman <horms@...nel.org>
CC: Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller"
<davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
<kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Maxime Coquelin
<mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Richard Cochran <richardcochran@...il.com>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, <netdev@...r.kernel.org>,
<linux-stm32@...md-mailman.stormreply.com>,
<linux-arm-kernel@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
<devicetree@...r.kernel.org>
Subject: Re: [PATCH net-next v2 1/2] drivers: net: stmmac: handle start time
set in the past for flexible PPS
On 7/29/25 18:58, Simon Horman wrote:
> On Tue, Jul 29, 2025 at 04:52:00PM +0200, Gatien Chevallier wrote:
>> In case the time arguments used for flexible PPS signal generation are in
>> the past, consider the arguments to be a time offset relative to the MAC
>> system time.
>>
>> This way, past time use case is handled and it avoids the tedious work
>> of passing an absolute time value for the flexible PPS signal generation
>> while not breaking existing scripts that may rely on this behavior.
>>
>> Signed-off-by: Gatien Chevallier <gatien.chevallier@...s.st.com>
>> ---
>> drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 31 ++++++++++++++++++++++++
>> 1 file changed, 31 insertions(+)
>>
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
>> index 3767ba495e78d210b0529ee1754e5331f2dd0a47..5c712b33851081b5ae1dbf2a0988919ae647a9e2 100644
>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
>> @@ -10,6 +10,8 @@
>> #include "stmmac.h"
>> #include "stmmac_ptp.h"
>>
>> +#define PTP_SAFE_TIME_OFFSET_NS 500000
>> +
>> /**
>> * stmmac_adjust_freq
>> *
>> @@ -172,6 +174,10 @@ static int stmmac_enable(struct ptp_clock_info *ptp,
>>
>> switch (rq->type) {
>> case PTP_CLK_REQ_PEROUT:
>> + struct timespec64 curr_time;
>> + u64 target_ns = 0;
>> + u64 ns = 0;
>> +
>
> I think you need to wrap this case in {}, as is already done for the following
> case.
>
> Clang 20.1.8 W=1 build warn about the current arrangement as follows.
>
> .../stmmac_ptp.c:177:3: warning: label followed by a declaration is a C23 extension [-Wc23-extensions]
> 177 | struct timespec64 curr_time;
> | ^
> 1 warning generated.
>
> GCC 8.5.0 (but not 15.1.0) also flags this problem.
>
Hello Simon,
Ok I will comply for V3.
> Also, please note:
>
> ## Form letter - net-next-closed
>
> The merge window for v6.17 has begun and therefore net-next is closed
> for new drivers, features, code refactoring and optimizations. We are
> currently accepting bug fixes only.
>
> Please repost when net-next reopens after 11th August.
>
> RFC patches sent for review only are obviously welcome at any time.
>
> See: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#development-cycle
>
Thank you for pointing this out.
Best regards,
Gatien
Powered by blists - more mailing lists