From: Tyrel Datwyler <tyreld@linux.ibm.com>
To: james.bottomley@hansenpartnership.com, martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-kernel@vger.kernel.org, brking@linux.ibm.com,
davemarq@linux.ibm.com, Tyrel Datwyler <tyreld@linux.ibm.com>
Subject: [PATCH v2] ibmvscsi: implement vio driver shutdown call back to quiesce ibmvscsi
Date: Wed, 16 Sep 2026 14:33:59 -0700 [thread overview]
Message-ID: <20260916213359.2144094-1-tyreld@linux.ibm.com> (raw)
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
reply other threads:[~2026-09-16 21:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260916213359.2144094-1-tyreld@linux.ibm.com \
--to=tyreld@linux.ibm.com \
--cc=brking@linux.ibm.com \
--cc=davemarq@linux.ibm.com \
--cc=james.bottomley@hansenpartnership.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=martin.petersen@oracle.com \
/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
all inboxes | Powered by JetHome®