All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/3] ibmvscsi: Wire up host_reset() in the drivers scsi_host_template
@ 2019-05-03  0:50 Tyrel Datwyler
  2019-05-03  0:50 ` [PATCH v2 2/3] ibmvscsi: redo driver work thread to use enum action states Tyrel Datwyler
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tyrel Datwyler @ 2019-05-03  0:50 UTC (permalink / raw)
  To: james.bottomley
  Cc: Tyrel Datwyler, martin.petersen, linux-scsi, Tyrel Datwyler,
	brking, linuxppc-dev

From: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>

Wire up the host_reset function in our driver_template to allow a user
requested adpater reset via the host_reset sysfs attribute.

Example:

echo "adapter" > /sys/class/scsi_host/host0/host_reset

Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
---
Changes in v2:
	removed interrupt disabe/enable around reset

 drivers/scsi/ibmvscsi/ibmvscsi.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index 8cec5230fe31..65fc8ca962c5 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -2050,6 +2050,16 @@ static struct device_attribute ibmvscsi_host_config = {
 	.show = show_host_config,
 };
 
+static int ibmvscsi_host_reset(struct Scsi_Host *shost, int reset_type)
+{
+	struct ibmvscsi_host_data *hostdata = shost_priv(shost);
+
+	dev_info(hostdata->dev, "Initiating adapter reset!\n");
+	ibmvscsi_reset_host(hostdata);
+
+	return 0;
+}
+
 static struct device_attribute *ibmvscsi_attrs[] = {
 	&ibmvscsi_host_vhost_loc,
 	&ibmvscsi_host_vhost_name,
@@ -2076,6 +2086,7 @@ static struct scsi_host_template driver_template = {
 	.eh_host_reset_handler = ibmvscsi_eh_host_reset_handler,
 	.slave_configure = ibmvscsi_slave_configure,
 	.change_queue_depth = ibmvscsi_change_queue_depth,
+	.host_reset = ibmvscsi_host_reset,
 	.cmd_per_lun = IBMVSCSI_CMDS_PER_LUN_DEFAULT,
 	.can_queue = IBMVSCSI_MAX_REQUESTS_DEFAULT,
 	.this_id = -1,
-- 
2.18.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-05-30  1:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-03  0:50 [PATCH v2 1/3] ibmvscsi: Wire up host_reset() in the drivers scsi_host_template Tyrel Datwyler
2019-05-03  0:50 ` [PATCH v2 2/3] ibmvscsi: redo driver work thread to use enum action states Tyrel Datwyler
2019-05-03  0:50 ` [PATCH v2 3/3] ibmvscsi: fix tripping of blk_mq_run_hw_queue WARN_ON Tyrel Datwyler
2019-05-30  1:32 ` [PATCH v2 1/3] ibmvscsi: Wire up host_reset() in the drivers scsi_host_template Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.