From: Ron Mercer Date: Tue, 3 Mar 2009 12:10:35 +0000 (+0000) Subject: qlge: Improve handling for firmware init failure. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7c92191cb4203d3900461074f90851e9e7b56fcb;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git qlge: Improve handling for firmware init failure. This event will arrive at boot time or after an MPI processor reset if the firmware failed to initialize. Signed-off-by: Ron Mercer Signed-off-by: David S. Miller --- diff --git a/drivers/net/qlge/qlge_mpi.c b/drivers/net/qlge/qlge_mpi.c index 3a660f9e9001..2c1d2205c653 100644 --- a/drivers/net/qlge/qlge_mpi.c +++ b/drivers/net/qlge/qlge_mpi.c @@ -395,7 +395,25 @@ static int ql_mpi_handler(struct ql_adapter *qdev, struct mbox_params *mbcp) ql_sfp_out(qdev, mbcp); break; + /* This event can arrive at boot time or after an + * MPI reset if the firmware failed to initialize. + */ case AEN_FW_INIT_FAIL: + /* If we're in process on executing the firmware, + * then convert the status to normal mailbox status. + */ + if (mbcp->mbox_in[0] == MB_CMD_EX_FW) { + mbcp->out_count = orig_count; + status = ql_get_mb_sts(qdev, mbcp); + mbcp->mbox_out[0] = MB_CMD_STS_ERR; + return status; + } + QPRINTK(qdev, DRV, ERR, + "Firmware initialization failed.\n"); + status = -EIO; + ql_queue_fw_error(qdev); + break; + case AEN_SYS_ERR: ql_queue_fw_error(qdev); break;