sfc: Only cancel the PPS workqueue if it exists
authorMartin Habets <mhabets@solarflare.com>
Thu, 21 Nov 2019 17:52:15 +0000 (17:52 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 1 Dec 2019 08:13:10 +0000 (09:13 +0100)
[ 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>
drivers/net/ethernet/sfc/ptp.c

index 60cdb97f58e2e315cf690ee58a16004926528583..f2269079269772a3acd2eadf83b7dc8e1829b243 100644 (file)
@@ -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);