summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAndre Guedes <andre.guedes@intel.com>2020-07-29 02:37:52 +0300
committerTony Nguyen <anthony.l.nguyen@intel.com>2020-09-29 00:42:45 +0300
commit530a763db88e9eb9671b2c56343ca08f0c43cff6 (patch)
treece6f4b60cd821005104c9a985bdb15c3e0f61207 /drivers
parent77370df39c4bdd9dbcd8bd64f00d4b60e925613d (diff)
downloadlinux-530a763db88e9eb9671b2c56343ca08f0c43cff6.tar.xz
igc: Don't reschedule ptp_tx work
The ptp_tx work is scheduled only if TSICR.TXTS bit is set, therefore TSYNCTXCTL.TXTT_0 bit is expected to be set when we check it igc_ptp_tx_ work(). If it isn't, something is really off and rescheduling the ptp_tx work to check it later doesn't help much. This patch changes the code to WARN_ON_ONCE() if this situation ever happens. Signed-off-by: Andre Guedes <andre.guedes@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/intel/igc/igc_ptp.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/ethernet/intel/igc/igc_ptp.c b/drivers/net/ethernet/intel/igc/igc_ptp.c
index dbe0776a7f2f..791f406f1314 100644
--- a/drivers/net/ethernet/intel/igc/igc_ptp.c
+++ b/drivers/net/ethernet/intel/igc/igc_ptp.c
@@ -429,11 +429,10 @@ static void igc_ptp_tx_work(struct work_struct *work)
}
tsynctxctl = rd32(IGC_TSYNCTXCTL);
- if (tsynctxctl & IGC_TSYNCTXCTL_TXTT_0)
- igc_ptp_tx_hwtstamp(adapter);
- else
- /* reschedule to check later */
- schedule_work(&adapter->ptp_tx_work);
+ if (WARN_ON_ONCE(!(tsynctxctl & IGC_TSYNCTXCTL_TXTT_0)))
+ return;
+
+ igc_ptp_tx_hwtstamp(adapter);
}
/**