All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH S51 01/13] ice: rename misleading grst_delay variable
@ 2020-07-30  0:19 Tony Nguyen
  2020-07-30  0:19 ` [Intel-wired-lan] [PATCH S51 02/13] ice: fix the vsi_id mask to be 10 bit for set_rss_lut Tony Nguyen
                   ` (12 more replies)
  0 siblings, 13 replies; 26+ messages in thread
From: Tony Nguyen @ 2020-07-30  0:19 UTC (permalink / raw)
  To: intel-wired-lan

From: Nick Nunley <nicholas.d.nunley@intel.com>

The grst_delay variable in ice_check_reset contains the maximum time
(in 100 msec units) that the driver will wait for a reset event to
transition to the Device Active state. The value is the sum of three
separate components:
1) The maximum time it may take for the firmware to process its
outstanding command before handling the reset request.
2) The value in RSTCTL.GRSTDEL (the delay firmware inserts between first
seeing the driver reset request and the actual hardware assertion).
3) The maximum expected reset processing time in hardware.

Referring to this total time as "grst_delay" is misleading and
potentially confusing to someone checking the code and cross-referencing
the hardware specification.

Fix this by renaming the variable to "grst_timeout", which is more
descriptive of its actual use.

Signed-off-by: Nick Nunley <nicholas.d.nunley@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_common.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c
index ad5941ec7b11..8a93fbd6f1be 100644
--- a/drivers/net/ethernet/intel/ice/ice_common.c
+++ b/drivers/net/ethernet/intel/ice/ice_common.c
@@ -1027,23 +1027,23 @@ void ice_deinit_hw(struct ice_hw *hw)
  */
 enum ice_status ice_check_reset(struct ice_hw *hw)
 {
-	u32 cnt, reg = 0, grst_delay, uld_mask;
+	u32 cnt, reg = 0, grst_timeout, uld_mask;
 
 	/* Poll for Device Active state in case a recent CORER, GLOBR,
 	 * or EMPR has occurred. The grst delay value is in 100ms units.
 	 * Add 1sec for outstanding AQ commands that can take a long time.
 	 */
-	grst_delay = ((rd32(hw, GLGEN_RSTCTL) & GLGEN_RSTCTL_GRSTDEL_M) >>
-		      GLGEN_RSTCTL_GRSTDEL_S) + 10;
+	grst_timeout = ((rd32(hw, GLGEN_RSTCTL) & GLGEN_RSTCTL_GRSTDEL_M) >>
+			GLGEN_RSTCTL_GRSTDEL_S) + 10;
 
-	for (cnt = 0; cnt < grst_delay; cnt++) {
+	for (cnt = 0; cnt < grst_timeout; cnt++) {
 		mdelay(100);
 		reg = rd32(hw, GLGEN_RSTAT);
 		if (!(reg & GLGEN_RSTAT_DEVSTATE_M))
 			break;
 	}
 
-	if (cnt == grst_delay) {
+	if (cnt == grst_timeout) {
 		ice_debug(hw, ICE_DBG_INIT,
 			  "Global reset polling failed to complete.\n");
 		return ICE_ERR_RESET_FAILED;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2020-07-31 20:00 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-30  0:19 [Intel-wired-lan] [PATCH S51 01/13] ice: rename misleading grst_delay variable Tony Nguyen
2020-07-30  0:19 ` [Intel-wired-lan] [PATCH S51 02/13] ice: fix the vsi_id mask to be 10 bit for set_rss_lut Tony Nguyen
2020-07-31 19:57   ` Bowers, AndrewX
2020-07-30  0:19 ` [Intel-wired-lan] [PATCH S51 03/13] ice: Fix RSS profile locks Tony Nguyen
2020-07-31 19:57   ` Bowers, AndrewX
2020-07-30  0:19 ` [Intel-wired-lan] [PATCH S51 04/13] ice: remove page_reuse statistic Tony Nguyen
2020-07-31 19:59   ` Bowers, AndrewX
2020-07-30  0:19 ` [Intel-wired-lan] [PATCH S51 05/13] ice: add useful statistics Tony Nguyen
2020-07-31 19:59   ` Bowers, AndrewX
2020-07-30  0:19 ` [Intel-wired-lan] [PATCH S51 06/13] ice: Clear and free XLT entries on reset Tony Nguyen
2020-07-31 19:58   ` Bowers, AndrewX
2020-07-30  0:19 ` [Intel-wired-lan] [PATCH S51 07/13] ice: Allow 2 queue pairs per VF on SR-IOV initialization Tony Nguyen
2020-07-31 20:00   ` Bowers, AndrewX
2020-07-30  0:19 ` [Intel-wired-lan] [PATCH S51 08/13] ice: port fix for chk_linearlize Tony Nguyen
2020-07-31 19:56   ` Bowers, AndrewX
2020-07-30  0:19 ` [Intel-wired-lan] [PATCH S51 09/13] ice: Graceful error handling in HW table calloc failure Tony Nguyen
2020-07-31 19:58   ` Bowers, AndrewX
2020-07-30  0:19 ` [Intel-wired-lan] [PATCH S51 10/13] ice: Disable VLAN pruning in promiscuous mode Tony Nguyen
2020-07-31 19:58   ` Bowers, AndrewX
2020-07-30  0:19 ` [Intel-wired-lan] [PATCH S51 11/13] ice: update PTYPE lookup table Tony Nguyen
2020-07-31 19:58   ` Bowers, AndrewX
2020-07-30  0:19 ` [Intel-wired-lan] [PATCH S51 12/13] ice: adjust profile id map locks Tony Nguyen
2020-07-31 19:57   ` Bowers, AndrewX
2020-07-30  0:19 ` [Intel-wired-lan] [PATCH S51 13/13] ice: Misc minor fixes Tony Nguyen
2020-07-31 19:56   ` Bowers, AndrewX
2020-07-31 19:59 ` [Intel-wired-lan] [PATCH S51 01/13] ice: rename misleading grst_delay variable Bowers, AndrewX

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.