Re: [PATCH 2/2] ibmvscsi: add slave_configure to allow device restart
On Thu, 29 Mar 2007 11:28:36 -0500 Robert Jennings wrote: > Fixed the kernel-doc comment for ibmvscsi_slave_configure. Thanks to > Randy Dunlap for catching that. Sorry, there's still a minor nit below. > 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" <[EMAIL PROTECTED]> > Signed-off-by: "Santiago Leon" <[EMAIL PROTECTED]> > > --- > drivers/scsi/ibmvscsi/ibmvscsi.c | 23 +++ > 1 file changed, 23 insertions(+) > > Index: b/drivers/scsi/ibmvscsi/ibmvscsi.c > === > --- a/drivers/scsi/ibmvscsi/ibmvscsi.c > +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c > @@ -1354,6 +1354,28 @@ > return rc; > } > > +/** > + * ibmvscsi_slave_configure: Set the "allow_restart" flag for each disk. > + * No "blank" ("*") line between the function name and its parameters... it mucks up the generated output. > + * @sdev:struct scsi_device device to configure > + * > + * Enable allow_restart for a device if it is a disk. Adjust the > + * queue_depth here also as is required by the documentation for > + * struct scsi_host_template. > + */ > +static int ibmvscsi_slave_configure(struct scsi_device *sdev) > +{ > + struct Scsi_Host *shost = sdev->host; > + unsigned long 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 +1521,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, --- ~Randy *** Remember to use Documentation/SubmitChecklist when testing your code *** - To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] ibmvscsi: add slave_configure to allow device restart
Fixed the kernel-doc comment for ibmvscsi_slave_configure. Thanks to Randy Dunlap for catching that. 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" <[EMAIL PROTECTED]> Signed-off-by: "Santiago Leon" <[EMAIL PROTECTED]> --- drivers/scsi/ibmvscsi/ibmvscsi.c | 23 +++ 1 file changed, 23 insertions(+) Index: b/drivers/scsi/ibmvscsi/ibmvscsi.c === --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c @@ -1354,6 +1354,28 @@ return rc; } +/** + * ibmvscsi_slave_configure: Set the "allow_restart" flag for each disk. + * + * @sdev: struct scsi_device device to configure + * + * Enable allow_restart for a device if it is a disk. Adjust the + * queue_depth here also as is required by the documentation for + * struct scsi_host_template. + */ +static int ibmvscsi_slave_configure(struct scsi_device *sdev) +{ + struct Scsi_Host *shost = sdev->host; + unsigned long 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 +1521,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, - To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] ibmvscsi: add slave_configure to allow device restart
On Wed, 28 Mar 2007 12:47:04 -0500 Robert Jennings wrote: > 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" <[EMAIL PROTECTED]> > Signed-off-by: "Santiago Leon" <[EMAIL PROTECTED]> > > --- > drivers/scsi/ibmvscsi/ibmvscsi.c | 18 ++ > 1 file changed, 18 insertions(+) > > Index: b/drivers/scsi/ibmvscsi/ibmvscsi.c > === > --- a/drivers/scsi/ibmvscsi/ibmvscsi.c > +++ b/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. Hi, Please don't use kernel-doc notation (/**) unless the following documentation block is in kernel-doc format. See Documentation/kernel-doc-nano-HOWTO.txt for more info, or just ask me questions if you have any. > + */ > +static int ibmvscsi_slave_configure(struct scsi_device *sdev) > +{ > + struct Scsi_Host *shost = sdev->host; > + unsigned long 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, --- ~Randy *** Remember to use Documentation/SubmitChecklist when testing your code *** - To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/2] ibmvscsi: add slave_configure to allow device restart
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" <[EMAIL PROTECTED]> Signed-off-by: "Santiago Leon" <[EMAIL PROTECTED]> --- drivers/scsi/ibmvscsi/ibmvscsi.c | 18 ++ 1 file changed, 18 insertions(+) Index: b/drivers/scsi/ibmvscsi/ibmvscsi.c === --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/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; + unsigned long 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, - To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] ibmvscsi: add slave_configure to allow device restart
Robert Jennings wrote: 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: Santiago Leon <[EMAIL PROTECTED]> Signed-off-by: "Robert Jennings" <[EMAIL PROTECTED]> - To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/2] ibmvscsi: add slave_configure to allow device restart
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" <[EMAIL PROTECTED]> --- 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, - To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html