linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 5/5] kill scsi_wait_req
@ 2005-09-16  4:40 Mike Christie
  2005-09-16  7:40 ` Rolf Eike Beer
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Christie @ 2005-09-16  4:40 UTC (permalink / raw)
  To: linux-scsi

cpqfc is the last user of scsi_wait_req. It is too broken to even
test patches to convert it to other functions though.
This patch just kills scsi_wait_req and adds to the list
of things that are broken on cpqfc. I was not sure what
the proper thing to do in this case when the driver
is so broken.


Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>

diff --git a/drivers/scsi/cpqfcTSinit.c b/drivers/scsi/cpqfcTSinit.c
--- a/drivers/scsi/cpqfcTSinit.c
+++ b/drivers/scsi/cpqfcTSinit.c
@@ -663,6 +663,10 @@ int cpqfcTS_ioctl( struct scsi_device *S
 	privatedata->pdrive = vendor_cmd->pdrive;
 	
         // eventually gets us to our own _quecommand routine
+
+	/*
+	 * convert to scsi_execute_async if this driver ever works again
+	 */
 	scsi_wait_req(ScsiPassThruReq, 
 		&vendor_cmd->cdb[0], buf, vendor_cmd->len, 
 		10*HZ,  // timeout
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -228,55 +228,6 @@ void scsi_do_req(struct scsi_request *sr
 }
 EXPORT_SYMBOL(scsi_do_req);
 
-/* This is the end routine we get to if a command was never attached
- * to the request.  Simply complete the request without changing
- * rq_status; this will cause a DRIVER_ERROR. */
-static void scsi_wait_req_end_io(struct request *req)
-{
-	BUG_ON(!req->waiting);
-
-	complete(req->waiting);
-}
-
-void scsi_wait_req(struct scsi_request *sreq, const void *cmnd, void *buffer,
-		   unsigned bufflen, int timeout, int retries)
-{
-	DECLARE_COMPLETION(wait);
-	int write = (sreq->sr_data_direction == DMA_TO_DEVICE);
-	struct request *req;
-
-	req = blk_get_request(sreq->sr_device->request_queue, write,
-			      __GFP_WAIT);
-	if (bufflen && blk_rq_map_kern(sreq->sr_device->request_queue, req,
-				       buffer, bufflen, __GFP_WAIT)) {
-		sreq->sr_result = DRIVER_ERROR << 24;
-		blk_put_request(req);
-		return;
-	}
-
-	req->flags |= REQ_NOMERGE;
-	req->waiting = &wait;
-	req->end_io = scsi_wait_req_end_io;
-	req->cmd_len = COMMAND_SIZE(((u8 *)cmnd)[0]);
-	req->sense = sreq->sr_sense_buffer;
-	req->sense_len = 0;
-	memcpy(req->cmd, cmnd, req->cmd_len);
-	req->timeout = timeout;
-	req->flags |= REQ_BLOCK_PC;
-	req->rq_disk = NULL;
-	blk_insert_request(sreq->sr_device->request_queue, req,
-			   sreq->sr_data_direction == DMA_TO_DEVICE, NULL);
-	wait_for_completion(&wait);
-	sreq->sr_request->waiting = NULL;
-	sreq->sr_result = req->errors;
-	if (req->errors)
-		sreq->sr_result |= (DRIVER_ERROR << 24);
-
-	blk_put_request(req);
-}
-
-EXPORT_SYMBOL(scsi_wait_req);
-
 /**
  * scsi_execute - insert request and wait for the result
  * @sdev:	scsi device
diff --git a/include/scsi/scsi_request.h b/include/scsi/scsi_request.h
--- a/include/scsi/scsi_request.h
+++ b/include/scsi/scsi_request.h
@@ -47,9 +47,6 @@ struct scsi_request {
 
 extern struct scsi_request *scsi_allocate_request(struct scsi_device *, int);
 extern void scsi_release_request(struct scsi_request *);
-extern void scsi_wait_req(struct scsi_request *, const void *cmnd,
-			  void *buffer, unsigned bufflen,
-			  int timeout, int retries);
 extern void scsi_do_req(struct scsi_request *, const void *cmnd,
 			void *buffer, unsigned bufflen,
 			void (*done) (struct scsi_cmnd *),



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

* Re: [PATCH 5/5] kill scsi_wait_req
  2005-09-16  4:40 [PATCH 5/5] kill scsi_wait_req Mike Christie
@ 2005-09-16  7:40 ` Rolf Eike Beer
  2005-09-16  7:45   ` Mike Christie
  0 siblings, 1 reply; 3+ messages in thread
From: Rolf Eike Beer @ 2005-09-16  7:40 UTC (permalink / raw)
  To: Mike Christie; +Cc: linux-scsi

[-- Attachment #1: Type: text/plain, Size: 609 bytes --]

Mike Christie wrote:
>cpqfc is the last user of scsi_wait_req. It is too broken to even
>test patches to convert it to other functions though.
>This patch just kills scsi_wait_req and adds to the list
>of things that are broken on cpqfc. I was not sure what
>the proper thing to do in this case when the driver
>is so broken.

If you want to test it you'll find the needed patches on 
http://opensource.sf-tec.de/kernel/. I found someone with this hardware (or 
he found me) and we're testing this.

If you refuse to touch it I'll try to fix it up once your patches went into 
mainline.

Eike

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [PATCH 5/5] kill scsi_wait_req
  2005-09-16  7:40 ` Rolf Eike Beer
@ 2005-09-16  7:45   ` Mike Christie
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Christie @ 2005-09-16  7:45 UTC (permalink / raw)
  To: Rolf Eike Beer; +Cc: linux-scsi

Rolf Eike Beer wrote:
> Mike Christie wrote:
> 
>>cpqfc is the last user of scsi_wait_req. It is too broken to even
>>test patches to convert it to other functions though.
>>This patch just kills scsi_wait_req and adds to the list
>>of things that are broken on cpqfc. I was not sure what
>>the proper thing to do in this case when the driver
>>is so broken.
> 
> 
> If you want to test it you'll find the needed patches on 
> http://opensource.sf-tec.de/kernel/. I found someone with this hardware (or 
> he found me) and we're testing this.
> 
> If you refuse to touch it I'll try to fix it up once your patches went into 
> mainline.
> 

I actually had a patch. Let me see if I can dig it up so you can test.

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

end of thread, other threads:[~2005-09-16  7:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-16  4:40 [PATCH 5/5] kill scsi_wait_req Mike Christie
2005-09-16  7:40 ` Rolf Eike Beer
2005-09-16  7:45   ` Mike Christie

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