public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Cameron <smcameron@yahoo.com>
To: James.Bottomley@HansenPartnership.com, akpm@linux-foundation.org,
	"Stephen M. Cameron" <scameron@beardog.cce.hp.com>
Cc: linux-kernel@vger.kernel.org, mikem@beardog.cce.hp.com,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH 4/5] hpsa: Fix incorrect SCSI status reporting
Date: Wed, 16 Dec 2009 14:53:03 -0800 (PST)	[thread overview]
Message-ID: <748125.31172.qm@web33007.mail.mud.yahoo.com> (raw)
In-Reply-To: <20091208213827.23493.88533.stgit@beardog.cce.hp.com>



--- On Tue, 12/8/09, Stephen M. Cameron <scameron@beardog.cce.hp.com> wrote:

> From: Stephen M. Cameron <scameron@beardog.cce.hp.com>
> Subject: [PATCH 4/5] hpsa: Fix incorrect SCSI status reporting
> To: James.Bottomley@HansenPartnership.com, akpm@linux-foundation.org
> Cc: linux-kernel@vger.kernel.org, mikem@beardog.cce.hp.com, linux-scsi@vger.kernel.org, smcameron@yahoo.com
> Date: Tuesday, December 8, 2009, 3:38 PM
> From: Stephen M. Cameron <scameron@beardog.cce.hp.com>
> 
> hpsa: Fix incorrect SCSI status reporting
> 
> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
> ---
>  drivers/scsi/hpsa.c |    5 +----
>  1 files changed, 1 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
> index 0e696ee..380236a 100644
> --- a/drivers/scsi/hpsa.c
> +++ b/drivers/scsi/hpsa.c
> @@ -930,7 +930,7 @@ static void
> complete_scsi_command(struct CommandList *cp,
>  
>      cmd->result = (DID_OK << 16);
>         /* host byte */
>      cmd->result |= (COMMAND_COMPLETE << 8);    /* msg byte */
> -    cmd->result |= (ei->ScsiStatus);
> +    cmd->result |= (ei->ScsiStatus << 1);

I don't think this is correct.

I got fooled by some code in other drivers (3w-9xxx.c, gdth.c)
which use CHECK_CONDITION, and shift it left 1, but I failed to notice
that CHECK_CONDITION is defined to be 0x01, not 0x02.

Might be nice if there were some macros or helper functions
for setting the status bytes in scsi.h (there are some for 
unpacking, but not for packing, but drivers mainly need to
pack these, not unpack them.)

Will send a patch tomorrow in any case.

-- steve



>  
>      /* copy the sense data whether we need
> to or not. */
>      memcpy(cmd->sense_buffer,
> ei->SenseInfo,
> @@ -991,7 +991,6 @@ static void
> complete_scsi_command(struct CommandList *cp,
>  
>  
>             
> /* Must be some other type of check condition */
> -           
> cmd->result |= (ei->ScsiStatus << 1);
>             
> dev_warn(&h->pdev->dev, "cp %p has check
> condition: "
>             
>         "unknown type: "
>             
>         "Sense: 0x%x, ASC:
> 0x%x, ASCQ: 0x%x, "
> @@ -1013,8 +1012,6 @@ static void
> complete_scsi_command(struct CommandList *cp,
>           * Pass it
> up to the upper layers...
>           */
>          if
> (ei->ScsiStatus) {
> -
> -           
> cmd->result |= (ei->ScsiStatus << 1);
>             
> dev_warn(&h->pdev->dev, "cp %p has status 0x%x "
>             
>     "Sense: 0x%x, ASC: 0x%x, ASCQ: 0x%x, "
>             
>     "Returning result: 0x%x\n",
> 
> 


      
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-12-16 22:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-08 21:38 [PATCH 0/5] hpsa: fix a few more small things Stephen M. Cameron
2009-12-08 21:38 ` [PATCH 1/5] Use msleep() instead of schedule_timeout Stephen M. Cameron
2009-12-08 21:53   ` James Bottomley
2009-12-08 22:02   ` Andrew Morton
2009-12-08 21:38 ` [PATCH 2/5] hpsa: rename too generic variable names Stephen M. Cameron
2009-12-08 21:38 ` [PATCH 3/5] hpsa: Return SCSI_MLQUEUE_HOST_BUSY on command allocation failure Stephen M. Cameron
2009-12-08 21:38 ` [PATCH 4/5] hpsa: Fix incorrect SCSI status reporting Stephen M. Cameron
2009-12-16 22:53   ` Stephen Cameron [this message]
2009-12-08 21:38 ` [PATCH 5/5] hpsa: suppress messages due to unsupport SCSI REPORT_LUNS Stephen M. Cameron

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=748125.31172.qm@web33007.mail.mud.yahoo.com \
    --to=smcameron@yahoo.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mikem@beardog.cce.hp.com \
    --cc=scameron@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