Re: [PATCH for-next 07/11] IB/hfi1: Fix infinite loop in 8051 command error path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 18, 2017 at 07:56:59PM -0800, Dennis Dalessandro wrote:
> From: Sebastian Sanchez <sebastian.sanchez@xxxxxxxxx>
>
> When an 8051 command times out, the entire DC block is restarted. During
> the restart, the host interface version bit is set, which calls
> do_8051_command() recursively. The host version bit needs to be set
> before the link moves into polling, so the host version bit can be set
> in set_local_link_attributes() instead. Thus, the 8051 command functions
> can be simplied as a non-locking version (dd->dc8051_lock) of those
> functions are no longer needed.
>
> Fixes: 9be6a5d788b0 ("IB/hfi1: Prevent LNI out of sync by resetting host interface version")
> Reviewed-by: Michael J. Ruhl <michael.j.ruhl@xxxxxxxxx>
> Signed-off-by: Sebastian Sanchez <sebastian.sanchez@xxxxxxxxx>
> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@xxxxxxxxx>
> ---
>  drivers/infiniband/hw/hfi1/chip.c     |   85 ++++++++++++---------------------
>  drivers/infiniband/hw/hfi1/chip.h     |    2 -
>  drivers/infiniband/hw/hfi1/firmware.c |   64 ++++++-------------------
>  3 files changed, 49 insertions(+), 102 deletions(-)
>
> diff --git a/drivers/infiniband/hw/hfi1/chip.c b/drivers/infiniband/hw/hfi1/chip.c
> index 87748a6..99c7347 100644
> --- a/drivers/infiniband/hw/hfi1/chip.c
> +++ b/drivers/infiniband/hw/hfi1/chip.c
> @@ -6518,11 +6518,12 @@ static void _dc_start(struct hfi1_devdata *dd)
>  	if (!dd->dc_shutdown)
>  		return;
>
> -	/*
> -	 * Take the 8051 out of reset, wait until 8051 is ready, and set host
> -	 * version bit.
> -	 */
> -	release_and_wait_ready_8051_firmware(dd);
> +	/* Take the 8051 out of reset */
> +	write_csr(dd, DC_DC8051_CFG_RST, 0ull);
> +	/* Wait until 8051 is ready */
> +	if (wait_fm_ready(dd, TIMEOUT_8051_START))
> +		dd_dev_err(dd, "%s: timeout starting 8051 firmware\n",
> +			   __func__);
>
>  	/* Take away reset for LCB and RX FPE (set in lcb_shutdown). */
>  	write_csr(dd, DCC_CFG_RESET, 0x10);
> @@ -8566,23 +8567,30 @@ int write_lcb_csr(struct hfi1_devdata *dd, u32 addr, u64 data)
>  }
>
>  /*
> - * If the 8051 is in reset mode (dd->dc_shutdown == 1), this function
> - * will still continue executing.
> - *
>   * Returns:
>   *	< 0 = Linux error, not able to get access
>   *	> 0 = 8051 command RETURN_CODE
>   */
> -static int _do_8051_command(struct hfi1_devdata *dd, u32 type, u64 in_data,
> -			    u64 *out_data)
> +static int do_8051_command(
> +	struct hfi1_devdata *dd,
> +	u32 type,
> +	u64 in_data,
> +	u64 *out_data)

What did you try to say by this change ? :)

Thanks

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux