mirror of https://gitee.com/openkylin/linux.git
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: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Dean Luick <dean.luick@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
cbac386a12
commit
6b14e0ea48
|
@ -593,19 +593,6 @@ 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 (err)
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (fw_fabric_serdes_load) {
|
||||
err = obtain_one_firmware(dd, fw_fabric_serdes_name,
|
||||
&fw_fabric);
|
||||
if (err)
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (fw_sbus_load) {
|
||||
err = obtain_one_firmware(dd, fw_sbus_name, &fw_sbus);
|
||||
if (err)
|
||||
|
@ -618,11 +605,24 @@ static void __obtain_firmware(struct hfi1_devdata *dd)
|
|||
goto done;
|
||||
}
|
||||
|
||||
if (fw_fabric_serdes_load) {
|
||||
err = obtain_one_firmware(dd, fw_fabric_serdes_name,
|
||||
&fw_fabric);
|
||||
if (err)
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (fw_8051_load) {
|
||||
err = obtain_one_firmware(dd, fw_8051_name, &fw_8051);
|
||||
if (err)
|
||||
goto done;
|
||||
}
|
||||
|
||||
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__);
|
||||
|
|
Loading…
Reference in New Issue