From: Oliver Neukum <oneukum@suse.com>
To: Guido Trentalancia <guido@trentalancia.com>, linux-usb@vger.kernel.org
Subject: Re: JMicron JMS578 USB-to-SATA HDD enclosure not working
Date: Tue, 21 May 2019 14:05:05 +0200 [thread overview]
Message-ID: <1558440305.12672.18.camel@suse.com> (raw)
In-Reply-To: <1558287345.31240.3.camel@trentalancia.com>
[-- Attachment #1: Type: text/plain, Size: 775 bytes --]
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
[-- Attachment #2: 0001-scsi-ignore-a-failure-to-synchronize-cache-due-to-la.patch --]
[-- Type: text/x-patch, Size: 1411 bytes --]
From 499d60018326c7e8b7922b0887cfd9456e765c45 Mon Sep 17 00:00:00 2001
From: Oliver Neukum <oneukum@suse.com>
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@suse.com>
---
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
prev parent reply other threads:[~2019-05-21 12:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-17 19:32 JMicron JMS578 USB-to-SATA HDD enclosure not working Guido Trentalancia
2019-05-18 12:31 ` Guido Trentalancia
2019-05-19 17:35 ` Guido Trentalancia
2019-05-21 12:05 ` Oliver Neukum [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1558440305.12672.18.camel@suse.com \
--to=oneukum@suse.com \
--cc=guido@trentalancia.com \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).