linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] sg: Add target reset support
@ 2008-07-01 18:03 Brian King
  2008-07-02  1:41 ` Douglas Gilbert
  0 siblings, 1 reply; 3+ messages in thread
From: Brian King @ 2008-07-01 18:03 UTC (permalink / raw)
  To: dougg; +Cc: James.Bottomley, linux-scsi, brking


Adds support for target reset to SG_SCSI_RESET.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
---

 drivers/scsi/sg.c |    3 +++
 include/scsi/sg.h |    1 +
 2 files changed, 4 insertions(+)

diff -puN drivers/scsi/sg.c~sg_target_reset drivers/scsi/sg.c
--- linux-2.6/drivers/scsi/sg.c~sg_target_reset	2008-06-16 15:34:16.000000000 -0500
+++ linux-2.6-bjking1/drivers/scsi/sg.c	2008-06-16 15:36:48.000000000 -0500
@@ -1026,6 +1026,9 @@ sg_ioctl(struct inode *inode, struct fil
 		case SG_SCSI_RESET_DEVICE:
 			val = SCSI_TRY_RESET_DEVICE;
 			break;
+		case SG_SCSI_RESET_TARGET:
+			val = SCSI_TRY_RESET_TARGET;
+			break;
 		case SG_SCSI_RESET_BUS:
 			val = SCSI_TRY_RESET_BUS;
 			break;
diff -puN include/scsi/sg.h~sg_target_reset include/scsi/sg.h
--- linux-2.6/include/scsi/sg.h~sg_target_reset	2008-06-16 15:36:05.000000000 -0500
+++ linux-2.6-bjking1/include/scsi/sg.h	2008-06-16 15:36:17.000000000 -0500
@@ -206,6 +206,7 @@ typedef struct sg_req_info { /* used by 
 #define		SG_SCSI_RESET_DEVICE	1
 #define		SG_SCSI_RESET_BUS	2
 #define		SG_SCSI_RESET_HOST	3
+#define		SG_SCSI_RESET_TARGET	4
 
 /* synchronous SCSI command ioctl, (only in version 3 interface) */
 #define SG_IO 0x2285   /* similar effect as write() followed by read() */
_

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

* Re: [PATCH 1/1] sg: Add target reset support
  2008-07-01 18:03 [PATCH 1/1] sg: Add target reset support Brian King
@ 2008-07-02  1:41 ` Douglas Gilbert
  2008-07-03 16:15   ` Mike Christie
  0 siblings, 1 reply; 3+ messages in thread
From: Douglas Gilbert @ 2008-07-02  1:41 UTC (permalink / raw)
  To: Brian King; +Cc: James.Bottomley, linux-scsi

Brian King wrote:
> Adds support for target reset to SG_SCSI_RESET.
> 
> Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
> ---
> 
>  drivers/scsi/sg.c |    3 +++
>  include/scsi/sg.h |    1 +
>  2 files changed, 4 insertions(+)
> 
> diff -puN drivers/scsi/sg.c~sg_target_reset drivers/scsi/sg.c
> --- linux-2.6/drivers/scsi/sg.c~sg_target_reset	2008-06-16 15:34:16.000000000 -0500
> +++ linux-2.6-bjking1/drivers/scsi/sg.c	2008-06-16 15:36:48.000000000 -0500
> @@ -1026,6 +1026,9 @@ sg_ioctl(struct inode *inode, struct fil
>  		case SG_SCSI_RESET_DEVICE:
>  			val = SCSI_TRY_RESET_DEVICE;
>  			break;
> +		case SG_SCSI_RESET_TARGET:
> +			val = SCSI_TRY_RESET_TARGET;
> +			break;
>  		case SG_SCSI_RESET_BUS:
>  			val = SCSI_TRY_RESET_BUS;
>  			break;
> diff -puN include/scsi/sg.h~sg_target_reset include/scsi/sg.h
> --- linux-2.6/include/scsi/sg.h~sg_target_reset	2008-06-16 15:36:05.000000000 -0500
> +++ linux-2.6-bjking1/include/scsi/sg.h	2008-06-16 15:36:17.000000000 -0500
> @@ -206,6 +206,7 @@ typedef struct sg_req_info { /* used by 
>  #define		SG_SCSI_RESET_DEVICE	1
>  #define		SG_SCSI_RESET_BUS	2
>  #define		SG_SCSI_RESET_HOST	3
> +#define		SG_SCSI_RESET_TARGET	4
>  
>  /* synchronous SCSI command ioctl, (only in version 3 interface) */
>  #define SG_IO 0x2285   /* similar effect as write() followed by read() */
> _
> 

Brian,
Is SG_SCSI_RESET_DEVICE actually a Logical Unit Reset
(as defined by SAM-4) on a modern LLD? If so perhaps a
comment could be added to sg.h as "DEVICE" is an
overused word.

Signed-off-by: Douglas Gilbert <dougg@torque.net>


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

* Re: [PATCH 1/1] sg: Add target reset support
  2008-07-02  1:41 ` Douglas Gilbert
@ 2008-07-03 16:15   ` Mike Christie
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Christie @ 2008-07-03 16:15 UTC (permalink / raw)
  To: dougg; +Cc: Brian King, James.Bottomley, linux-scsi

Douglas Gilbert wrote:
> Brian King wrote:
>> Adds support for target reset to SG_SCSI_RESET.
>>
>> Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
>> ---
>>
>>  drivers/scsi/sg.c |    3 +++
>>  include/scsi/sg.h |    1 +
>>  2 files changed, 4 insertions(+)
>>
>> diff -puN drivers/scsi/sg.c~sg_target_reset drivers/scsi/sg.c
>> --- linux-2.6/drivers/scsi/sg.c~sg_target_reset    2008-06-16 
>> 15:34:16.000000000 -0500
>> +++ linux-2.6-bjking1/drivers/scsi/sg.c    2008-06-16 
>> 15:36:48.000000000 -0500
>> @@ -1026,6 +1026,9 @@ sg_ioctl(struct inode *inode, struct fil
>>          case SG_SCSI_RESET_DEVICE:
>>              val = SCSI_TRY_RESET_DEVICE;
>>              break;
>> +        case SG_SCSI_RESET_TARGET:
>> +            val = SCSI_TRY_RESET_TARGET;
>> +            break;
>>          case SG_SCSI_RESET_BUS:
>>              val = SCSI_TRY_RESET_BUS;
>>              break;
>> diff -puN include/scsi/sg.h~sg_target_reset include/scsi/sg.h
>> --- linux-2.6/include/scsi/sg.h~sg_target_reset    2008-06-16 
>> 15:36:05.000000000 -0500
>> +++ linux-2.6-bjking1/include/scsi/sg.h    2008-06-16 
>> 15:36:17.000000000 -0500
>> @@ -206,6 +206,7 @@ typedef struct sg_req_info { /* used by 
>>  #define        SG_SCSI_RESET_DEVICE    1
>>  #define        SG_SCSI_RESET_BUS    2
>>  #define        SG_SCSI_RESET_HOST    3
>> +#define        SG_SCSI_RESET_TARGET    4
>>  
>>  /* synchronous SCSI command ioctl, (only in version 3 interface) */
>>  #define SG_IO 0x2285   /* similar effect as write() followed by 
>> read() */
>> _
>>
> 
> Brian,
> Is SG_SCSI_RESET_DEVICE actually a Logical Unit Reset
> (as defined by SAM-4) on a modern LLD? If so perhaps a

I am working on it so all drivers follow that convention. I converted 
most drivers so they sent a target reset in the target reset handler and 
a lun reset in the device reset handler. Some of the patches for older 
or rare drivers/hardware I could not test did not get merged yet so they 
still do a target reset in the device reset handler. And for some 
drivers like ipr, which would send a lun reset, but could escalate to a 
target reset internally I was not sure what to do.

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

end of thread, other threads:[~2008-07-03 16:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-01 18:03 [PATCH 1/1] sg: Add target reset support Brian King
2008-07-02  1:41 ` Douglas Gilbert
2008-07-03 16:15   ` Mike Christie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).