* [PATCH 1/1] arcmsr: Notify has sense data report
@ 2014-11-28 4:20 Ching Huang
2014-11-28 8:57 ` Hannes Reinecke
2014-11-28 9:17 ` Dan Carpenter
0 siblings, 2 replies; 4+ messages in thread
From: Ching Huang @ 2014-11-28 4:20 UTC (permalink / raw)
To: hch, thenzl, jbottomley, dan.carpenter, linux-scsi, linux-kernel
From: Ching Huang <ching2048@areca.com.tw>
This patch is relative to http://git.infradead.org/users/hch/scsi-queue.git/tree/refs/heads/drivers-for-3.18:/drivers/scsi/arcmsr
Setting command status with 'DRIVER_SENSE' except 'CHECK_CONDITION' if we have sense data.
Signed-off-by: Ching Huang <ching2048@areca.com.tw>
---
diff -uprN a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h
--- a/drivers/scsi/arcmsr/arcmsr.h 2014-09-19 11:04:41.845100000 +0800
+++ b/drivers/scsi/arcmsr/arcmsr.h 2014-11-28 10:54:30.000000000 +0800
@@ -52,7 +52,7 @@ struct device_attribute;
#define ARCMSR_MAX_FREECCB_NUM 320
#define ARCMSR_MAX_OUTSTANDING_CMD 255
#endif
-#define ARCMSR_DRIVER_VERSION "v1.30.00.04-20140919"
+#define ARCMSR_DRIVER_VERSION "v1.30.00.05-20141128"
#define ARCMSR_SCSI_INITIATOR_ID 255
#define ARCMSR_MAX_XFER_SECTORS 512
#define ARCMSR_MAX_XFER_SECTORS_B 4096
diff -uprN a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
--- a/drivers/scsi/arcmsr/arcmsr_hba.c 2014-09-19 11:01:26.990090000 +0800
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c 2014-11-28 10:55:54.000000000 +0800
@@ -989,7 +989,8 @@ static void arcmsr_report_sense_info(str
struct scsi_cmnd *pcmd = ccb->pcmd;
struct SENSE_DATA *sensebuffer = (struct SENSE_DATA *)pcmd->sense_buffer;
- pcmd->result = DID_OK << 16;
+
+ pcmd->result = (DID_OK << 16) | (CHECK_CONDITION << 1);
if (sensebuffer) {
int sense_data_length =
sizeof(struct SENSE_DATA) < SCSI_SENSE_BUFFERSIZE
@@ -998,6 +999,7 @@ static void arcmsr_report_sense_info(str
memcpy(sensebuffer, ccb->arcmsr_cdb.SenseData, sense_data_length);
sensebuffer->ErrorCode = SCSI_SENSE_CURRENT_ERRORS;
sensebuffer->Valid = 1;
+ pcmd->result |= (DRIVER_SENSE << 24);
}
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] arcmsr: Notify has sense data report
2014-11-28 4:20 [PATCH 1/1] arcmsr: Notify has sense data report Ching Huang
@ 2014-11-28 8:57 ` Hannes Reinecke
2014-11-28 9:17 ` Dan Carpenter
1 sibling, 0 replies; 4+ messages in thread
From: Hannes Reinecke @ 2014-11-28 8:57 UTC (permalink / raw)
To: Ching Huang, hch, thenzl, jbottomley, dan.carpenter, linux-scsi,
linux-kernel
On 11/28/2014 05:20 AM, Ching Huang wrote:
> From: Ching Huang <ching2048@areca.com.tw>
>
> This patch is relative to http://git.infradead.org/users/hch/scsi-queue.git/tree/refs/heads/drivers-for-3.18:/drivers/scsi/arcmsr
>
> Setting command status with 'DRIVER_SENSE' except 'CHECK_CONDITION' if we have sense data.
>
> Signed-off-by: Ching Huang <ching2048@areca.com.tw>
> ---
>
> diff -uprN a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h
> --- a/drivers/scsi/arcmsr/arcmsr.h 2014-09-19 11:04:41.845100000 +0800
> +++ b/drivers/scsi/arcmsr/arcmsr.h 2014-11-28 10:54:30.000000000 +0800
> @@ -52,7 +52,7 @@ struct device_attribute;
> #define ARCMSR_MAX_FREECCB_NUM 320
> #define ARCMSR_MAX_OUTSTANDING_CMD 255
> #endif
> -#define ARCMSR_DRIVER_VERSION "v1.30.00.04-20140919"
> +#define ARCMSR_DRIVER_VERSION "v1.30.00.05-20141128"
> #define ARCMSR_SCSI_INITIATOR_ID 255
> #define ARCMSR_MAX_XFER_SECTORS 512
> #define ARCMSR_MAX_XFER_SECTORS_B 4096
> diff -uprN a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
> --- a/drivers/scsi/arcmsr/arcmsr_hba.c 2014-09-19 11:01:26.990090000 +0800
> +++ b/drivers/scsi/arcmsr/arcmsr_hba.c 2014-11-28 10:55:54.000000000 +0800
> @@ -989,7 +989,8 @@ static void arcmsr_report_sense_info(str
>
> struct scsi_cmnd *pcmd = ccb->pcmd;
> struct SENSE_DATA *sensebuffer = (struct SENSE_DATA *)pcmd->sense_buffer;
> - pcmd->result = DID_OK << 16;
> +
> + pcmd->result = (DID_OK << 16) | (CHECK_CONDITION << 1);
> if (sensebuffer) {
> int sense_data_length =
> sizeof(struct SENSE_DATA) < SCSI_SENSE_BUFFERSIZE
> @@ -998,6 +999,7 @@ static void arcmsr_report_sense_info(str
> memcpy(sensebuffer, ccb->arcmsr_cdb.SenseData, sense_data_length);
> sensebuffer->ErrorCode = SCSI_SENSE_CURRENT_ERRORS;
> sensebuffer->Valid = 1;
> + pcmd->result |= (DRIVER_SENSE << 24);
> }
> }
>
Hmm; we actually _always_ attach a sense buffer to the command.
So the check for 'if (sensebuffer)' will always return true.
I'd rather use a 'WARN_ON' here and get rid of the 'if' clause.
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 21284 (AG Nürnberg)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] arcmsr: Notify has sense data report
2014-11-28 4:20 [PATCH 1/1] arcmsr: Notify has sense data report Ching Huang
2014-11-28 8:57 ` Hannes Reinecke
@ 2014-11-28 9:17 ` Dan Carpenter
2014-11-28 9:57 ` Ching Huang
1 sibling, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2014-11-28 9:17 UTC (permalink / raw)
To: Ching Huang; +Cc: hch, thenzl, jbottomley, linux-scsi, linux-kernel
On Fri, Nov 28, 2014 at 12:20:44PM +0800, Ching Huang wrote:
> This patch is relative to http://git.infradead.org/users/hch/scsi-queue.git/tree/refs/heads/drivers-for-3.18:/drivers/scsi/arcmsr
>
Put this information after the --- cut off line so that it is not
saved in the permanent git log.
> Setting command status with 'DRIVER_SENSE' except 'CHECK_CONDITION' if we have sense data.
>
> Signed-off-by: Ching Huang <ching2048@areca.com.tw>
> ---
<--- Here. Put it here.
>
> diff -uprN a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h
> --- a/drivers/scsi/arcmsr/arcmsr.h 2014-09-19 11:04:41.845100000 +0800
> +++ b/drivers/scsi/arcmsr/arcmsr.h 2014-11-28 10:54:30.000000000 +0800
> @@ -52,7 +52,7 @@ struct device_attribute;
> #define ARCMSR_MAX_FREECCB_NUM 320
> #define ARCMSR_MAX_OUTSTANDING_CMD 255
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] arcmsr: Notify has sense data report
2014-11-28 9:17 ` Dan Carpenter
@ 2014-11-28 9:57 ` Ching Huang
0 siblings, 0 replies; 4+ messages in thread
From: Ching Huang @ 2014-11-28 9:57 UTC (permalink / raw)
To: Dan Carpenter, hare; +Cc: hch, thenzl, jbottomley, linux-scsi, linux-kernel
Thanks to Dan's advice and Hannes' suggestion.
I will revise and resubmit it later.
On Fri, 2014-11-28 at 12:17 +0300, Dan Carpenter wrote:
> On Fri, Nov 28, 2014 at 12:20:44PM +0800, Ching Huang wrote:
> > This patch is relative to http://git.infradead.org/users/hch/scsi-queue.git/tree/refs/heads/drivers-for-3.18:/drivers/scsi/arcmsr
> >
>
> Put this information after the --- cut off line so that it is not
> saved in the permanent git log.
>
> > Setting command status with 'DRIVER_SENSE' except 'CHECK_CONDITION' if we have sense data.
> >
> > Signed-off-by: Ching Huang <ching2048@areca.com.tw>
> > ---
>
> <--- Here. Put it here.
>
> >
> > diff -uprN a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h
> > --- a/drivers/scsi/arcmsr/arcmsr.h 2014-09-19 11:04:41.845100000 +0800
> > +++ b/drivers/scsi/arcmsr/arcmsr.h 2014-11-28 10:54:30.000000000 +0800
> > @@ -52,7 +52,7 @@ struct device_attribute;
> > #define ARCMSR_MAX_FREECCB_NUM 320
> > #define ARCMSR_MAX_OUTSTANDING_CMD 255
>
> regards,
> dan carpenter
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-11-28 9:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-28 4:20 [PATCH 1/1] arcmsr: Notify has sense data report Ching Huang
2014-11-28 8:57 ` Hannes Reinecke
2014-11-28 9:17 ` Dan Carpenter
2014-11-28 9:57 ` Ching Huang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.