linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] scsi_dh_emc: fix mode select request setup
@ 2009-12-02 20:28 michaelc
  2009-12-02 20:36 ` James Bottomley
  0 siblings, 1 reply; 4+ messages in thread
From: michaelc @ 2009-12-02 20:28 UTC (permalink / raw)
  To: linux-scsi; +Cc: Mike Christie, Hannes Reinecke

From: Mike Christie <michaelc@cs.wisc.edu>

This patch fixes the request setup code for mode selects. I got the fixes from
Hannes Reinecke while trying to hunt down some problems and merged it
into one patch. I am sending it because Hannes is busy with other things.

The patch fixes:
- setting of the length for mode selects.
- setting of the data direction for mode select 10.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
---
 drivers/scsi/device_handler/scsi_dh_emc.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/device_handler/scsi_dh_emc.c b/drivers/scsi/device_handler/scsi_dh_emc.c
index 6196675..63032ec 100644
--- a/drivers/scsi/device_handler/scsi_dh_emc.c
+++ b/drivers/scsi/device_handler/scsi_dh_emc.c
@@ -272,7 +272,7 @@ static struct request *get_req(struct scsi_device *sdev, int cmd,
 	int len = 0;
 
 	rq = blk_get_request(sdev->request_queue,
-			(cmd == MODE_SELECT) ? WRITE : READ, GFP_NOIO);
+			(cmd != INQUIRY) ? WRITE : READ, GFP_NOIO);
 	if (!rq) {
 		sdev_printk(KERN_INFO, sdev, "get_req: blk_get_request failed");
 		return NULL;
@@ -286,14 +286,17 @@ static struct request *get_req(struct scsi_device *sdev, int cmd,
 		len = sizeof(short_trespass);
 		rq->cmd_flags |= REQ_RW;
 		rq->cmd[1] = 0x10;
+		rq->cmd[4] = len;
 		break;
 	case MODE_SELECT_10:
 		len = sizeof(long_trespass);
 		rq->cmd_flags |= REQ_RW;
 		rq->cmd[1] = 0x10;
+		rq->cmd[8] = len;
 		break;
 	case INQUIRY:
 		len = CLARIION_BUFFER_SIZE;
+		rq->cmd[4] = len;
 		memset(buffer, 0, len);
 		break;
 	default:
@@ -301,7 +304,6 @@ static struct request *get_req(struct scsi_device *sdev, int cmd,
 		break;
 	}
 
-	rq->cmd[4] = len;
 	rq->cmd_type = REQ_TYPE_BLOCK_PC;
 	rq->cmd_flags |= REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT |
 			 REQ_FAILFAST_DRIVER;
-- 
1.5.2.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] scsi_dh_emc: fix mode select request setup
  2009-12-02 20:28 [PATCH 1/1] scsi_dh_emc: fix mode select request setup michaelc
@ 2009-12-02 20:36 ` James Bottomley
  2009-12-02 20:46   ` Mike Christie
  0 siblings, 1 reply; 4+ messages in thread
From: James Bottomley @ 2009-12-02 20:36 UTC (permalink / raw)
  To: michaelc; +Cc: linux-scsi, Hannes Reinecke

On Wed, 2009-12-02 at 14:28 -0600, michaelc@cs.wisc.edu wrote:
> From: Mike Christie <michaelc@cs.wisc.edu>
> 
> This patch fixes the request setup code for mode selects. I got the fixes from
> Hannes Reinecke while trying to hunt down some problems and merged it
> into one patch. I am sending it because Hannes is busy with other things.

So that should be From: Hannes Reineke at the top then?  (I can fix it
up if it is)

James



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] scsi_dh_emc: fix mode select request setup
  2009-12-02 20:36 ` James Bottomley
@ 2009-12-02 20:46   ` Mike Christie
  2009-12-07 11:04     ` Hannes Reinecke
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Christie @ 2009-12-02 20:46 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi, Hannes Reinecke

James Bottomley wrote:
> On Wed, 2009-12-02 at 14:28 -0600, michaelc@cs.wisc.edu wrote:
>> From: Mike Christie <michaelc@cs.wisc.edu>
>>
>> This patch fixes the request setup code for mode selects. I got the fixes from
>> Hannes Reinecke while trying to hunt down some problems and merged it
>> into one patch. I am sending it because Hannes is busy with other things.
> 
> So that should be From: Hannes Reineke at the top then?  (I can fix it
> up if it is)
> 

Yeah, I think it should. I was not sure, because I merged his fixes into 
one patch and wrote the email. He wrote all the code though. I am just 
forwarding the fixes since he was busy.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] scsi_dh_emc: fix mode select request setup
  2009-12-02 20:46   ` Mike Christie
@ 2009-12-07 11:04     ` Hannes Reinecke
  0 siblings, 0 replies; 4+ messages in thread
From: Hannes Reinecke @ 2009-12-07 11:04 UTC (permalink / raw)
  To: Mike Christie; +Cc: James Bottomley, linux-scsi

Mike Christie wrote:
> James Bottomley wrote:
>> On Wed, 2009-12-02 at 14:28 -0600, michaelc@cs.wisc.edu wrote:
>>> From: Mike Christie <michaelc@cs.wisc.edu>
>>>
>>> This patch fixes the request setup code for mode selects. I got the
>>> fixes from
>>> Hannes Reinecke while trying to hunt down some problems and merged it
>>> into one patch. I am sending it because Hannes is busy with other
>>> things.
>>
>> So that should be From: Hannes Reineke at the top then?  (I can fix it
>> up if it is)
>>
> 
> Yeah, I think it should. I was not sure, because I merged his fixes into
> one patch and wrote the email. He wrote all the code though. I am just
> forwarding the fixes since he was busy.

Thanks Mike.

Yes, James, just update the 'From' header.

Provided you spell my name correctly :-)

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)
--
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-12-07 11:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-02 20:28 [PATCH 1/1] scsi_dh_emc: fix mode select request setup michaelc
2009-12-02 20:36 ` James Bottomley
2009-12-02 20:46   ` Mike Christie
2009-12-07 11:04     ` Hannes Reinecke

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).