mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scsi: clear UAC before sending SG_IO
@ 2020-09-10 10:15 Randall Huang
  2020-09-10 14:36 ` kernel test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Randall Huang @ 2020-09-10 10:15 UTC (permalink / raw)
  To: dgilbert, jejb, martin.petersen, linux-scsi, linux-kernel; +Cc: huangrandall

Make sure UAC is clear before sending SG_IO.

Signed-off-by: Randall Huang <huangrandall@google.com>
---
 drivers/scsi/sg.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 20472aaaf630..ad11bca47ae8 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -922,6 +922,7 @@ sg_ioctl_common(struct file *filp, Sg_device *sdp, Sg_fd *sfp,
 	int result, val, read_only;
 	Sg_request *srp;
 	unsigned long iflags;
+	int _cmd;
 
 	SCSI_LOG_TIMEOUT(3, sg_printk(KERN_INFO, sdp,
 				   "sg_ioctl: cmd=0x%x\n", (int) cmd_in));
@@ -933,6 +934,13 @@ sg_ioctl_common(struct file *filp, Sg_device *sdp, Sg_fd *sfp,
 			return -ENODEV;
 		if (!scsi_block_when_processing_errors(sdp->device))
 			return -ENXIO;
+
+		_cmd = SCSI_UFS_REQUEST_SENSE;
+		if (sdp->device->host->wlun_clr_uac) {
+			sdp->device->host->hostt->ioctl(sdp->device, _cmd, NULL);
+			sdp->device->host->wlun_clr_uac = false;
+		}
+
 		result = sg_new_write(sfp, filp, p, SZ_SG_IO_HDR,
 				 1, read_only, 1, &srp);
 		if (result < 0)

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

end of thread, other threads:[~2020-09-10 21:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-10 10:15 [PATCH] scsi: clear UAC before sending SG_IO Randall Huang
2020-09-10 14:36 ` kernel test robot
2020-09-10 16:36 ` kernel test robot
2020-09-10 17:43 ` Douglas Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®