mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: netdev-bot+sashiko@kernel.org, alex.austin@amd.com
Cc: ecree.xilinx@gmail.com, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	richardcochran@gmail.com, alucerop@amd.com,
	pieter.jansen-van-vuuren@amd.com, netdev@vger.kernel.org,
	linux-net-drivers@amd.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v4 2/3] sfc: ptp: serialize host and MC synchronization transactions
Date: Mon, 2 Nov 2026 13:18:55 +0100	[thread overview]
Message-ID: <836982e0-b733-44d4-ae2b-20276589f867@redhat.com> (raw)
In-Reply-To: <179336481081.3134.5405870739856758840@kernel.org>

On 10/30/26 13:53, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found more severe
> issue(s) in other patches of this series. This mail is only an FYI, in case
> you want to address the nit picks below when you respin.
> 
> Low priority / nit picks for your consideration:
> 
> - [Low] The new kernel-doc for `@phc_lock` in struct efx_ptp_data
>    (drivers/net/ethernet/sfc/ptp.c:275-276) says the lock "Serializes PHC…
> 
> Pre-existing issues:
> - [High] This problem wasn't introduced by this patch, but
>    `_efx_phc_adjtime()` in drivers/net/ethernet/sfc/ptp.c (line 2144)…
> - [Medium] Baseline decision: not a defect of this patch (pre-existing,
>    Medium, in a driver the patch does not touch).
> - [Low] Baseline decision: false positive, fixed later in the series.

Note you can usually ignore pre-existing issues. Exceptions are
e.g. when the solution for the pre-existing issue will require
a significant rework of the patch at hand or impact is drammatic.

BTW I agree comments WRT problems still existing on siena are
unrelated and should be addressed separately.

> sfc: ptp: serialize host and MC synchronization transactions
> 
> This adds a phc_lock mutex to struct efx_ptp_data. The mutex is held
> across the whole efx_ptp_synchronize() transaction and around the PHC
> adjfine/adjtime/settime operations, so the PPS worker and the hwtstamp
> enable path no longer clobber each other's handshake flag and timesets.
> It also bails out of efx_ptp_synchronize() when efx_mcdi_rpc_start()
> fails.
> 
>> diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
>> index 957ca08092e7f..e26269fae38d6 100644
>> --- a/drivers/net/ethernet/sfc/ptp.c
>> +++ b/drivers/net/ethernet/sfc/ptp.c
> 
> [ ... ]
> 
>> @@ -271,6 +272,8 @@ struct efx_ptp_rxfilter {
>>    * frequency adjustment into a fixed point fractional nanosecond format.
>>    * @current_adjfreq: Current ppb adjustment.
>>    * @phc_clock: Pointer to registered phc device (if primary function)
>> + * @phc_lock: Serializes PHC commands and synchronization, and protects
>> + *	      @current_adjfreq
> 
> [Severity: Low]
> Does this comment claim more coverage than the code gives? Two of the
> callbacks in the PHC ops table don't take phc_lock. efx_phc_gettime()
> (.gettime64) sends MC_CMD_PTP_OP_READ_NIC_TIME, and efx_phc_enable()
> (.enable) flips nic_ts_enabled. A standalone clock_gettime() on the PHC
> therefore runs without phc_lock.
> 
> Making the comment true by adding the lock to efx_phc_gettime() would
> self-deadlock, because efx_phc_settime() now calls it with phc_lock
> already held:
> 
> 	mutex_lock(&ptp_data->phc_lock);
> 	rc = efx_phc_gettime(ptp, &time_now);
> 
> Nothing breaks today, since the MCDI interface lock already serializes
> the RPCs. Could the comment instead list what phc_lock actually covers
> (synchronize, adjfine, adjtime and settime)?
You forgot to comment on this one. My reading is that this is just a
slightly misleading comment.

/P


  parent reply	other threads:[~2026-11-02 12:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-26 12:30 [PATCH net v4 0/3] sfc: fix PTP synchronization races Alex Austin
2026-10-26 12:30 ` [PATCH net v4 1/3] sfc: ptp: drop the stale frequency reset in efx_ptp_start() Alex Austin
2026-10-30 12:53   ` netdev-bot+sashiko
2026-10-30 14:45     ` Austin, Alex (DCCG)
2026-10-26 12:30 ` [PATCH net v4 2/3] sfc: ptp: serialize host and MC synchronization transactions Alex Austin
2026-10-30 12:53   ` netdev-bot+sashiko
2026-10-30 14:50     ` Austin, Alex (DCCG)
2026-11-02 12:18     ` Paolo Abeni [this message]
2026-10-26 12:30 ` [PATCH net v4 3/3] sfc: ptp: avoid racing PPS timestamp updates Alex Austin
2026-10-30 12:53   ` netdev-bot+sashiko
2026-10-30 14:52     ` Austin, Alex (DCCG)
2026-11-02 14:10 ` [PATCH net v4 0/3] sfc: fix PTP synchronization races patchwork-bot+netdevbpf

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=836982e0-b733-44d4-ae2b-20276589f867@redhat.com \
    --to=pabeni@redhat.com \
    --cc=alex.austin@amd.com \
    --cc=alucerop@amd.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=ecree.xilinx@gmail.com \
    --cc=edumazet@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-net-drivers@amd.com \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pieter.jansen-van-vuuren@amd.com \
    --cc=richardcochran@gmail.com \
    /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

all inboxes | Powered by JetHome®