From: "Stephen M. Cameron" <scameron@beardog.cce.hp.com>
To: axboe@kernel.dk
Cc: akpm@linux-foundation.org, mikem@beardog.cce.hp.com,
linux-kernel@vger.kernel.org, brace@beardog.cce.hp.com
Subject: [PATCH] cciss: Fix bad scsi status reporting.
Date: Tue, 08 Dec 2009 15:41:51 -0600 [thread overview]
Message-ID: <20091208214151.23672.1572.stgit@beardog.cce.hp.com> (raw)
From: Stephen M. Cameron <scameron@beardog.cce.hp.com>
cciss: Fix bad scsi status reporting. The SCSI status needs to
be shifted left 1 bit, and only needs to be set once.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
---
drivers/block/cciss_scsi.c | 21 +++------------------
1 files changed, 3 insertions(+), 18 deletions(-)
diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c
index 5d0e46d..75a9ca9 100644
--- a/drivers/block/cciss_scsi.c
+++ b/drivers/block/cciss_scsi.c
@@ -728,9 +728,7 @@ complete_scsi_command( CommandList_struct *cp, int timeout, __u32 tag)
cmd->result = (DID_OK << 16); /* host byte */
cmd->result |= (COMMAND_COMPLETE << 8); /* msg byte */
- /* cmd->result |= (GOOD < 1); */ /* status byte */
-
- cmd->result |= (ei->ScsiStatus);
+ cmd->result |= (ei->ScsiStatus << 1);
/* printk("Scsistatus is 0x%02x\n", ei->ScsiStatus); */
/* copy the sense data whether we need to or not. */
@@ -747,18 +745,8 @@ complete_scsi_command( CommandList_struct *cp, int timeout, __u32 tag)
{
case CMD_TARGET_STATUS:
/* Pass it up to the upper layers... */
- if( ei->ScsiStatus)
- {
-#if 0
- printk(KERN_WARNING "cciss: cmd %p "
- "has SCSI Status = %x\n",
- cp,
- ei->ScsiStatus);
-#endif
- cmd->result |= (ei->ScsiStatus << 1);
- }
- else { /* scsi status is zero??? How??? */
-
+ if (ei->ScsiStatus == 0)
+ cmd->result = DID_NO_CONNECT << 16;
/* Ordinarily, this case should never happen, but there is a bug
in some released firmware revisions that allows it to happen
if, for example, a 4100 backplane loses power and the tape
@@ -766,9 +754,6 @@ complete_scsi_command( CommandList_struct *cp, int timeout, __u32 tag)
kind because we can't show that it wasn't. We will make it
look like selection timeout since that is the most common
reason for this to occur, and it's severe enough. */
-
- cmd->result = DID_NO_CONNECT << 16;
- }
break;
case CMD_DATA_UNDERRUN: /* let mid layer handle it. */
break;
reply other threads:[~2009-12-08 21:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20091208214151.23672.1572.stgit@beardog.cce.hp.com \
--to=scameron@beardog.cce.hp.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=brace@beardog.cce.hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mikem@beardog.cce.hp.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
all inboxes | Powered by JetHome®