diff options
author | Shannon Nelson <shannon.nelson@intel.com> | 2014-11-13 03:23:21 -0500 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2014-12-09 15:57:04 -0500 |
commit | a3f0b381ee4a84b633ea60ffa8e01f84e9528c75 (patch) | |
tree | b7ecb0315f2d7ecd7dc86f8d17ef714cdec8d4e0 | |
parent | 0fdd052c8c101afb6fa9dac753e5a6fa4b265628 (diff) |
i40e: poll on NVM semaphore only if not other error
Only poll on the NVM semaphore if there's time left on a previous
reservation. Also, add a little more info to debug messages.
Change-ID: I2439bf870b95a28b810dcb5cca1c06440463cf8a
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_nvm.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_nvm.c b/drivers/net/ethernet/intel/i40e/i40e_nvm.c index f3d1c85d7ab8..0fc62fc941e8 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_nvm.c +++ b/drivers/net/ethernet/intel/i40e/i40e_nvm.c | |||
@@ -93,10 +93,15 @@ i40e_status i40e_acquire_nvm(struct i40e_hw *hw, | |||
93 | /* Store the timeout */ | 93 | /* Store the timeout */ |
94 | hw->nvm.hw_semaphore_timeout = I40E_MS_TO_GTIME(time_left) + gtime; | 94 | hw->nvm.hw_semaphore_timeout = I40E_MS_TO_GTIME(time_left) + gtime; |
95 | 95 | ||
96 | if (ret_code) { | 96 | if (ret_code) |
97 | i40e_debug(hw, I40E_DEBUG_NVM, | ||
98 | "NVM acquire type %d failed time_left=%llu ret=%d aq_err=%d\n", | ||
99 | access, time_left, ret_code, hw->aq.asq_last_status); | ||
100 | |||
101 | if (ret_code && time_left) { | ||
97 | /* Poll until the current NVM owner timeouts */ | 102 | /* Poll until the current NVM owner timeouts */ |
98 | timeout = I40E_MS_TO_GTIME(I40E_MAX_NVM_TIMEOUT) + gtime; | 103 | timeout = I40E_MS_TO_GTIME(I40E_MAX_NVM_TIMEOUT) + gtime; |
99 | while (gtime < timeout) { | 104 | while ((gtime < timeout) && time_left) { |
100 | usleep_range(10000, 20000); | 105 | usleep_range(10000, 20000); |
101 | gtime = rd32(hw, I40E_GLVFGEN_TIMER); | 106 | gtime = rd32(hw, I40E_GLVFGEN_TIMER); |
102 | ret_code = i40e_aq_request_resource(hw, | 107 | ret_code = i40e_aq_request_resource(hw, |
@@ -112,8 +117,8 @@ i40e_status i40e_acquire_nvm(struct i40e_hw *hw, | |||
112 | if (ret_code) { | 117 | if (ret_code) { |
113 | hw->nvm.hw_semaphore_timeout = 0; | 118 | hw->nvm.hw_semaphore_timeout = 0; |
114 | i40e_debug(hw, I40E_DEBUG_NVM, | 119 | i40e_debug(hw, I40E_DEBUG_NVM, |
115 | "NVM acquire timed out, wait %llu ms before trying again.\n", | 120 | "NVM acquire timed out, wait %llu ms before trying again. status=%d aq_err=%d\n", |
116 | time_left); | 121 | time_left, ret_code, hw->aq.asq_last_status); |
117 | } | 122 | } |
118 | } | 123 | } |
119 | 124 | ||