Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 623bba2d authored by Easwar Hariharan's avatar Easwar Hariharan Committed by Doug Ledford
Browse files

IB/hfi1: Remove module presence check outside pre-LNI checks



The pre-LNI SerDes and channel tuning algorithm already checks for
module presence assertion for the relevant port types. The extraneous
check removed in this patch blocks link up for port types for which
the module presence assertion is not relevant.

Reviewed-by: default avatarDean Luick <dean.luick@intel.com>
Signed-off-by: default avatarEaswar Hariharan <easwar.hariharan@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 145dd2b3
Loading
Loading
Loading
Loading
+6 −14
Original line number Original line Diff line number Diff line
@@ -6849,7 +6849,7 @@ void handle_link_down(struct work_struct *work)
	 * If there is no cable attached, turn the DC off. Otherwise,
	 * If there is no cable attached, turn the DC off. Otherwise,
	 * start the link bring up.
	 * start the link bring up.
	 */
	 */
	if (!qsfp_mod_present(ppd)) {
	if (ppd->port_type == PORT_TYPE_QSFP && !qsfp_mod_present(ppd)) {
		dc_shutdown(ppd->dd);
		dc_shutdown(ppd->dd);
	} else {
	} else {
		tune_serdes(ppd);
		tune_serdes(ppd);
@@ -9008,9 +9008,9 @@ static int set_local_link_attributes(struct hfi1_pportdata *ppd)
}
}


/*
/*
 * Call this to start the link.  Schedule a retry if the cable is not
 * Call this to start the link.
 * present or if unable to start polling.  Do not do anything if the
 * Do not do anything if the link is disabled.
 * link is disabled.  Returns 0 if link is disabled or moved to polling
 * Returns 0 if link is disabled, moved to polling, or the driver is not ready.
 */
 */
int start_link(struct hfi1_pportdata *ppd)
int start_link(struct hfi1_pportdata *ppd)
{
{
@@ -9027,15 +9027,7 @@ int start_link(struct hfi1_pportdata *ppd)
		return 0;
		return 0;
	}
	}


	if (qsfp_mod_present(ppd) || loopback == LOOPBACK_SERDES ||
	    loopback == LOOPBACK_LCB ||
	    ppd->dd->icode == ICODE_FUNCTIONAL_SIMULATOR)
	return set_link_state(ppd, HLS_DN_POLL);
	return set_link_state(ppd, HLS_DN_POLL);

	dd_dev_info(ppd->dd,
		    "%s: stopping link start because no cable is present\n",
		    __func__);
	return -EAGAIN;
}
}


static void wait_for_qsfp_init(struct hfi1_pportdata *ppd)
static void wait_for_qsfp_init(struct hfi1_pportdata *ppd)
@@ -9206,7 +9198,7 @@ static int handle_qsfp_error_conditions(struct hfi1_pportdata *ppd,
	return 0;
	return 0;
}
}


/* This routine will only be scheduled if the QSFP module is present */
/* This routine will only be scheduled if the QSFP module present is asserted */
void qsfp_event(struct work_struct *work)
void qsfp_event(struct work_struct *work)
{
{
	struct qsfp_data *qd;
	struct qsfp_data *qd;
+6 −2
Original line number Original line Diff line number Diff line
@@ -838,9 +838,11 @@ void tune_serdes(struct hfi1_pportdata *ppd)
			total_atten = platform_atten + remote_atten;
			total_atten = platform_atten + remote_atten;


			tuning_method = OPA_PASSIVE_TUNING;
			tuning_method = OPA_PASSIVE_TUNING;
		} else
		} else {
			ppd->offline_disabled_reason =
			ppd->offline_disabled_reason =
			     HFI1_ODR_MASK(OPA_LINKDOWN_REASON_CHASSIS_CONFIG);
			     HFI1_ODR_MASK(OPA_LINKDOWN_REASON_CHASSIS_CONFIG);
			goto bail;
		}
		break;
		break;
	case PORT_TYPE_QSFP:
	case PORT_TYPE_QSFP:
		if (qsfp_mod_present(ppd)) {
		if (qsfp_mod_present(ppd)) {
@@ -869,10 +871,12 @@ void tune_serdes(struct hfi1_pportdata *ppd)
					   __func__);
					   __func__);
				goto bail;
				goto bail;
			}
			}
		} else
		} else {
			ppd->offline_disabled_reason =
			ppd->offline_disabled_reason =
			   HFI1_ODR_MASK(
			   HFI1_ODR_MASK(
				OPA_LINKDOWN_REASON_LOCAL_MEDIA_NOT_INSTALLED);
				OPA_LINKDOWN_REASON_LOCAL_MEDIA_NOT_INSTALLED);
			goto bail;
		}
		break;
		break;
	default:
	default:
		dd_dev_info(ppd->dd, "%s: Unknown port type\n", __func__);
		dd_dev_info(ppd->dd, "%s: Unknown port type\n", __func__);