* [PATCH v2] ibmvscsi: implement vio driver shutdown call back to quiesce ibmvscsi
@ 2026-09-16 21:33 Tyrel Datwyler
0 siblings, 0 replies; only message in thread
From: Tyrel Datwyler @ 2026-09-16 21:33 UTC (permalink / raw)
To: james.bottomley, martin.petersen
Cc: linux-scsi, linuxppc-dev, linux-kernel, brking, davemarq, Tyrel Datwyler
Currently during kexec the vio driver implementation calls a drivers
remove function as a big hammer when shutdown isn't implemented. This
results in filesystem errors in the log as a result of the block device
being removed while the filesystem is still mounted. Rectify this noise
by quiescing the ibmvscsi driver and stopping short of tearing down the
full host.
Move quiesce calls to their own helper function. Add a driver shutdown
call back and implement with call to ibmvscsi_quiesce such that any
outstanding commands are purged and failed back to the midlayer with
DID_REQUEUE. Update ibmvscsi_remove to also use the new ibmvscsi_quiesce
and failback outstanding commands with DID_ERROR prior to full transport
teardown.
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
---
Changes since v1:
- Only call scsi_block_requests in ibmvscsi_shutdown
- set_request_limit to 0 during quiesce to fail any new submissions
drivers/scsi/ibmvscsi/ibmvscsi.c | 33 +++++++++++++++++++++++---------
1 file changed, 24 insertions(+), 9 deletions(-)
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index 4ecd3db08875..576f784b6677 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -2341,26 +2341,40 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id)
return -1;
}
-static void ibmvscsi_remove(struct vio_dev *vdev)
+static void ibmvscsi_quiesce(struct ibmvscsi_host_data *hostdata, int scsi_error_code)
{
- struct ibmvscsi_host_data *hostdata = dev_get_drvdata(&vdev->dev);
-
- srp_remove_host(hostdata->host);
- scsi_remove_host(hostdata->host);
-
- purge_requests(hostdata, DID_ERROR);
- release_event_pool(&hostdata->pool, hostdata);
+ ibmvscsi_set_request_limit(hostdata, 0);
+ kthread_stop(hostdata->work_thread);
ibmvscsi_release_crq_queue(&hostdata->queue, hostdata,
max_events);
- kthread_stop(hostdata->work_thread);
+ purge_requests(hostdata, scsi_error_code);
+
+ release_event_pool(&hostdata->pool, hostdata);
unmap_persist_bufs(hostdata);
+}
+
+static void ibmvscsi_shutdown(struct vio_dev *vdev)
+{
+ struct ibmvscsi_host_data *hostdata = dev_get_drvdata(&vdev->dev);
+
+ scsi_block_requests(hostdata->host);
+ ibmvscsi_quiesce(hostdata, DID_REQUEUE);
+}
+
+static void ibmvscsi_remove(struct vio_dev *vdev)
+{
+ struct ibmvscsi_host_data *hostdata = dev_get_drvdata(&vdev->dev);
+
+ ibmvscsi_quiesce(hostdata, DID_ERROR);
spin_lock(&ibmvscsi_driver_lock);
list_del(&hostdata->host_list);
spin_unlock(&ibmvscsi_driver_lock);
+ srp_remove_host(hostdata->host);
+ scsi_remove_host(hostdata->host);
scsi_host_put(hostdata->host);
}
@@ -2398,6 +2412,7 @@ static struct vio_driver ibmvscsi_driver = {
.id_table = ibmvscsi_device_table,
.probe = ibmvscsi_probe,
.remove = ibmvscsi_remove,
+ .shutdown = ibmvscsi_shutdown,
.get_desired_dma = ibmvscsi_get_desired_dma,
.name = "ibmvscsi",
.pm = &ibmvscsi_pm_ops,
--
2.55.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-16 21:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-16 21:33 [PATCH v2] ibmvscsi: implement vio driver shutdown call back to quiesce ibmvscsi Tyrel Datwyler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®