[PATCH 2/3] ibmvscsi: Add a shutdown() function to ibmvscsi
Michael Ellerman
michael at ellerman.id.au
Thu Aug 4 17:14:58 EST 2005
Add a shutdown() function to the ibmvscsi driver.
I originally just used ibmvscsi_remove() for shutdown, but this was causing
errors as something was trying to do I/O to the disk when we removed it.
The following works for me on our Power5 box, in that it doesn't many
errors on shutdown and it allows the ibmvscsi to come up again after kexec.
It may not be the "Right Thing" to do though.
Signed-off-by: Michael Ellerman <michael at ellerman.id.au>
drivers/scsi/ibmvscsi/ibmvscsi.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletion(-)
Index: kexec/drivers/scsi/ibmvscsi/ibmvscsi.c
===================================================================
--- kexec.orig/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ kexec/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -1436,6 +1436,15 @@ static int ibmvscsi_remove(struct vio_de
return 0;
}
+static void ibmvscsi_shutdown(struct vio_dev *vdev)
+{
+ struct ibmvscsi_host_data *hostdata = vdev->dev.driver_data;
+
+ atomic_set(&hostdata->request_limit, -1);
+ release_event_pool(&hostdata->pool, hostdata);
+ ibmvscsi_release_crq_queue(&hostdata->queue, hostdata, max_requests);
+}
+
/**
* ibmvscsi_device_table: Used by vio.c to match devices in the device tree we
* support.
@@ -1450,7 +1459,8 @@ static struct vio_driver ibmvscsi_driver
.name = "ibmvscsi",
.id_table = ibmvscsi_device_table,
.probe = ibmvscsi_probe,
- .remove = ibmvscsi_remove
+ .remove = ibmvscsi_remove,
+ .shutdown = ibmvscsi_shutdown
};
int __init ibmvscsi_module_init(void)
More information about the Linuxppc64-dev
mailing list