Re: scsi/arm/fas216.c compile error

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: James Bottomley
Date: Sunday, February 10, 2008 - 7:20 am

On Sun, 2008-02-10 at 13:58 +0000, Russell King wrote:

OK, sorry about this, it's a bit of a cockup all around.  The patch that
fixes this problem is still in SCSI pending largely because it's patch
description:

    [SCSI] fas216: Use scsi_eh API for REQUEST_SENSE invocation

Doesn't lead one to think it might be build critical, so I concentrated
on getting the other arm patch out.

Russell, could you give it a quick test, and I'll put it in with a
tested-by tag?

Thanks,

James

---

From: Boaz Harrosh <bharrosh@panasas.com>
Date: Mon, 10 Sep 2007 22:39:11 +0300
Subject: [SCSI] fas216: Use scsi_eh API for REQUEST_SENSE invocation

  - Use new scsi_eh_prep/restor_cmnd() for synchronous
    REQUEST_SENSE invocation.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
---
 drivers/scsi/arm/fas216.c |   16 +++-------------
 drivers/scsi/arm/fas216.h |    3 +++
 2 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c
index fb5f202..a715632 100644
--- a/drivers/scsi/arm/fas216.c
+++ b/drivers/scsi/arm/fas216.c
@@ -2018,6 +2018,7 @@ static void fas216_rq_sns_done(FAS216_Info *info, struct scsi_cmnd *SCpnt,
 	 * the upper layers to process.  This would have been set
 	 * correctly by fas216_std_done.
 	 */
+	scsi_eh_restore_cmnd(SCpnt, &info->ses);
 	SCpnt->scsi_done(SCpnt);
 }
 
@@ -2103,23 +2104,12 @@ request_sense:
 	if (SCpnt->cmnd[0] == REQUEST_SENSE)
 		goto done;
 
+	scsi_eh_prep_cmnd(SCpnt, &info->ses, NULL, 0, ~0);
 	fas216_log_target(info, LOG_CONNECT, SCpnt->device->id,
 			  "requesting sense");
-	memset(SCpnt->cmnd, 0, sizeof (SCpnt->cmnd));
-	SCpnt->cmnd[0] = REQUEST_SENSE;
-	SCpnt->cmnd[1] = SCpnt->device->lun << 5;
-	SCpnt->cmnd[4] = sizeof(SCpnt->sense_buffer);
-	SCpnt->cmd_len = COMMAND_SIZE(SCpnt->cmnd[0]);
-	SCpnt->SCp.buffer = NULL;
-	SCpnt->SCp.buffers_residual = 0;
-	SCpnt->SCp.ptr = (char *)SCpnt->sense_buffer;
-	SCpnt->SCp.this_residual = sizeof(SCpnt->sense_buffer);
-	SCpnt->SCp.phase = sizeof(SCpnt->sense_buffer);
+	init_SCp(SCpnt);
 	SCpnt->SCp.Message = 0;
 	SCpnt->SCp.Status = 0;
-	SCpnt->request_bufflen = sizeof(SCpnt->sense_buffer);
-	SCpnt->sc_data_direction = DMA_FROM_DEVICE;
-	SCpnt->use_sg = 0;
 	SCpnt->tag = 0;
 	SCpnt->host_scribble = (void *)fas216_rq_sns_done;
 
diff --git a/drivers/scsi/arm/fas216.h b/drivers/scsi/arm/fas216.h
index 00e5f05..3e73e26 100644
--- a/drivers/scsi/arm/fas216.h
+++ b/drivers/scsi/arm/fas216.h
@@ -16,6 +16,8 @@
 #define NO_IRQ 255
 #endif
 
+#include <scsi/scsi_eh.h>
+
 #include "queue.h"
 #include "msgqueue.h"
 
@@ -311,6 +313,7 @@ typedef struct {
 
 	/* miscellaneous */
 	int			internal_done;		/* flag to indicate request done */
+	struct scsi_eh_save	*ses;		/* holds request sense restore info */
 	unsigned long		magic_end;
 } FAS216_Info;
 
-- 
1.5.3.8



--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
scsi/arm/fas216.c compile error, Adrian Bunk, (Fri Feb 8, 5:04 pm)
Re: scsi/arm/fas216.c compile error, Boaz Harrosh, (Sun Feb 10, 6:07 am)
Re: scsi/arm/fas216.c compile error, Russell King, (Sun Feb 10, 6:52 am)
Re: scsi/arm/fas216.c compile error, Russell King, (Sun Feb 10, 6:58 am)
Re: scsi/arm/fas216.c compile error, Adrian Bunk, (Sun Feb 10, 6:59 am)
Re: scsi/arm/fas216.c compile error, Boaz Harrosh, (Sun Feb 10, 7:15 am)
Re: scsi/arm/fas216.c compile error, James Bottomley, (Sun Feb 10, 7:20 am)
Re: scsi/arm/fas216.c compile error, Boaz Harrosh, (Sun Feb 10, 7:37 am)
Re: scsi/arm/fas216.c compile error, Russell King, (Sun Feb 10, 3:02 pm)
Re: scsi/arm/fas216.c compile error, James Bottomley, (Sun Feb 10, 3:44 pm)
Re: scsi/arm/fas216.c compile error, Boaz Harrosh, (Mon Feb 11, 2:47 am)
Re: scsi/arm/fas216.c compile error, Russell King, (Mon Feb 11, 3:02 am)
Re: scsi/arm/fas216.c compile error, Boaz Harrosh, (Mon Feb 11, 3:14 am)