Re: JMicron JMS578 USB-to-SATA HDD enclosure not working

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On So, 2019-05-19 at 19:35 +0200, Guido Trentalancia wrote:
> Thanks to the new firmware and its more meaningful Sense Key, I finally
> realized that the hard-drive was simply "locked" as in the BIOS Hard-
> Disk Password Lock feature.
> 
> Therefore this is not a bug, the UAS driver is working fine with the
> HDD enclosure and the issue was simply a matter of unlocking the drive
> in the BIOS before connecting it to the JMicron JMS578 enclosure.

Hi,

this is an unusual report. It leaves a question open. We need to know
what this error will do during operation of the system. It makes me
wonder about power management operations.

Could you test S3 or S4 with your drive in the locked state?
If there is an error, could you test the attached patch?

	Regards
		Oliver
From 499d60018326c7e8b7922b0887cfd9456e765c45 Mon Sep 17 00:00:00 2001
From: Oliver Neukum <oneukum@xxxxxxxx>
Date: Tue, 21 May 2019 13:49:34 +0200
Subject: [PATCH] scsi: ignore a failure to synchronize cache due to lack of
 authorization

I've got a report about a UAS drive enclosure reporting back
Sense: Logical unit access not authorized
if the drive it holds is password protected. While the drive
is obviously unusable in that state as a mass storage device,
it still exists as a sd device and when the system is asked
to perform a suspend of the drive, it will be sent a
SYNCHRONIZE CACHE. If that fails due to password protection,
the error must be ignored.

Signed-off-by: Oliver Neukum <oneukum@xxxxxxxx>
---
 drivers/scsi/sd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index ebc80354714c..2a9a60393f50 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1653,7 +1653,8 @@ static int sd_sync_cache(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr)
 		/* we need to evaluate the error return  */
 		if (scsi_sense_valid(sshdr) &&
 			(sshdr->asc == 0x3a ||	/* medium not present */
-			 sshdr->asc == 0x20))	/* invalid command */
+			 sshdr->asc == 0x20 ||	/* invalid command */
+			 (sshdr->asc == 0x74 && sshdr->ascq == 0x71)))	/* drive is password locked */ 
 				/* this is no error here */
 				return 0;
 
-- 
2.16.4


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux