Lines Matching defs:state
76 * Default time to aggregate two 10K packets from the idle state
1045 static int set_physical_link_state(struct hfi1_devdata *dd, u64 state);
1076 static const char *link_state_name(u32 state);
1078 u32 state);
1084 static void update_statusp(struct hfi1_pportdata *ppd, u32 state);
1087 static int wait_logical_linkstate(struct hfi1_pportdata *ppd, u32 state,
1089 static void log_state_transition(struct hfi1_pportdata *ppd, u32 state);
1090 static void log_physical_state(struct hfi1_pportdata *ppd, u32 state);
1091 static int wait_physical_linkstate(struct hfi1_pportdata *ppd, u32 state,
5711 * bit of state per integrity check, and so we can miss the reason for an
6262 * Use the host link state lock so the operation of this routine
6263 * { link state check, selector change, count increment } can occur
6264 * as a unit against a link state change. Otherwise there is a
6265 * race between the state change and the count increment.
6276 dd_dev_info(dd, "%s: link state %s not up\n",
6311 * Use the host link state lock because the acquire needed it.
6347 * Initialize LCB access variables and state. Called during driver load,
6539 * OFFLINE (OFFLINE state has the side effect of putting the SerDes into
6543 * care of properly transitioning the link into the correct state.
7661 "%s: giving up waiting for link state change\n",
8601 /* clear current state, set new state */
8872 static int set_physical_link_state(struct hfi1_devdata *dd, u64 state)
8874 return do_8051_command(dd, HCMD_CHANGE_PHY_STATE, state, NULL);
9280 * State "quick" LinkUp request sets the physical link state to
9282 * This state is in simulator v37 and later.
9287 "%s: set physical link state to quick LinkUp failed with return %d\n",
10268 "State timeout occurred before link partner completed the state";
10284 "Link partner completed the EstablishComm state, but the passing lanes do not meet the local link width policy",
10291 "Link partner completed the OptimizeEq state, but the passing lanes do not meet the local link width policy",
10298 "Link partner completed the VerifyCap state, but the passing lanes do not meet the local link width policy",
10319 /* describe the given last state complete frame */
10325 u32 state;
10332 * [ 3: 1] - state
10333 * [ 7: 4] - next state timeout
10338 state = (frame >> 1) & 0x7;
10342 dd_dev_err(dd, "Last %s LNI state complete frame 0x%08x:\n",
10344 dd_dev_err(dd, " last reported state state: %s (0x%x)\n",
10345 state_completed_string(state), state);
10346 dd_dev_err(dd, " state successfully completed: %s\n",
10354 * Read the last state complete frames and explain them. This routine
10400 /* called when the logical link state is not down as it should be */
10432 dd_dev_info(ppd->dd, "logical state forced to LINK_DOWN\n");
10460 "Failed to transition to Offline link state, return %d\n",
10501 * Now in charge of LCB - must be after the physical state is
10507 /* make sure the logical state is also down */
10516 * The LNI has a mandatory wait time after the physical state
10528 /* state is really offline, so make it so */
10534 * The state is now offline and the 8051 is ready to accept host
10536 * - change our state
10537 * - notify others if we were previously in a linkup state
10560 /* return the link state name */
10561 static const char *link_state_name(u32 state)
10564 int n = ilog2(state);
10583 /* return the link state reason name */
10584 static const char *link_state_reason_name(struct hfi1_pportdata *ppd, u32 state)
10586 if (state == HLS_UP_INIT) {
10607 * state (an HLS_*) into a physical state (a {IB,OPA}_PORTPHYSSTATE_*).
10641 * state (an HLS_*) into a logical state (a IB_PORT_*). Return -1
10700 * Change the physical and/or logical link state.
10707 int set_link_state(struct hfi1_pportdata *ppd, u32 state)
10716 orig_new_state = state;
10717 if (state == HLS_DN_DOWNDEF)
10718 state = HLS_DEFAULT;
10722 state == HLS_DN_POLL;
10728 link_state_reason_name(ppd, state));
10731 * If we're going to a (HLS_*) link state that implies the logical
10732 * link state is neither of (IB_PORT_ARMED, IB_PORT_ACTIVE), then
10735 if (!(state & (HLS_UP_ARMED | HLS_UP_ACTIVE)))
10742 if (ppd->host_link_state == state && !poll_bounce)
10745 switch (state) {
10762 * Wait for Link_Up physical state.
10769 "%s: physical state did not change to LINK-UP\n",
10777 "%s: logical state did not change to INIT\n",
10819 "%s: logical state did not change to ARMED\n",
10841 "%s: logical state did not change to ACTIVE\n",
10894 "Failed to transition to Polling link state, return 0x%x\n",
10901 * Change the host link state after requesting DC8051 to
10902 * change its physical state so that we can ignore any
10904 * cleared until DC8051 transitions to Polling state.
10922 /* allow any state to transition to disabled */
10936 "Failed to transition to Disabled link state, return 0x%x\n",
10944 "%s: physical state did not change to DISABLED\n",
10956 /* allow any state to transition to offline */
10974 "Failed to transition to link up state, return 0x%x\n",
10985 dd_dev_info(dd, "%s: state 0x%x: not supported\n",
10986 __func__, state);
10994 dd_dev_err(dd, "%s: unexpected state transition from %s to %s\n",
10996 link_state_name(state));
11028 /* HFI only supports POLL as the default link down state */
11851 * The calculations below do not allow a steady state to be achieved.
12895 "Unknown logical state 0x%x, reporting IB_PORT_DOWN\n",
12918 dd_dev_err(dd, "Unexpected chip physical state of 0x%x\n",
12924 /* return the OPA port logical state name */
12940 /* return the OPA port physical state name */
12965 * @state: port state information
12973 static void update_statusp(struct hfi1_pportdata *ppd, u32 state)
12977 * memory. Do it here to ensure a reliable state - this is
12978 * the only function called by all state handling code.
12984 switch (state) {
12998 dd_dev_info(ppd->dd, "logical state changed to %s (0x%x)\n",
12999 opa_lstate_name(state), state);
13003 * wait_logical_linkstate - wait for an IB link state change to occur
13005 * @state: the state to wait for
13008 * Wait up to msecs milliseconds for IB link state change to occur.
13010 * Returns 0 if state reached, otherwise -ETIMEDOUT.
13012 static int wait_logical_linkstate(struct hfi1_pportdata *ppd, u32 state,
13022 if (new_state == state)
13026 "timeout waiting for link state 0x%x\n",
13027 state);
13036 static void log_state_transition(struct hfi1_pportdata *ppd, u32 state)
13038 u32 ib_pstate = chip_to_opa_pstate(ppd->dd, state);
13041 "physical state changed to %s (0x%x), phy 0x%x\n",
13042 opa_pstate_name(ib_pstate), ib_pstate, state);
13046 * Read the physical hardware link state and check if it matches host
13047 * drivers anticipated state.
13049 static void log_physical_state(struct hfi1_pportdata *ppd, u32 state)
13053 if (read_state == state) {
13054 log_state_transition(ppd, state);
13057 "anticipated phy link state 0x%x, read 0x%x\n",
13058 state, read_state);
13063 * wait_physical_linkstate - wait for an physical link state change to occur
13065 * @state: the state to wait for
13068 * Wait up to msecs milliseconds for physical link state change to occur.
13069 * Returns 0 if state reached, otherwise -ETIMEDOUT.
13071 static int wait_physical_linkstate(struct hfi1_pportdata *ppd, u32 state,
13080 if (read_state == state)
13084 "timeout waiting for phy link state 0x%x\n",
13085 state);
13091 log_state_transition(ppd, state);
13101 * state change to occur.
13102 * Returns 0 if at least one state is reached, otherwise -ETIMEDOUT.
13117 "timeout waiting for phy link offline.quiet substates. Read state 0x%x, %dms\n",
13129 * wait_phys_link_out_of_offline - wait for any out of offline state
13134 * state change to occur.
13135 * Returns 0 if at least one state is reached, otherwise -ETIMEDOUT.
13150 "timeout waiting for phy link out of offline. Read state 0x%x, %dms\n",
13360 * set_up_interrupts() - Initialize the IRQ resources and state
13750 __cm_reset(dd, 0); /* reset CM internal state */
14068 * Put the HFI CSRs in a known state.
15525 * go through the entire link state machine since we want to