summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Habets <mhabets@solarflare.com>2019-11-21 17:52:15 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-28 18:28:02 +0100
commitbaa541afe74550642f1dfe6df18628c4a87fa3d1 (patch)
treee6d8c41305363bd5426ecf5b9eebbbf947c064e8
parentc2e91f78ec21d88a750f67f7d62a28abd0dbb8f3 (diff)
downloadlinux-stable-baa541afe74550642f1dfe6df18628c4a87fa3d1.tar.gz
linux-stable-baa541afe74550642f1dfe6df18628c4a87fa3d1.tar.bz2
linux-stable-baa541afe74550642f1dfe6df18628c4a87fa3d1.zip
sfc: Only cancel the PPS workqueue if it exists
[ Upstream commit 723eb53690041740a13ac78efeaf6804f5d684c9 ] 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 77a5364f7a10..04cbff7f1b23 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -1320,7 +1320,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);