public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Jennings <rcj@linux.vnet.ibm.com>
To: linux-scsi@vger.kernel.org
Cc: Robert Jennings <rcj@linux.vnet.ibm.com>
Subject: [PATCH 2/2] ibmvscsi: add slave_configure to allow device restart
Date: Fri, 09 Feb 2007 11:50:00 -0600	[thread overview]
Message-ID: <20070209175000.5080.69780.sendpatchset@toy> (raw)
In-Reply-To: <20070209174949.5080.69663.sendpatchset@toy>

Adding a slave_configure function for the driver. Now the disks can be
restarted by the scsi mid-layer when the are disconnected and reconnected.

Signed-off-by: "Robert Jennings" <rcj@linux.vnet.ibm.com>
---
 drivers/scsi/ibmvscsi/ibmvscsi.c |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Index: ibmvscsi-23509/drivers/scsi/ibmvscsi/ibmvscsi.c
===================================================================
--- ibmvscsi-23509.orig/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ ibmvscsi-23509/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -1354,6 +1354,23 @@
 	return rc;
 }
 
+/**
+ * ibmvscsi_slave_configure: For each slave device that is a disk,
+ * ensure that the "allow_restart" flag is enabled.
+ */
+static int ibmvscsi_slave_configure(struct scsi_device *sdev)
+{
+	struct Scsi_Host *shost = sdev->host;
+	int lock_flags = 0;
+
+	spin_lock_irqsave(shost->host_lock, lock_flags);
+	if (sdev->type == TYPE_DISK)
+		sdev->allow_restart = 1;
+	scsi_adjust_queue_depth(sdev, 0, shost->cmd_per_lun);
+	spin_unlock_irqrestore(shost->host_lock, lock_flags);
+	return 0;
+}
+
 /* ------------------------------------------------------------
  * sysfs attributes
  */
@@ -1499,6 +1516,7 @@
 	.queuecommand = ibmvscsi_queuecommand,
 	.eh_abort_handler = ibmvscsi_eh_abort_handler,
 	.eh_device_reset_handler = ibmvscsi_eh_device_reset_handler,
+	.slave_configure = ibmvscsi_slave_configure,
 	.cmd_per_lun = 16,
 	.can_queue = IBMVSCSI_MAX_REQUESTS_DEFAULT,
 	.this_id = -1,

  parent reply	other threads:[~2007-02-09 17:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-09 17:49 [PATCH 0/2] ibmvscsi: dynamic request_limit and device restart Robert Jennings
2007-02-09 17:49 ` [PATCH 1/2] ibmvscsi: allow for dynamic adjustment of server request_limit Robert Jennings
2007-02-12 15:42   ` Santiago Leon
2007-02-09 17:50 ` Robert Jennings [this message]
2007-02-12 15:42   ` [PATCH 2/2] ibmvscsi: add slave_configure to allow device restart Santiago Leon
2007-02-13 16:51   ` [PATCH 2/2] [v2] " Robert Jennings
  -- strict thread matches above, loose matches on Subject: below --
2007-03-28 17:38 [PATCH 0/2][resend] ibmvscsi: dynamic request_limit and " Robert Jennings
2007-03-28 17:47 ` [PATCH 2/2] ibmvscsi: add slave_configure to allow " Robert Jennings
2007-03-28 17:54   ` Randy Dunlap
2007-03-29 16:28     ` Robert Jennings
2007-03-29 16:42       ` Randy Dunlap

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=20070209175000.5080.69780.sendpatchset@toy \
    --to=rcj@linux.vnet.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    /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