Discussion:
[PATCH v3] SG_SCSI_RESET ioctl: add no_escalate values
Douglas Gilbert
2014-10-18 20:11:21 UTC
Permalink
Further to a January 2013 thread titled: "[PATCH] SG_SCSI_RESET ioctl
should only perform requested operation" by Jeremy Linton a patch (v3)
is presented that expands the existing ioctl to include "no_escalate"
versions to the existing resets. This requires no changes to SCSI low
level drivers (LLDs); it adds several more finely tuned reset options
to the user space. For example:

/* This call remains the same, with the same escalating semantics
* if the device (LU) reset fail. That is: on failure to try a
* target reset and if that fails, try a bus reset, and if that fails
* try a host (i.e. LLD) reset. */
val = SG_SCSI_RESET_DEVICE;
res = ioctl(<sg_or_block_fd>, SG_SCSI_RESET, &val);

/* What follows is a new option introduced by this patch series. Only
* a device reset is attempted. If that fails then an appropriate
* error code is provided. N.B. There is no reset escalation. */
val = SG_SCSI_RESET_DEVICE | SG_SCSI_RESET_NO_ESCALATE;
res = ioctl(<sg_or_block_fd>, SG_SCSI_RESET, &val);

This patches applies to lk 3.17.0 and Christoph's drivers-for-3.18
tree. The sg_reset utility has been extended to use this new option
since sg3_utils-1.36 package which was released on 20130531.

v3 of this patch changes adding, subtracting and arithmetic
comparisons to the corresponding bitwise logical operations.
For example 'SG_SCSI_RESET_DEVICE + SG_SCSI_RESET_NO_ESCALATE' has
been changed to 'SG_SCSI_RESET_DEVICE | SG_SCSI_RESET_NO_ESCALATE'.

ChangeLog:
- modify SG_SCSI_RESET ioctl so the SG_SCSI_RESET_NO_ESCALATE
value may be OR-ed to the existing values. If so the existing
device->target->bus->host escalation does not occur. The
SG_SCSI_RESET ioctl is modified in both the sg driver and
scsi_ioctl.c (so block devices can use it).
- modify scsi_reset_provider() in the scsi_error.c file in a
similar way to support this additional functionality.

Signed-off-by: Douglas Gilbert <***@interlog.com>
Hannes Reinecke
2014-10-20 11:30:37 UTC
Permalink
Post by Douglas Gilbert
Further to a January 2013 thread titled: "[PATCH] SG_SCSI_RESET ioctl
should only perform requested operation" by Jeremy Linton a patch (v3=
)
Post by Douglas Gilbert
is presented that expands the existing ioctl to include "no_escalate"
versions to the existing resets. This requires no changes to SCSI low
level drivers (LLDs); it adds several more finely tuned reset options
=20
/* This call remains the same, with the same escalating semantics
* if the device (LU) reset fail. That is: on failure to try a
* target reset and if that fails, try a bus reset, and if that fai=
ls
Post by Douglas Gilbert
* try a host (i.e. LLD) reset. */
val =3D SG_SCSI_RESET_DEVICE;
res =3D ioctl(<sg_or_block_fd>, SG_SCSI_RESET, &val);
=20
/* What follows is a new option introduced by this patch series. On=
ly
Post by Douglas Gilbert
* a device reset is attempted. If that fails then an appropriate
* error code is provided. N.B. There is no reset escalation. */
val =3D SG_SCSI_RESET_DEVICE | SG_SCSI_RESET_NO_ESCALATE;
res =3D ioctl(<sg_or_block_fd>, SG_SCSI_RESET, &val);
=20
This patches applies to lk 3.17.0 and Christoph's drivers-for-3.18
tree. The sg_reset utility has been extended to use this new option
since sg3_utils-1.36 package which was released on 20130531.
=20
v3 of this patch changes adding, subtracting and arithmetic
comparisons to the corresponding bitwise logical operations.
For example 'SG_SCSI_RESET_DEVICE + SG_SCSI_RESET_NO_ESCALATE' has
been changed to 'SG_SCSI_RESET_DEVICE | SG_SCSI_RESET_NO_ESCALATE'.
=20
- modify SG_SCSI_RESET ioctl so the SG_SCSI_RESET_NO_ESCALATE
value may be OR-ed to the existing values. If so the existing
device->target->bus->host escalation does not occur. The
SG_SCSI_RESET ioctl is modified in both the sg driver and
scsi_ioctl.c (so block devices can use it).
- modify scsi_reset_provider() in the scsi_error.c file in a
similar way to support this additional functionality.
=20
Reviewed-by: Hannes Reinecke <***@suse.de>

Cheers,

Hannes
--=20
Dr. Hannes Reinecke zSeries & Storage
***@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg
GF: J. Hawn, J. Guild, F. Imend=C3=B6rffer, HRB 16746 (AG N=C3=BCrnberg=
)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" i=
n
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Jeremy Linton
2014-10-20 18:15:39 UTC
Permalink
Reviewed-by: Jeremy Linton <***@tributary.com>

I will test it (next week or so) when I have access to a configuration that can
test it in a meaningful way.

Thanks,









--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Christoph Hellwig
2014-10-23 17:12:00 UTC
Permalink
Thanks,

applied to the core-for-3.19 branch.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Loading...