From: Hannes Reinecke <hare@suse.de>
To: Nicholas Krause <xerofoify@gmail.com>, JBottomley@odin.com
Cc: michaelc@cs.wisc.edu, davem@davemloft.net, anish@chelsio.com,
martin.petersen@oracle.com, hariprasad@chelsio.com,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND] csiostor:Fix error handling in the function csio_device_reset
Date: Wed, 16 Sep 2015 08:49:17 +0200 [thread overview]
Message-ID: <55F910ED.7000001@suse.de> (raw)
In-Reply-To: <1442355274-22410-1-git-send-email-xerofoify@gmail.com>
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)
parent reply other threads:[~2015-09-16 6:49 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <1442355274-22410-1-git-send-email-xerofoify@gmail.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55F910ED.7000001@suse.de \
--to=hare@suse.de \
--cc=JBottomley@odin.com \
--cc=anish@chelsio.com \
--cc=davem@davemloft.net \
--cc=hariprasad@chelsio.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=michaelc@cs.wisc.edu \
--cc=xerofoify@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).