Subject: Re: [PATCH v4 32/32] cxlflash: Fix to avoid potential deadlock on EEH

From: Brian King <[email-masked]>
Date: Mon, 28 Sep 2015 18:41:49 -0500

On 09/25/2015 06:19 PM, Matthew R. Ochs wrote:
>  static int write_same16(struct scsi_device *sdev,
> @@ -433,9 +451,20 @@ static int write_same16(struct scsi_device *sdev,
>  		put_unaligned_be32(ws_limit < left ? ws_limit : left,
>  				   &scsi_cmd[10]);
> 
> +		/* Drop the ioctl read semahpore across lengthy call */
> +		up_read(&cfg->ioctl_rwsem);
>  		result = scsi_execute(sdev, scsi_cmd, DMA_TO_DEVICE, cmd_buf,
>  				      CMD_BUFSIZE, sense_buf, to, CMD_RETRIES,
>  				      0, NULL);
> +		down_read(&cfg->ioctl_rwsem);
> +		rc = check_state(cfg);
> +		if (rc) {
> +			dev_err(dev, "%s: Failed state! result=0x08%X\n",
> +				__func__, result);
> +			rc = -ENODEV;

Since check_state only returns 0 or -ENODEV, this is a bit redundant, but not worth redoing the
patch in my mind.

Reviewed-by: Brian King <[email-masked]>

-- 
Brian King
Power Linux I/O
IBM Linux Technology Center