public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian King <brking@us.ibm.com>
To: James.Bottomley@steeleye.com
Cc: linux-scsi@vger.kernel.org
Subject: [PATCH 1/3] ipr abort hang fix - resend
Date: Wed, 09 Jun 2004 17:10:18 -0500	[thread overview]
Message-ID: <40C78ACA.1040603@us.ibm.com> (raw)

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

This one didn't seem to come through, so here it is again.
Apologies if you've already seen it.


-- 
Brian King
eServer Storage I/O
IBM Linux Technology Center

[-- Attachment #2: ipr_abort_hang.patch --]
[-- Type: text/plain, Size: 2781 bytes --]


The following patch fixes a hang that occurs when an abort
is issued by the midlayer. The hang is the result of overriding
a field in the union of the ipr_cmd struct. It is fixed by moving
this pointer outside of the union, since it is not mutually exclusive
with the other fields in the union.


---

 linux-2.6.7-rc2-bjking1/drivers/scsi/ipr.c |   15 ++++++++-------
 linux-2.6.7-rc2-bjking1/drivers/scsi/ipr.h |    2 +-
 2 files changed, 9 insertions(+), 8 deletions(-)

diff -puN drivers/scsi/ipr.c~ipr_abort_hang drivers/scsi/ipr.c
--- linux-2.6.7-rc2/drivers/scsi/ipr.c~ipr_abort_hang	2004-06-07 11:21:15.000000000 -0500
+++ linux-2.6.7-rc2-bjking1/drivers/scsi/ipr.c	2004-06-07 11:21:15.000000000 -0500
@@ -448,6 +448,7 @@ static void ipr_init_ipr_cmnd(struct ipr
 {
 	ipr_reinit_ipr_cmnd(ipr_cmd);
 	ipr_cmd->u.scratch = 0;
+	ipr_cmd->sibling = NULL;
 	init_timer(&ipr_cmd->timer);
 }
 
@@ -676,8 +677,8 @@ static void ipr_do_req(struct ipr_cmnd *
  **/
 static void ipr_internal_cmd_done(struct ipr_cmnd *ipr_cmd)
 {
-	if (ipr_cmd->u.sibling)
-		ipr_cmd->u.sibling = NULL;
+	if (ipr_cmd->sibling)
+		ipr_cmd->sibling = NULL;
 	else
 		complete(&ipr_cmd->completion);
 }
@@ -3015,10 +3016,10 @@ static void ipr_bus_reset_done(struct ip
 	 * If abort has not completed, indicate the reset has, else call the
 	 * abort's done function to wake the sleeping eh thread
 	 */
-	if (ipr_cmd->u.sibling->u.sibling)
-		ipr_cmd->u.sibling->u.sibling = NULL;
+	if (ipr_cmd->sibling->sibling)
+		ipr_cmd->sibling->sibling = NULL;
 	else
-		ipr_cmd->u.sibling->done(ipr_cmd->u.sibling);
+		ipr_cmd->sibling->done(ipr_cmd->sibling);
 
 	list_add_tail(&ipr_cmd->queue, &ioa_cfg->free_q);
 	LEAVE;
@@ -3051,8 +3052,8 @@ static void ipr_abort_timeout(struct ipr
 
 	ipr_sdev_err(ipr_cmd->u.sdev, "Abort timed out. Resetting bus\n");
 	reset_cmd = ipr_get_free_ipr_cmnd(ioa_cfg);
-	ipr_cmd->u.sibling = reset_cmd;
-	reset_cmd->u.sibling = ipr_cmd;
+	ipr_cmd->sibling = reset_cmd;
+	reset_cmd->sibling = ipr_cmd;
 	reset_cmd->ioarcb.res_handle = ipr_cmd->ioarcb.res_handle;
 	cmd_pkt = &reset_cmd->ioarcb.cmd_pkt;
 	cmd_pkt->request_type = IPR_RQTYPE_IOACMD;
diff -puN drivers/scsi/ipr.h~ipr_abort_hang drivers/scsi/ipr.h
--- linux-2.6.7-rc2/drivers/scsi/ipr.h~ipr_abort_hang	2004-06-07 11:21:15.000000000 -0500
+++ linux-2.6.7-rc2-bjking1/drivers/scsi/ipr.h	2004-06-07 11:21:15.000000000 -0500
@@ -932,13 +932,13 @@ struct ipr_cmnd {
 	dma_addr_t sense_buffer_dma;
 	unsigned short dma_use_sg;
 	dma_addr_t dma_handle;
+	struct ipr_cmnd *sibling;
 	union {
 		enum ipr_shutdown_type shutdown_type;
 		struct ipr_hostrcb *hostrcb;
 		unsigned long time_left;
 		unsigned long scratch;
 		struct ipr_resource_entry *res;
-		struct ipr_cmnd *sibling;
 		struct scsi_device *sdev;
 	} u;
 

_

                 reply	other threads:[~2004-06-09 22:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=40C78ACA.1040603@us.ibm.com \
    --to=brking@us.ibm.com \
    --cc=James.Bottomley@steeleye.com \
    --cc=linux-scsi@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