All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bug 62811] New: Don't Modify the scsi subcmd as LUN value when using VENDOR cmd
@ 2013-10-10 17:22 bugzilla-daemon
  2013-10-10 17:38 ` James Bottomley
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: bugzilla-daemon @ 2013-10-10 17:22 UTC (permalink / raw)
  To: linux-scsi

https://bugzilla.kernel.org/show_bug.cgi?id=62811

            Bug ID: 62811
           Summary: Don't Modify the scsi subcmd as LUN value when using
                    VENDOR cmd
           Product: SCSI Drivers
           Version: 2.5
    Kernel Version: 3.12rc4
          Hardware: All
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Other
          Assignee: scsi_drivers-other@kernel-bugs.osdl.org
          Reporter: yilikernel@gmail.com
        Regression: No

Using the VENDOR scsi cmd, We should not to modify the cmd->cmnd [1] as lun
value. it is useful as a subcmd for USB device, such as STEC usb device.

 Signed-off-by: Yi Li <yilikernel@gmail.com>

--- linux/drivers/scsi/scsi.c_orig 2013-09-12 01:51:45.000000000 -0400
+++ linux/drivers/scsi/scsi.c 2013-09-12 01:59:24.000000000 -0400
@@ -83,6 +83,9 @@ static void scsi_done(struct scsi_cmnd *
 /* Do not call reset on error if we just did a reset within 15 sec. */
 #define MIN_RESET_PERIOD (15*HZ)

+/* Define a SCSI command VENDOR to get device info For STEC USB devcie */
+#define STECUSB_VENDOR_CMD_CODE 0xD8
+
 /*
 * Note - the initial logging level can be set here to log events at boot time.
 * After the system is up, you may enable logging via the /proc interface.
@@ -700,8 +703,13 @@ int scsi_dispatch_cmd(struct scsi_cmnd *
 */
 if (cmd->device->scsi_level <= SCSI_2 &&
 cmd->device->scsi_level != SCSI_UNKNOWN) {
 - cmd->cmnd[1] = (cmd->cmnd[1] & 0x1f) |
- (cmd->device->lun << 5 & 0xe0);
+ /*
+ * Don't Modify the cmnd[1] as LUN value when it is a VENDOR CMD
+ * for STEC disk.
 + */
+ if (STECUSB_VENDOR_CMD_CODE != cmd->cmnd[0])
+ cmd->cmnd[1] = (cmd->cmnd[1] & 0x1f) |
+ (cmd->device->lun << 5 & 0xe0);
 }

 /*

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

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

* Re: [Bug 62811] New: Don't Modify the scsi subcmd as LUN value when using VENDOR cmd
  2013-10-10 17:22 [Bug 62811] New: Don't Modify the scsi subcmd as LUN value when using VENDOR cmd bugzilla-daemon
@ 2013-10-10 17:38 ` James Bottomley
  2013-10-11  5:16   ` yili
  2013-11-13 13:39 ` [Bug 62811] " bugzilla-daemon
  2013-11-13 13:39 ` [Bug 62811] [PATCH]Don't " bugzilla-daemon
  2 siblings, 1 reply; 5+ messages in thread
From: James Bottomley @ 2013-10-10 17:38 UTC (permalink / raw)
  To: bugzilla-daemon; +Cc: linux-scsi

On Thu, 2013-10-10 at 17:22 +0000, bugzilla-daemon@bugzilla.kernel.org
wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=62811
> 
>             Bug ID: 62811
>            Summary: Don't Modify the scsi subcmd as LUN value when using
>                     VENDOR cmd
>            Product: SCSI Drivers
>            Version: 2.5
>     Kernel Version: 3.12rc4
>           Hardware: All
>                 OS: Linux
>               Tree: Mainline
>             Status: NEW
>           Severity: normal
>           Priority: P1
>          Component: Other
>           Assignee: scsi_drivers-other@kernel-bugs.osdl.org
>           Reporter: yilikernel@gmail.com
>         Regression: No
> 
> Using the VENDOR scsi cmd, We should not to modify the cmd->cmnd [1] as lun
> value. it is useful as a subcmd for USB device, such as STEC usb device.
> 
>  Signed-off-by: Yi Li <yilikernel@gmail.com>
> 
> --- linux/drivers/scsi/scsi.c_orig 2013-09-12 01:51:45.000000000 -0400
> +++ linux/drivers/scsi/scsi.c 2013-09-12 01:59:24.000000000 -0400
> @@ -83,6 +83,9 @@ static void scsi_done(struct scsi_cmnd *
>  /* Do not call reset on error if we just did a reset within 15 sec. */
>  #define MIN_RESET_PERIOD (15*HZ)
> 
> +/* Define a SCSI command VENDOR to get device info For STEC USB devcie */
> +#define STECUSB_VENDOR_CMD_CODE 0xD8
> +
>  /*
>  * Note - the initial logging level can be set here to log events at boot time.
>  * After the system is up, you may enable logging via the /proc interface.
> @@ -700,8 +703,13 @@ int scsi_dispatch_cmd(struct scsi_cmnd *
>  */
>  if (cmd->device->scsi_level <= SCSI_2 &&
>  cmd->device->scsi_level != SCSI_UNKNOWN) {
>  - cmd->cmnd[1] = (cmd->cmnd[1] & 0x1f) |
> - (cmd->device->lun << 5 & 0xe0);
> + /*
> + * Don't Modify the cmnd[1] as LUN value when it is a VENDOR CMD
> + * for STEC disk.
>  + */
> + if (STECUSB_VENDOR_CMD_CODE != cmd->cmnd[0])
> + cmd->cmnd[1] = (cmd->cmnd[1] & 0x1f) |
> + (cmd->device->lun << 5 & 0xe0);

This patch is mangled, so it can't be applied (I'm guessing by bugzilla,
so next time just send directly to the SCSI mailing list).

The patch isn't the way we do things: if there's a problem, we usually
add a quirk (either in USB or SCSI) and a flag.

However, looking at what you're trying to do, it seems that your device
is reporting SCSI_2, which mandates in the standard the setting of the
LUN in the first byte of the CDB.  What are these vendor commands you're
trying to send that are out of spec?  Should your device be reporting
compliance with a SCSI level > 2?

James



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

* Re: [Bug 62811] New: Don't Modify the scsi subcmd as LUN value when using VENDOR cmd
  2013-10-10 17:38 ` James Bottomley
@ 2013-10-11  5:16   ` yili
  0 siblings, 0 replies; 5+ messages in thread
From: yili @ 2013-10-11  5:16 UTC (permalink / raw)
  To: linux-scsi

James Bottomley <James.Bottomley <at> HansenPartnership.com> writes:





>>What are these vendor commands you'retrying to send that are out of spec?

---it is STEC Vendor Command code 0xA5

 

 >>>Should your device be reporting compliance with a SCSI level > 2?

---it is a usb flash device, i will try do the test.



Thanks for your advice.










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

* [Bug 62811] Don't Modify the scsi subcmd as LUN value when using VENDOR cmd
  2013-10-10 17:22 [Bug 62811] New: Don't Modify the scsi subcmd as LUN value when using VENDOR cmd bugzilla-daemon
  2013-10-10 17:38 ` James Bottomley
@ 2013-11-13 13:39 ` bugzilla-daemon
  2013-11-13 13:39 ` [Bug 62811] [PATCH]Don't " bugzilla-daemon
  2 siblings, 0 replies; 5+ messages in thread
From: bugzilla-daemon @ 2013-11-13 13:39 UTC (permalink / raw)
  To: linux-scsi

https://bugzilla.kernel.org/show_bug.cgi?id=62811

Alan <alan@lxorguk.ukuu.org.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alan@lxorguk.ukuu.org.uk

--- Comment #1 from Alan <alan@lxorguk.ukuu.org.uk> ---
We do not accept patches via bugzilla. Patches need to be submitted as per
Documentation/SubmittingPatches.

Alan

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

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

* [Bug 62811] [PATCH]Don't Modify the scsi subcmd as LUN value when using VENDOR cmd
  2013-10-10 17:22 [Bug 62811] New: Don't Modify the scsi subcmd as LUN value when using VENDOR cmd bugzilla-daemon
  2013-10-10 17:38 ` James Bottomley
  2013-11-13 13:39 ` [Bug 62811] " bugzilla-daemon
@ 2013-11-13 13:39 ` bugzilla-daemon
  2 siblings, 0 replies; 5+ messages in thread
From: bugzilla-daemon @ 2013-11-13 13:39 UTC (permalink / raw)
  To: linux-scsi

https://bugzilla.kernel.org/show_bug.cgi?id=62811

Alan <alan@lxorguk.ukuu.org.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Don't Modify the scsi       |[PATCH]Don't Modify the
                   |subcmd as LUN value when    |scsi subcmd as LUN value
                   |using VENDOR cmd            |when using VENDOR cmd

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

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

end of thread, other threads:[~2013-11-13 13:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-10 17:22 [Bug 62811] New: Don't Modify the scsi subcmd as LUN value when using VENDOR cmd bugzilla-daemon
2013-10-10 17:38 ` James Bottomley
2013-10-11  5:16   ` yili
2013-11-13 13:39 ` [Bug 62811] " bugzilla-daemon
2013-11-13 13:39 ` [Bug 62811] [PATCH]Don't " bugzilla-daemon

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.