diff options
author | Brett Creeley <brett.creeley@intel.com> | 2018-09-19 20:23:18 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2018-10-02 10:18:20 -0400 |
commit | ca4929b6df7c729c375c486c0ca53decb0eae9f5 (patch) | |
tree | 03c30f1b04cc85c9a876381c57e3674e89f1ab75 | |
parent | 492af0ab4f57136d19f0fa3a9c636f12ae70853c (diff) |
ice: Align ice_reset_req enum values to hardware reset values
Currently the ice_reset_req enum values have to be translated into
a different set of values that the hardware understands for the same
reset types. Avoid this translation by aligning ice_reset_req enum
values to the ones that the hardware understands.
Also add and else if block to check for ICE_RESET_EMPR and put a dev_dbg
message in the else case.
Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r-- | drivers/net/ethernet/intel/ice/ice_main.c | 5 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/ice/ice_type.h | 14 |
2 files changed, 14 insertions, 5 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index bb76a0bf2fd1..f51857ead0f3 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c | |||
@@ -1241,8 +1241,11 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data) | |||
1241 | pf->corer_count++; | 1241 | pf->corer_count++; |
1242 | else if (reset == ICE_RESET_GLOBR) | 1242 | else if (reset == ICE_RESET_GLOBR) |
1243 | pf->globr_count++; | 1243 | pf->globr_count++; |
1244 | else | 1244 | else if (reset == ICE_RESET_EMPR) |
1245 | pf->empr_count++; | 1245 | pf->empr_count++; |
1246 | else | ||
1247 | dev_dbg(&pf->pdev->dev, "Invalid reset type %d\n", | ||
1248 | reset); | ||
1246 | 1249 | ||
1247 | /* If a reset cycle isn't already in progress, we set a bit in | 1250 | /* If a reset cycle isn't already in progress, we set a bit in |
1248 | * pf->state so that the service task can start a reset/rebuild. | 1251 | * pf->state so that the service task can start a reset/rebuild. |
diff --git a/drivers/net/ethernet/intel/ice/ice_type.h b/drivers/net/ethernet/intel/ice/ice_type.h index 4a64421b77a7..87930f68d3fb 100644 --- a/drivers/net/ethernet/intel/ice/ice_type.h +++ b/drivers/net/ethernet/intel/ice/ice_type.h | |||
@@ -150,12 +150,18 @@ struct ice_mac_info { | |||
150 | u8 perm_addr[ETH_ALEN]; | 150 | u8 perm_addr[ETH_ALEN]; |
151 | }; | 151 | }; |
152 | 152 | ||
153 | /* Various RESET request, These are not tied with HW reset types */ | 153 | /* Reset types used to determine which kind of reset was requested. These |
154 | * defines match what the RESET_TYPE field of the GLGEN_RSTAT register. | ||
155 | * ICE_RESET_PFR does not match any RESET_TYPE field in the GLGEN_RSTAT register | ||
156 | * because its reset source is different than the other types listed. | ||
157 | */ | ||
154 | enum ice_reset_req { | 158 | enum ice_reset_req { |
159 | ICE_RESET_POR = 0, | ||
155 | ICE_RESET_INVAL = 0, | 160 | ICE_RESET_INVAL = 0, |
156 | ICE_RESET_PFR = 1, | 161 | ICE_RESET_CORER = 1, |
157 | ICE_RESET_CORER = 2, | 162 | ICE_RESET_GLOBR = 2, |
158 | ICE_RESET_GLOBR = 3, | 163 | ICE_RESET_EMPR = 3, |
164 | ICE_RESET_PFR = 4, | ||
159 | }; | 165 | }; |
160 | 166 | ||
161 | /* Bus parameters */ | 167 | /* Bus parameters */ |