summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/ptp.c
diff options
context:
space:
mode:
authorMartin Habets <mhabets@solarflare.com>2019-11-21 18:52:15 +0100
committerDavid S. Miller <davem@davemloft.net>2019-11-21 21:06:06 +0100
commit723eb53690041740a13ac78efeaf6804f5d684c9 (patch)
treee5ee57143dccb75b9a518101f2688a13f974e6e0 /drivers/net/ethernet/sfc/ptp.c
parentnfc: port100: handle command failure cleanly (diff)
downloadlinux-723eb53690041740a13ac78efeaf6804f5d684c9.tar.xz
linux-723eb53690041740a13ac78efeaf6804f5d684c9.zip
sfc: Only cancel the PPS workqueue if it exists
The workqueue only exists for the primary PF. For other functions we hit a WARN_ON in kernel/workqueue.c. Fixes: 7c236c43b838 ("sfc: Add support for IEEE-1588 PTP") Signed-off-by: Martin Habets <mhabets@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/ptp.c')
-rw-r--r--drivers/net/ethernet/sfc/ptp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
index 02ed6d1b716c..af15a737c675 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -1531,7 +1531,8 @@ void efx_ptp_remove(struct efx_nic *efx)
(void)efx_ptp_disable(efx);
cancel_work_sync(&efx->ptp_data->work);
- cancel_work_sync(&efx->ptp_data->pps_work);
+ if (efx->ptp_data->pps_workwq)
+ cancel_work_sync(&efx->ptp_data->pps_work);
skb_queue_purge(&efx->ptp_data->rxq);
skb_queue_purge(&efx->ptp_data->txq);