Skip to contentSkip to conversation

2.5.67: ppa driver & preempt == oops

PATCH walt 1 participant 1 message Apr 17, 2003 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

walt

author
#2 lore raw
Quoted 36 lines · Patrick Mansfield

...There was a missing call to scsi_queue_next_request for door locking (the ioctl in the scsi log output, ALLOW_MEDIUM_REMOVAL value 30, or 0x1e), Mike A posted this patch to linux-scsi in response to some debugging leg work of Alan Stern, does this fix your problem?

Not sure if it patches clean against 2.5.67, but it's pretty simple.

DESC
The patch adds a call to scsi_queue_next_request from scsi_release_request. It also removes a call in scsi_eh_lock_done to scsi_put_command. scsi_release_request will do a call to scsi_put_command if needed. EDESC

 drivers/scsi/scsi.c       |    2 ++
 drivers/scsi/scsi_error.c |    4 ----
 2 files changed, 2 insertions(+), 4 deletions(-)

diff -puN drivers/scsi/scsi.c~scsi-release-req drivers/scsi/scsi.c

drivers/scsi/scsi.c renamed from drivers/scsi/scsi.c~scsi-release-req +2 -0
@@ -224,8 +224,10 @@ void scsi_release_request(Scsi_Request *
 {
 	if( req->sr_command != NULL )
 	{
+    		request_queue_t *q = req->sr_device->request_queue;
 		scsi_put_command(req->sr_command);
 		req->sr_command = NULL;
+		scsi_queue_next_request(q, NULL);
 	}
 
 	kfree(req);

diff -puN drivers/scsi/scsi_error.c~scsi-release-req drivers/scsi/scsi_error.c

drivers/scsi/scsi_error.c static void scsi_eh_lock_done(struct scs · line 1338

Quoted 9 lines
drivers/scsi/scsi_error.c renamed from drivers/scsi/scsi_error.c~scsi-release-req +0 -4
@@ -1334,10 +1334,6 @@ static void scsi_eh_lock_done(struct scs
 {
 	struct scsi_request *sreq = scmd->sc_request;
 
-	scmd->sc_request = NULL;
-	sreq->sr_command = NULL;
-
-	scsi_put_command(scmd);
 	scsi_release_request(sreq);
 }

Yes! I can now eject and re-insert a Zip disk in the drive and re-mount it as many times as I wish.

I did need to remove the 'static' (as posted by Gert) before I could compile the kernel, but otherwise it seems perfect.

You guys are great, thanks!