Skip to contentSkip to conversation

ibmvscsi kexec fix

PATCH In review Dave C Boutcher 2 participants 3 messages Nov 15, 2005 – Dec 5, 2005

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ibmvscsi kexec fix

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.

drivers/scsi/ibmvscsi/ibmvscsi.h +1 -1
@@ -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,
drivers/scsi/ibmvscsi/rpa_vscsi.c +7 -1
@@ -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;
 }
drivers/scsi/ibmvscsi/iseries_vscsi.c +2 -1
@@ -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;
 }
 
 /**
Signature · 1 line
Dave Boutcher
#1 lore raw
Quoted 10 lines · Dave C Boutcher

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.

James, if this doesn't make it into 2.6.15 it won't totally break my heart, since I'm not sure how many people are using ppc64 kexec, but was there some reason this patch wasn't included in your 2.6.15 fixes?

Signature · 1 line
Dave Boutcher
#2 lore raw
Quoted 4 lines · Dave C Boutcher

James, if this doesn't make it into 2.6.15 it won't totally break my heart, since I'm not sure how many people are using ppc64 kexec, but was there some reason this patch wasn't included in your 2.6.15 fixes?

Because it arrived in the flood of email I had when I got back from holiday and I missed it, I'm afraid.

James