summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Habets <mhabets@solarflare.com>2019-11-21 17:52:15 +0000
committerBen Hutchings <ben@decadent.org.uk>2019-12-19 15:59:03 +0000
commit5d9b8c6e7ab6130e238269dbbe26de0c75724340 (patch)
tree34f45d13395acadc0dc317c245ee54e4373a7e11
parentd1dab3b8ec630c032e629da5342d0c6a6b60d58e (diff)
downloadlinux-stable-5d9b8c6e7ab6130e238269dbbe26de0c75724340.tar.gz
linux-stable-5d9b8c6e7ab6130e238269dbbe26de0c75724340.tar.bz2
linux-stable-5d9b8c6e7ab6130e238269dbbe26de0c75724340.zip
sfc: Only cancel the PPS workqueue if it exists
commit 723eb53690041740a13ac78efeaf6804f5d684c9 upstream. 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> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-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 6b861e3de4b0..ecfe03412dfa 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -1310,7 +1310,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);