Skip to content

Commit bb3f21e

Browse files
hyperenjuanguy11
authored andcommitted
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: e800654 ("ice: Use ice_adapter for PTP shared data instead of auxdev") Signed-off-by: Kohei Enju <kohei@enjuk.jp> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent 8e2a242 commit bb3f21e

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

drivers/net/ethernet/intel/ice/ice_ptp.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3080,7 +3080,13 @@ static int ice_ptp_setup_pf(struct ice_pf *pf)
30803080
struct ice_ptp *ctrl_ptp = ice_get_ctrl_ptp(pf);
30813081
struct ice_ptp *ptp = &pf->ptp;
30823082

3083-
if (WARN_ON(!ctrl_ptp) || pf->hw.mac_type == ICE_MAC_UNKNOWN)
3083+
if (!ctrl_ptp) {
3084+
dev_info(ice_pf_to_dev(pf),
3085+
"PTP unavailable: no controlling PF\n");
3086+
return -EOPNOTSUPP;
3087+
}
3088+
3089+
if (pf->hw.mac_type == ICE_MAC_UNKNOWN)
30843090
return -ENODEV;
30853091

30863092
INIT_LIST_HEAD(&ptp->port.list_node);

0 commit comments

Comments
 (0)