From: Gatien CHEVALLIER <gatien.chevallier@foss.st.com>
To: Simon Horman <horms@kernel.org>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Richard Cochran <richardcochran@gmail.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>, <netdev@vger.kernel.org>,
<linux-stm32@st-md-mailman.stormreply.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>
Subject: Re: [PATCH net-next v2 1/2] drivers: net: stmmac: handle start time set in the past for flexible PPS
Date: Wed, 30 Jul 2025 11:01:21 +0200 [thread overview]
Message-ID: <e485d74c-198d-48ee-a889-a4f2831506b9@foss.st.com> (raw)
In-Reply-To: <20250729165810.GG1877762@horms.kernel.org>
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@foss.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
next prev parent reply other threads:[~2025-07-30 9:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-29 14:51 [PATCH net-next v2 0/2] net: stmmac: allow generation of flexible PPS relative to MAC time Gatien Chevallier
2025-07-29 14:52 ` [PATCH net-next v2 1/2] drivers: net: stmmac: handle start time set in the past for flexible PPS Gatien Chevallier
2025-07-29 16:58 ` Simon Horman
2025-07-30 9:01 ` Gatien CHEVALLIER [this message]
2025-07-30 3:36 ` kernel test robot
2025-07-30 21:39 ` kernel test robot
2025-07-29 14:52 ` [PATCH net-next v2 2/2] ARM: dts: stm32: add missing PTP reference clocks on stm32mp13x SoCs Gatien Chevallier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e485d74c-198d-48ee-a889-a4f2831506b9@foss.st.com \
--to=gatien.chevallier@foss.st.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).