Commit db069ecb authored by Michael J. Ruhl's avatar Michael J. Ruhl Committed by Doug Ledford

IB/hfi1: Do not set physical link state if DC is in the shutdown state

If the DC is in shutdown state, the set link state function will return
an error.  Since this is not a failure in this state, make sure to
only call set link state if the DC is on.
Reviewed-by: default avatarEaswar Hariharan <easwar.hariharan@intel.com>
Signed-off-by: default avatarMichael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent c27aad00
...@@ -10510,6 +10510,7 @@ int set_link_state(struct hfi1_pportdata *ppd, u32 state) ...@@ -10510,6 +10510,7 @@ int set_link_state(struct hfi1_pportdata *ppd, u32 state)
ppd->remote_link_down_reason = 0; ppd->remote_link_down_reason = 0;
} }
if (!dd->dc_shutdown) {
ret1 = set_physical_link_state(dd, PLS_DISABLED); ret1 = set_physical_link_state(dd, PLS_DISABLED);
if (ret1 != HCMD_SUCCESS) { if (ret1 != HCMD_SUCCESS) {
dd_dev_err(dd, dd_dev_err(dd,
...@@ -10518,8 +10519,9 @@ int set_link_state(struct hfi1_pportdata *ppd, u32 state) ...@@ -10518,8 +10519,9 @@ int set_link_state(struct hfi1_pportdata *ppd, u32 state)
ret = -EINVAL; ret = -EINVAL;
break; break;
} }
ppd->host_link_state = HLS_DN_DISABLE;
dc_shutdown(dd); dc_shutdown(dd);
}
ppd->host_link_state = HLS_DN_DISABLE;
break; break;
case HLS_DN_OFFLINE: case HLS_DN_OFFLINE:
if (ppd->host_link_state == HLS_DN_DISABLE) if (ppd->host_link_state == HLS_DN_DISABLE)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment