Commit 6b14e0ea authored by Dean Luick's avatar Dean Luick Committed by Doug Ledford

staging/rdma/hfi1: Fix missing firmware NULL dereference

The gen3 bump code must mark a firmware download failure as fatal.
Otherwise a later load attempt will fail with a NULL dereference.

Also:
o Only do a firmware back-off for RTL.  There are no alternates for
  FPGA or simulation.
o Rearrange OS firmware request order to match what is actually
  loaded.  This results in more coherent informational messages
  in the case of missing firmware.
Reviewed-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarDean Luick <dean.luick@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent cbac386a
......@@ -593,27 +593,27 @@ static void __obtain_firmware(struct hfi1_devdata *dd)
fw_pcie_serdes_name = ALT_FW_PCIE_NAME;
}
if (fw_8051_load) {
err = obtain_one_firmware(dd, fw_8051_name, &fw_8051);
if (fw_sbus_load) {
err = obtain_one_firmware(dd, fw_sbus_name, &fw_sbus);
if (err)
goto done;
}
if (fw_fabric_serdes_load) {
err = obtain_one_firmware(dd, fw_fabric_serdes_name,
&fw_fabric);
if (fw_pcie_serdes_load) {
err = obtain_one_firmware(dd, fw_pcie_serdes_name, &fw_pcie);
if (err)
goto done;
}
if (fw_sbus_load) {
err = obtain_one_firmware(dd, fw_sbus_name, &fw_sbus);
if (fw_fabric_serdes_load) {
err = obtain_one_firmware(dd, fw_fabric_serdes_name,
&fw_fabric);
if (err)
goto done;
}
if (fw_pcie_serdes_load) {
err = obtain_one_firmware(dd, fw_pcie_serdes_name, &fw_pcie);
if (fw_8051_load) {
err = obtain_one_firmware(dd, fw_8051_name, &fw_8051);
if (err)
goto done;
}
......@@ -621,8 +621,8 @@ static void __obtain_firmware(struct hfi1_devdata *dd)
done:
if (err) {
/* oops, had problems obtaining a firmware */
if (fw_state == FW_EMPTY) {
/* retry with alternate */
if (fw_state == FW_EMPTY && dd->icode == ICODE_RTL_SILICON) {
/* retry with alternate (RTL only) */
fw_state = FW_TRY;
goto retry;
}
......
......@@ -1032,8 +1032,11 @@ int do_pcie_gen3_transition(struct hfi1_devdata *dd)
/* step 4: download PCIe Gen3 SerDes firmware */
dd_dev_info(dd, "%s: downloading firmware\n", __func__);
ret = load_pcie_firmware(dd);
if (ret)
if (ret) {
/* do not proceed if the firmware cannot be downloaded */
return_error = 1;
goto done;
}
/* step 5: set up device parameter settings */
dd_dev_info(dd, "%s: setting PCIe registers\n", __func__);
......
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