Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Dave C Boutcher <sleddog@us.ibm.com>
To: linux-scsi@vger.kernel.org
Cc: Michael Ellerman <michael@ellerman.id.au>
Subject: [PATCH] ibmvscsi kexec fix
Date: Tue, 15 Nov 2005 09:53:00 -0600	[thread overview]
Message-ID: <20051115155300.GA26724@cs.umn.edu> (raw)

James, this is a 2.6.15 candidate...it makes ibmvscsi work
correctly with the recent set of kexec patches that went in.
This is based on work by Michael Ellerman, who chased this
initially.  He validated that it works during kexec.

Handle kexec correctly in ibmvscsi.   During kexec the adapter
will not get cleaned up correctly, so we may need to reset it
to make it sane again.

Signed-off-by: Dave Boutcher <sleddog@us.ibm.com>

--- linux-2.6.15-rc1-orig/drivers/scsi/ibmvscsi/ibmvscsi.h	2005-11-14 14:55:32.000000000 -0600
+++ linux-2.6.15-rc1/drivers/scsi/ibmvscsi/ibmvscsi.h	2005-11-14 21:13:52.000000000 -0600
@@ -100,7 +100,7 @@
 void ibmvscsi_release_crq_queue(struct crq_queue *queue,
 				struct ibmvscsi_host_data *hostdata,
 				int max_requests);
-void ibmvscsi_reset_crq_queue(struct crq_queue *queue,
+int ibmvscsi_reset_crq_queue(struct crq_queue *queue,
 			      struct ibmvscsi_host_data *hostdata);
 
 void ibmvscsi_handle_crq(struct viosrp_crq *crq,
--- linux-2.6.15-rc1-orig/drivers/scsi/ibmvscsi/rpa_vscsi.c	2005-11-14 14:55:32.000000000 -0600
+++ linux-2.6.15-rc1/drivers/scsi/ibmvscsi/rpa_vscsi.c	2005-11-14 21:13:51.000000000 -0600
@@ -230,6 +230,11 @@
 	rc = plpar_hcall_norets(H_REG_CRQ,
 				vdev->unit_address,
 				queue->msg_token, PAGE_SIZE);
+	if (rc == H_Resource) 
+		/* maybe kexecing and resource is busy. try a reset */
+		rc = ibmvscsi_reset_crq_queue(queue,
+					      hostdata);
+
 	if (rc == 2) {
 		/* Adapter is good, but other end is not ready */
 		printk(KERN_WARNING "ibmvscsi: Partner adapter not ready\n");
@@ -281,7 +286,7 @@
  * @hostdata:	ibmvscsi_host_data of host
  *
  */
-void ibmvscsi_reset_crq_queue(struct crq_queue *queue,
+int ibmvscsi_reset_crq_queue(struct crq_queue *queue,
 			      struct ibmvscsi_host_data *hostdata)
 {
 	int rc;
@@ -309,4 +314,5 @@
 		printk(KERN_WARNING
 		       "ibmvscsi: couldn't register crq--rc 0x%x\n", rc);
 	}
+	return rc;
 }
--- linux-2.6.15-rc1-orig/drivers/scsi/ibmvscsi/iseries_vscsi.c	2005-11-14 14:56:47.000000000 -0600
+++ linux-2.6.15-rc1/drivers/scsi/ibmvscsi/iseries_vscsi.c	2005-11-14 21:13:53.000000000 -0600
@@ -117,9 +117,10 @@
  *
  * no-op for iSeries
  */
-void ibmvscsi_reset_crq_queue(struct crq_queue *queue,
+int ibmvscsi_reset_crq_queue(struct crq_queue *queue,
 			      struct ibmvscsi_host_data *hostdata)
 {
+	return 0;
 }
 
 /**
-- 
Dave Boutcher

             reply	other threads:[~2005-11-15 15:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-15 15:53 Dave C Boutcher [this message]
2005-12-02 19:28 ` [PATCH] ibmvscsi kexec fix Dave C Boutcher
2005-12-05  2:52   ` James Bottomley

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=20051115155300.GA26724@cs.umn.edu \
    --to=sleddog@us.ibm.com \
    --cc=boutcher@cs.umn.edu \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michael@ellerman.id.au \
    /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