All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: davem@davemloft.net
Cc: Andre Guedes <andre.guedes@intel.com>,
	netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
	anthony.l.nguyen@intel.com, Aaron Brown <aaron.f.brown@intel.com>
Subject: [net-next v2 05/15] igc: Don't reschedule ptp_tx work
Date: Mon, 28 Sep 2020 14:50:08 -0700	[thread overview]
Message-ID: <20200928215018.952991-6-anthony.l.nguyen@intel.com> (raw)
In-Reply-To: <20200928215018.952991-1-anthony.l.nguyen@intel.com>

From: Andre Guedes <andre.guedes@intel.com>

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>
---
 drivers/net/ethernet/intel/igc/igc_ptp.c | 9 ++++-----
 1 file 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);
 }
 
 /**
-- 
2.26.2


  parent reply	other threads:[~2020-09-28 23:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-28 21:50 [net-next v2 00/15] 1GbE Intel Wired LAN Driver Updates 2020-09-28 Tony Nguyen
2020-09-28 21:50 ` [net-next v2 02/15] igb: read PBA number from flash Tony Nguyen
2020-09-28 21:50 ` [net-next v2 04/15] igc: Rename IGC_TSYNCTXCTL_VALID macro Tony Nguyen
2020-09-28 21:50 ` Tony Nguyen [this message]
2020-09-28 21:50 ` [net-next v2 06/15] igc: Remove timeout check from ptp_tx work Tony Nguyen
2020-09-28 21:50 ` [net-next v2 07/15] igc: Clean RX descriptor error flags Tony Nguyen
2020-09-28 21:50 ` [net-next v2 08/15] igc: Expose LPI counters Tony Nguyen
2020-09-28 21:50 ` [net-next v2 09/15] igc: Remove references to SYSTIMR register Tony Nguyen
2020-09-28 21:50 ` [net-next v2 10/15] igc: Save PTP time before a reset Tony Nguyen
2020-09-28 21:50 ` [net-next v2 11/15] igc: Remove reset disable flag Tony Nguyen
2020-09-28 21:50 ` [net-next v2 12/15] igc: Export a way to read the PTP timer Tony Nguyen
2020-09-28 21:50 ` [net-next v2 13/15] igc: Reject schedules with a base_time in the future Tony Nguyen
2020-09-28 21:50 ` [net-next v2 14/15] igc: Clean up nvm_info structure Tony Nguyen
2020-09-28 21:50 ` [net-next v2 15/15] e1000e: Add support for Meteor Lake Tony Nguyen
2020-09-28 21:54 ` [net-next v2 00/15] 1GbE Intel Wired LAN Driver Updates 2020-09-28 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200928215018.952991-6-anthony.l.nguyen@intel.com \
    --to=anthony.l.nguyen@intel.com \
    --cc=aaron.f.brown@intel.com \
    --cc=andre.guedes@intel.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=sassmann@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.