[SCSI] ibmvscsi kexec fix
authorDave C Boutcher <sleddog@us.ibm.com>
Tue, 15 Nov 2005 15:53:00 +0000 (09:53 -0600)
committerJames Bottomley <jejb@mulgrave.(none)>
Wed, 7 Dec 2005 14:30:01 +0000 (09:30 -0500)
This 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>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/ibmvscsi/ibmvscsi.h
drivers/scsi/ibmvscsi/iseries_vscsi.c
drivers/scsi/ibmvscsi/rpa_vscsi.c

index 8bec0438dc8a9151f3aed2b04a717a0ee6a65be2..5b0edd1f19213e3d97c173c4659659e5c63b6891 100644 (file)
@@ -100,7 +100,7 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue,
 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,
index 1045872b01752fe93d3976c3b6e77a99086dc696..ce15d9e3962114f5f49d84df48de41814291ce79 100644 (file)
@@ -117,9 +117,10 @@ void ibmvscsi_release_crq_queue(struct crq_queue *queue,
  *
  * 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;
 }
 
 /**
index 8bf5652f106090ab75ec922a747e11bf0d1b2ad0..75db2f5c545e999d2b06b313560bf3610447bdd5 100644 (file)
@@ -230,6 +230,11 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue,
        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 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue,
  * @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 @@ void ibmvscsi_reset_crq_queue(struct crq_queue *queue,
                printk(KERN_WARNING
                       "ibmvscsi: couldn't register crq--rc 0x%x\n", rc);
        }
+       return rc;
 }