* [PATCH v1 iwl-net] ice: ptp: don't WARN when controlling PF is unavailable
@ 2026-02-01 14:14 Kohei Enju
2026-02-02 8:13 ` [Intel-wired-lan] " Loktionov, Aleksandr
2026-04-09 3:43 ` Rinitha, SX
0 siblings, 2 replies; 3+ messages in thread
From: Kohei Enju @ 2026-02-01 14:14 UTC (permalink / raw)
To: intel-wired-lan, netdev
Cc: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Richard Cochran,
Sergey Temerkhanov, Simon Horman, kohei.enju, Kohei Enju
In VFIO passthrough setups, it is possible to pass through only a PF
which doesn't own the source timer. In that case the PTP controlling PF
(adapter->ctrl_pf) is never initialized in the VM, so ice_get_ctrl_ptp()
returns NULL and triggers WARN_ON() in ice_ptp_setup_pf().
Since this is an expected behavior in that configuration, replace
WARN_ON() with an informational message and return -EOPNOTSUPP.
Fixes: e800654e85b5 ("ice: Use ice_adapter for PTP shared data instead of auxdev")
Signed-off-by: Kohei Enju <kohei@enjuk.jp>
---
drivers/net/ethernet/intel/ice/ice_ptp.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c
index 272683001476..082313023024 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.c
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
@@ -3048,7 +3048,13 @@ static int ice_ptp_setup_pf(struct ice_pf *pf)
struct ice_ptp *ctrl_ptp = ice_get_ctrl_ptp(pf);
struct ice_ptp *ptp = &pf->ptp;
- if (WARN_ON(!ctrl_ptp) || pf->hw.mac_type == ICE_MAC_UNKNOWN)
+ if (!ctrl_ptp) {
+ dev_info(ice_pf_to_dev(pf),
+ "PTP unavailable: no controlling PF\n");
+ return -EOPNOTSUPP;
+ }
+
+ if (pf->hw.mac_type == ICE_MAC_UNKNOWN)
return -ENODEV;
INIT_LIST_HEAD(&ptp->port.list_node);
--
2.51.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* RE: [Intel-wired-lan] [PATCH v1 iwl-net] ice: ptp: don't WARN when controlling PF is unavailable
2026-02-01 14:14 [PATCH v1 iwl-net] ice: ptp: don't WARN when controlling PF is unavailable Kohei Enju
@ 2026-02-02 8:13 ` Loktionov, Aleksandr
2026-04-09 3:43 ` Rinitha, SX
1 sibling, 0 replies; 3+ messages in thread
From: Loktionov, Aleksandr @ 2026-02-02 8:13 UTC (permalink / raw)
To: Kohei Enju, intel-wired-lan@lists.osuosl.org,
netdev@vger.kernel.org
Cc: Nguyen, Anthony L, Kitszel, Przemyslaw, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Richard Cochran, Temerkhanov, Sergey, Simon Horman,
kohei.enju@gmail.com
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Kohei Enju
> Sent: Sunday, February 1, 2026 3:14 PM
> To: intel-wired-lan@lists.osuosl.org; netdev@vger.kernel.org
> Cc: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Kitszel,
> Przemyslaw <przemyslaw.kitszel@intel.com>; 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>; Richard Cochran <richardcochran@gmail.com>;
> Temerkhanov, Sergey <sergey.temerkhanov@intel.com>; Simon Horman
> <horms@kernel.org>; kohei.enju@gmail.com; Kohei Enju <kohei@enjuk.jp>
> Subject: [Intel-wired-lan] [PATCH v1 iwl-net] ice: ptp: don't WARN
> when controlling PF is unavailable
>
> In VFIO passthrough setups, it is possible to pass through only a PF
> which doesn't own the source timer. In that case the PTP controlling
> PF
> (adapter->ctrl_pf) is never initialized in the VM, so
> ice_get_ctrl_ptp() returns NULL and triggers WARN_ON() in
> ice_ptp_setup_pf().
>
> Since this is an expected behavior in that configuration, replace
> WARN_ON() with an informational message and return -EOPNOTSUPP.
>
> Fixes: e800654e85b5 ("ice: Use ice_adapter for PTP shared data instead
> of auxdev")
> Signed-off-by: Kohei Enju <kohei@enjuk.jp>
> ---
> drivers/net/ethernet/intel/ice/ice_ptp.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c
> b/drivers/net/ethernet/intel/ice/ice_ptp.c
> index 272683001476..082313023024 100644
> --- a/drivers/net/ethernet/intel/ice/ice_ptp.c
> +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
> @@ -3048,7 +3048,13 @@ static int ice_ptp_setup_pf(struct ice_pf *pf)
> struct ice_ptp *ctrl_ptp = ice_get_ctrl_ptp(pf);
> struct ice_ptp *ptp = &pf->ptp;
>
> - if (WARN_ON(!ctrl_ptp) || pf->hw.mac_type == ICE_MAC_UNKNOWN)
> + if (!ctrl_ptp) {
> + dev_info(ice_pf_to_dev(pf),
> + "PTP unavailable: no controlling PF\n");
> + return -EOPNOTSUPP;
> + }
> +
> + if (pf->hw.mac_type == ICE_MAC_UNKNOWN)
> return -ENODEV;
>
> INIT_LIST_HEAD(&ptp->port.list_node);
> --
> 2.51.0
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* RE: [Intel-wired-lan] [PATCH v1 iwl-net] ice: ptp: don't WARN when controlling PF is unavailable
2026-02-01 14:14 [PATCH v1 iwl-net] ice: ptp: don't WARN when controlling PF is unavailable Kohei Enju
2026-02-02 8:13 ` [Intel-wired-lan] " Loktionov, Aleksandr
@ 2026-04-09 3:43 ` Rinitha, SX
1 sibling, 0 replies; 3+ messages in thread
From: Rinitha, SX @ 2026-04-09 3:43 UTC (permalink / raw)
To: Kohei Enju, intel-wired-lan@lists.osuosl.org,
netdev@vger.kernel.org
Cc: Nguyen, Anthony L, Kitszel, Przemyslaw, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Richard Cochran, Temerkhanov, Sergey, Simon Horman,
kohei.enju@gmail.com
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of Kohei Enju
> Sent: 01 February 2026 19:44
> To: intel-wired-lan@lists.osuosl.org; netdev@vger.kernel.org
> Cc: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw <przemyslaw.kitszel@intel.com>; 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>; Richard Cochran <richardcochran@gmail.com>; Temerkhanov, Sergey <sergey.temerkhanov@intel.com>; Simon Horman <horms@kernel.org>; kohei.enju@gmail.com; Kohei Enju <kohei@enjuk.jp>
> Subject: [Intel-wired-lan] [PATCH v1 iwl-net] ice: ptp: don't WARN when controlling PF is unavailable
>
> In VFIO passthrough setups, it is possible to pass through only a PF which doesn't own the source timer. In that case the PTP controlling PF
> (adapter->ctrl_pf) is never initialized in the VM, so ice_get_ctrl_ptp() returns NULL and triggers WARN_ON() in ice_ptp_setup_pf().
>
> Since this is an expected behavior in that configuration, replace
> WARN_ON() with an informational message and return -EOPNOTSUPP.
>
> Fixes: e800654e85b5 ("ice: Use ice_adapter for PTP shared data instead of auxdev")
> Signed-off-by: Kohei Enju <kohei@enjuk.jp>
> ---
> drivers/net/ethernet/intel/ice/ice_ptp.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-09 3:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-01 14:14 [PATCH v1 iwl-net] ice: ptp: don't WARN when controlling PF is unavailable Kohei Enju
2026-02-02 8:13 ` [Intel-wired-lan] " Loktionov, Aleksandr
2026-04-09 3:43 ` Rinitha, SX
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox