* [PATCH net] sfc: create PPS workqueue before registering phc
@ 2026-11-20 8:44 Alex Austin
2026-11-20 8:47 ` netdev-bot+sinfo
2026-11-20 11:50 ` Andy Moreton
0 siblings, 2 replies; 4+ messages in thread
From: Alex Austin @ 2026-11-20 8:44 UTC (permalink / raw)
To: Andy Moreton, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Richard Cochran
Cc: netdev, linux-net-drivers, linux-kernel, Alex Austin
Registering the PHC before creating the PPS workqueue leaves a small
window for PTP_CLK_REQ_PPS to be requested and a NIC generated PPS event
to arrive before the workqueue exists. Create the PPS workqueue before
registering the PHC.
Fixes: 7c236c43b838 ("sfc: Add support for IEEE-1588 PTP")
Signed-off-by: Alex Austin <alex.austin@amd.com>
---
drivers/net/ethernet/sfc/ptp.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
index 37511f234d76..ad6a4e7d990f 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -1633,26 +1633,26 @@ int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel)
if (efx->mcdi->fn_flags &
(1 << MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_PRIMARY)) {
+ INIT_WORK(&ptp->pps_work, efx_ptp_pps_worker);
+ ptp->pps_workwq = create_singlethread_workqueue("sfc_pps");
+ if (!ptp->pps_workwq) {
+ rc = -ENOMEM;
+ goto fail3;
+ }
+
ptp->phc_clock_info = efx_phc_clock_info;
ptp->phc_clock = ptp_clock_register(&ptp->phc_clock_info,
&efx->pci_dev->dev);
if (IS_ERR(ptp->phc_clock)) {
rc = PTR_ERR(ptp->phc_clock);
- goto fail3;
- } else if (ptp->phc_clock) {
- INIT_WORK(&ptp->pps_work, efx_ptp_pps_worker);
- ptp->pps_workwq = create_singlethread_workqueue("sfc_pps");
- if (!ptp->pps_workwq) {
- rc = -ENOMEM;
- goto fail4;
- }
+ goto fail4;
}
}
ptp->nic_ts_enabled = false;
return 0;
fail4:
- ptp_clock_unregister(efx->ptp_data->phc_clock);
+ destroy_workqueue(efx->ptp_data->pps_workwq);
fail3:
destroy_workqueue(efx->ptp_data->workwq);
@@ -1702,16 +1702,16 @@ void efx_ptp_remove(struct efx_nic *efx)
cancel_work_sync(&efx->ptp_data->work);
cancel_delayed_work_sync(&efx->ptp_data->cleanup_work);
- if (efx->ptp_data->pps_workwq)
+ if (efx->ptp_data->pps_workwq) {
cancel_work_sync(&efx->ptp_data->pps_work);
+ destroy_workqueue(efx->ptp_data->pps_workwq);
+ }
skb_queue_purge(&efx->ptp_data->rxq);
skb_queue_purge(&efx->ptp_data->txq);
- if (efx->ptp_data->phc_clock) {
- destroy_workqueue(efx->ptp_data->pps_workwq);
+ if (efx->ptp_data->phc_clock)
ptp_clock_unregister(efx->ptp_data->phc_clock);
- }
destroy_workqueue(efx->ptp_data->workwq);
---
base-commit: 9068e05d35f3b02a802f520e664032f802bcd2e9
change-id: 20261120-sfc_pps_wq_fix-2ed4ecc4c345
Best regards,
--
Alex Austin <alex.austin@amd.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] sfc: create PPS workqueue before registering phc
2026-11-20 8:44 [PATCH net] sfc: create PPS workqueue before registering phc Alex Austin
@ 2026-11-20 8:47 ` netdev-bot+sinfo
2026-11-20 9:04 ` Austin, Alex (DCCG)
2026-11-20 11:50 ` Andy Moreton
1 sibling, 1 reply; 4+ messages in thread
From: netdev-bot+sinfo @ 2026-11-20 8:47 UTC (permalink / raw)
To: Alex Austin
Cc: Andy Moreton, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Richard Cochran, netdev,
linux-net-drivers, linux-kernel
Hi!
This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:
- How the issue was discovered, e.g. hit in production, hit during
development, syzbot report, manual code inspection, LLM or static
analysis tool scan.
- Whether the issue was actually triggered, or is only theoretical
(e.g. found by LLM and not proven at runtime). If it was triggered
please include the symptoms, like the stack trace or kernel messages.
- What hardware the change was tested on. For driver fixes please
mention the device (and if relevant firmware version) used for
testing, or say that the change was not tested on real hardware.
Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account.
*IMPORTANT*: If you do repost (for other reasons) - please include
the relevant info in the cover letter or commit messages.
--
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] sfc: create PPS workqueue before registering phc
2026-11-20 8:47 ` netdev-bot+sinfo
@ 2026-11-20 9:04 ` Austin, Alex (DCCG)
0 siblings, 0 replies; 4+ messages in thread
From: Austin, Alex (DCCG) @ 2026-11-20 9:04 UTC (permalink / raw)
To: netdev-bot+sinfo
Cc: Andy Moreton, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Richard Cochran, netdev,
linux-net-drivers, linux-kernel
On 20/11/2026 08:47, netdev-bot+sinfo@kernel.org wrote:
>
> Hi!
>
> This is an automated message. This series looks like a fix, but its
> commit messages seem to be missing some information:
>
> - How the issue was discovered, e.g. hit in production, hit during
> development, syzbot report, manual code inspection, LLM or static
> analysis tool scan.
>
> - Whether the issue was actually triggered, or is only theoretical
> (e.g. found by LLM and not proven at runtime). If it was triggered
> please include the symptoms, like the stack trace or kernel messages.
>
> - What hardware the change was tested on. For driver fixes please
> mention the device (and if relevant firmware version) used for
> testing, or say that the change was not tested on real hardware.
>
> Please do not repost the series just to address the above. Instead,
> reply to this email with the missing information, so that reviewers
> can take it into account.
>
> *IMPORTANT*: If you do repost (for other reasons) - please include
> the relevant info in the cover letter or commit messages.
> --
> The evaluation is done by an LLM so it may be wrong, if you think
> that is the case please reply and explain.
This issue is theoretical and was found by manual code inspection.
Tested on AMD Solarflare X2522-25G.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] sfc: create PPS workqueue before registering phc
2026-11-20 8:44 [PATCH net] sfc: create PPS workqueue before registering phc Alex Austin
2026-11-20 8:47 ` netdev-bot+sinfo
@ 2026-11-20 11:50 ` Andy Moreton
1 sibling, 0 replies; 4+ messages in thread
From: Andy Moreton @ 2026-11-20 11:50 UTC (permalink / raw)
To: Alex Austin, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Richard Cochran
Cc: netdev, linux-net-drivers, linux-kernel
On 11/20/26 08:44, Alex Austin wrote:
> Registering the PHC before creating the PPS workqueue leaves a small
> window for PTP_CLK_REQ_PPS to be requested and a NIC generated PPS event
> to arrive before the workqueue exists. Create the PPS workqueue before
> registering the PHC.
>
> Fixes: 7c236c43b838 ("sfc: Add support for IEEE-1588 PTP")
> Signed-off-by: Alex Austin <alex.austin@amd.com>
> ---
> drivers/net/ethernet/sfc/ptp.c | 26 +++++++++++++-------------
> 1 file changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
> index 37511f234d76..ad6a4e7d990f 100644
> --- a/drivers/net/ethernet/sfc/ptp.c
> +++ b/drivers/net/ethernet/sfc/ptp.c
> @@ -1633,26 +1633,26 @@ int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel)
>
> if (efx->mcdi->fn_flags &
> (1 << MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_PRIMARY)) {
> + INIT_WORK(&ptp->pps_work, efx_ptp_pps_worker);
> + ptp->pps_workwq = create_singlethread_workqueue("sfc_pps");
> + if (!ptp->pps_workwq) {
> + rc = -ENOMEM;
> + goto fail3;
> + }
> +
> ptp->phc_clock_info = efx_phc_clock_info;
> ptp->phc_clock = ptp_clock_register(&ptp->phc_clock_info,
> &efx->pci_dev->dev);
> if (IS_ERR(ptp->phc_clock)) {
> rc = PTR_ERR(ptp->phc_clock);
> - goto fail3;
> - } else if (ptp->phc_clock) {
> - INIT_WORK(&ptp->pps_work, efx_ptp_pps_worker);
> - ptp->pps_workwq = create_singlethread_workqueue("sfc_pps");
> - if (!ptp->pps_workwq) {
> - rc = -ENOMEM;
> - goto fail4;
> - }
> + goto fail4;
> }
> }
> ptp->nic_ts_enabled = false;
>
> return 0;
> fail4:
> - ptp_clock_unregister(efx->ptp_data->phc_clock);
> + destroy_workqueue(efx->ptp_data->pps_workwq);
>
> fail3:
> destroy_workqueue(efx->ptp_data->workwq);
> @@ -1702,16 +1702,16 @@ void efx_ptp_remove(struct efx_nic *efx)
>
> cancel_work_sync(&efx->ptp_data->work);
> cancel_delayed_work_sync(&efx->ptp_data->cleanup_work);
> - if (efx->ptp_data->pps_workwq)
> + if (efx->ptp_data->pps_workwq) {
> cancel_work_sync(&efx->ptp_data->pps_work);
> + destroy_workqueue(efx->ptp_data->pps_workwq);
> + }
>
> skb_queue_purge(&efx->ptp_data->rxq);
> skb_queue_purge(&efx->ptp_data->txq);
>
> - if (efx->ptp_data->phc_clock) {
> - destroy_workqueue(efx->ptp_data->pps_workwq);
> + if (efx->ptp_data->phc_clock)
> ptp_clock_unregister(efx->ptp_data->phc_clock);
> - }
>
> destroy_workqueue(efx->ptp_data->workwq);
>
>
> ---
> base-commit: 9068e05d35f3b02a802f520e664032f802bcd2e9
> change-id: 20261120-sfc_pps_wq_fix-2ed4ecc4c345
>
> Best regards,
> --
> Alex Austin <alex.austin@amd.com>
>
Reviewed-by: Andy Moreton <andy.moreton@amd.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-11-20 11:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-20 8:44 [PATCH net] sfc: create PPS workqueue before registering phc Alex Austin
2026-11-20 8:47 ` netdev-bot+sinfo
2026-11-20 9:04 ` Austin, Alex (DCCG)
2026-11-20 11:50 ` Andy Moreton
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®