]> www.infradead.org Git - users/hch/misc.git/commitdiff
usb: gadget: f_tcm: Translate error to sense
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Wed, 11 Dec 2024 00:31:43 +0000 (00:31 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Dec 2024 07:56:05 +0000 (08:56 +0100)
When respond with check_condition error status, clear from_transport
input so the target layer can translate the sense reason reported by
f_tcm.

Fixes: c52661d60f63 ("usb-gadget: Initial merge of target module for UASP + BOT")
Cc: stable@vger.kernel.org
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/b2a5577efe7abd0af0051229622cf7d3be5cdcd0.1733876548.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/f_tcm.c

index 6313302a5b96495e7c8d2af9c4382e89f2de276e..88b8b94fdb1e9754cd94309a8c1858635bdae7c5 100644 (file)
@@ -1061,7 +1061,7 @@ static void usbg_cmd_work(struct work_struct *work)
 
 out:
        transport_send_check_condition_and_sense(se_cmd,
-                       TCM_UNSUPPORTED_SCSI_OPCODE, 1);
+                       TCM_UNSUPPORTED_SCSI_OPCODE, 0);
 }
 
 static struct usbg_cmd *usbg_get_cmd(struct f_uas *fu,
@@ -1189,7 +1189,7 @@ static void bot_cmd_work(struct work_struct *work)
 
 out:
        transport_send_check_condition_and_sense(se_cmd,
-                               TCM_UNSUPPORTED_SCSI_OPCODE, 1);
+                               TCM_UNSUPPORTED_SCSI_OPCODE, 0);
 }
 
 static int bot_submit_command(struct f_uas *fu,