public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Justin Cormack <justin@street-vision.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH/RFT] libata "DMA timeout" fix
Date: Sun, 29 Feb 2004 12:31:20 -0500	[thread overview]
Message-ID: <404221E8.6040303@pobox.com> (raw)
In-Reply-To: <1078075560.12938.1420.camel@lotte.street-vision.com>

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

Justin Cormack wrote:
> Thanks, testing James's fix on one machine at the moment. Will have
> another six or so machines as a libata test farm tomorrow.


You'll need a few more changes...  here's the final patch.

	Jeff



[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 2895 bytes --]

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1682  -> 1.1683 
#	drivers/scsi/libata-core.c	1.19    -> 1.20   
#	 drivers/scsi/scsi.c	1.136   -> 1.137  
#	drivers/scsi/scsi_priv.h	1.30    -> 1.31   
#	include/scsi/scsi_cmnd.h	1.4     -> 1.5    
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 04/02/28	jgarzik@redhat.com	1.1683
# [libata] Use scsi_finish_command as completion function,
# in our error handling thread callback.
# 
# This also exports scsi_finish_command in the SCSI layer.
# 
# Thanks much to James Bottomley and his patience, as this solution
# was figured out.
# --------------------------------------------
#
diff -Nru a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
--- a/drivers/scsi/libata-core.c	Sun Feb 29 12:30:47 2004
+++ b/drivers/scsi/libata-core.c	Sun Feb 29 12:30:47 2004
@@ -2005,6 +2005,14 @@
 		goto out;
 	}
 
+	/* hack alert!  We cannot use the supplied completion
+	 * function from inside the ->eh_strategy_handler() thread.
+	 * libata is the only user of ->eh_strategy_handler() in
+	 * any kernel, so the default scsi_done() assumes it is
+	 * not being called from the SCSI EH.
+	 */
+	qc->scsidone = scsi_finish_command;
+
 	switch (qc->tf.protocol) {
 	case ATA_PROT_DMA_READ:
 	case ATA_PROT_DMA_WRITE:
diff -Nru a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
--- a/drivers/scsi/scsi.c	Sun Feb 29 12:30:47 2004
+++ b/drivers/scsi/scsi.c	Sun Feb 29 12:30:47 2004
@@ -847,6 +847,7 @@
 
 	cmd->done(cmd);
 }
+EXPORT_SYMBOL(scsi_finish_command);
 
 /*
  * Function:	scsi_adjust_queue_depth()
diff -Nru a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h
--- a/drivers/scsi/scsi_priv.h	Sun Feb 29 12:30:47 2004
+++ b/drivers/scsi/scsi_priv.h	Sun Feb 29 12:30:47 2004
@@ -77,7 +77,6 @@
 extern int scsi_setup_command_freelist(struct Scsi_Host *shost);
 extern void scsi_destroy_command_freelist(struct Scsi_Host *shost);
 extern void scsi_done(struct scsi_cmnd *cmd);
-extern void scsi_finish_command(struct scsi_cmnd *cmd);
 extern int scsi_retry_command(struct scsi_cmnd *cmd);
 extern int scsi_insert_special_req(struct scsi_request *sreq, int);
 extern void scsi_init_cmd_from_req(struct scsi_cmnd *cmd,
diff -Nru a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
--- a/include/scsi/scsi_cmnd.h	Sun Feb 29 12:30:47 2004
+++ b/include/scsi/scsi_cmnd.h	Sun Feb 29 12:30:47 2004
@@ -159,5 +159,6 @@
 extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, int);
 extern void scsi_put_command(struct scsi_cmnd *);
 extern void scsi_io_completion(struct scsi_cmnd *, unsigned int, unsigned int);
+extern void scsi_finish_command(struct scsi_cmnd *cmd);
 
 #endif /* _SCSI_SCSI_CMND_H */

      reply	other threads:[~2004-02-29 17:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-28 19:10 [PATCH/RFT] libata "DMA timeout" fix Jeff Garzik
2004-02-28 20:49 ` James Bottomley
2004-02-28 21:23   ` Jeff Garzik
2004-02-28 21:28     ` James Bottomley
2004-02-29 17:26     ` Justin Cormack
2004-02-29 17:31       ` Jeff Garzik [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=404221E8.6040303@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=James.Bottomley@steeleye.com \
    --cc=justin@street-vision.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox