Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1225743

Re: [PATCH RESEND] csiostor:Fix error handling in the function csio_device_reset

From Hannes Reinecke <hare@suse.de>
Newsgroups linux.kernel
Subject Re: [PATCH RESEND] csiostor:Fix error handling in the function csio_device_reset
Date 2015-09-16 08:50 +0200
Message-ID <q9eHw-55r-21@gated-at.bofh.it> (permalink)
References <q9eHw-55r-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 09/16/2015 12:14 AM, Nicholas Krause wrote:
> This fixes error handling in the function csio_device_reset to
> check the return value of aftering the function csio_hw_reset
> to check if it returned a error code and if so unlock the irq
> spinlock for the hardware plus return the hardware error code
> immediately.
> 
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
>  drivers/scsi/csiostor/csio_scsi.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/csiostor/csio_scsi.c b/drivers/scsi/csiostor/csio_scsi.c
> index 2c4562d..faea4e7 100644
> --- a/drivers/scsi/csiostor/csio_scsi.c
> +++ b/drivers/scsi/csiostor/csio_scsi.c
> @@ -1378,6 +1378,7 @@ csio_device_reset(struct device *dev,
>  {
>  	struct csio_lnode *ln = shost_priv(class_to_shost(dev));
>  	struct csio_hw *hw = csio_lnode_to_hw(ln);
> +	int ret;
>  
>  	if (*buf != '1')
>  		return -EINVAL;
> @@ -1389,7 +1390,11 @@ csio_device_reset(struct device *dev,
>  	csio_lnodes_block_request(hw);
>  
>  	spin_lock_irq(&hw->lock);
> -	csio_hw_reset(hw);
> +	ret = csio_hw_reset(hw);
> +	if (ret) {
> +			spin_unlock_irq(&hw->lock);
> +			return ret;
> +	}
>  	spin_unlock_irq(&hw->lock);
>  
>  	/* Unblock upper IOs */
> 
No sure if that is correct; wouldn't the device stay blocked
if csio_hw_reset() fails?

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH RESEND] csiostor:Fix error handling in the function  csio_device_reset Hannes Reinecke <hare@suse.de> - 2015-09-16 08:50 +0200

csiph-web