Re: Yet another Seagate quirk for unusual_uas.h

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

 



On Wed, 20 Sep 2017, Kris Lindgren wrote:

> On Wed, Sep 20, 2017 at 3:00 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> > On Wed, 20 Sep 2017, Kris Lindgren wrote:
> >
> >> Hi Alan,
> >>
> >> Sorry for the delay.  This did indeed solve the problem.  I rebuilt
> >> the kernel with that patch applied and without any special quirks
> >> loaded against the usb_storage driver, the drive mounts without issue.
> >>
> >> dmesg output:
> >> [ 1343.583254] usb 2-1.3: new high-speed USB device number 3 using ehci-pci
> >
> > ehci-pci means that you plugged the drive into a USB-2 port.  But
> > earlier you wrote:
> >
> >         I have a Seagate External HDD PN: 9sean2-500 that works fine on USB2.0
> >         ports (and older kernels) however when connected to usb3.0 port on
> >         newer kernels, the drive fails any write access.
> >
> > So this wasn't a real test, was it?  You would have expected the drive
> > to work okay even without the patch.
> >
> > Can you do the same test on a USB-3 port?
> >
> 
> So as it turns out that  should really have said: "Works on older
> kernels (3.x and lower)". As it turns out usb2.0 vs usb3.0 didn't
> mater.  Outside of the qnap device I don't actually have a machine
> that has a usb 3.0 port, that's running linux.
> I was taking a working laptop with Ubuntu on it and testing with newer
> kernels (as I moved up in Ubuntu versions (from 12.04 -> 17.04) ).
> The drive stopped working around the 4.x kernel series, with the same
> error that I got on the qnap device.  It use to work on older Ubuntu
> 3.x kernels.  Under all 4.x kernels that I tested, both USB2.0 and
> USB3.0 it needed the w quirk in order to work correctly.

Okay, I will submit the patch.

> >> hostbyte=DID_ERROR driverbyte=DRIVER_SENSE
> >> [ 1345.069159] sd 6:0:0:0: [sdb] tag#0 Sense Key : Hardware Error
> >> [current] [descriptor]
> >> [ 1345.069162] sd 6:0:0:0: [sdb] tag#0 Add. Sense: No additional sense
> >> information
> >> [ 1345.069168] sd 6:0:0:0: [sdb] tag#0 CDB: ATA command pass
> >> through(16) 85 06 20 00 00 00 00 00 00 00 00 00 00 00 e5 00
> >> [ 1345.172252] sd 6:0:0:0: [sdb] tag#0 FAILED Result:
> >> hostbyte=DID_ERROR driverbyte=DRIVER_SENSE
> >> [ 1345.172258] sd 6:0:0:0: [sdb] tag#0 Sense Key : Hardware Error
> >> [current] [descriptor]
> >> [ 1345.172261] sd 6:0:0:0: [sdb] tag#0 Add. Sense: No additional sense
> >> information
> >> [ 1345.172266] sd 6:0:0:0: [sdb] tag#0 CDB: ATA command pass
> >> through(12)/Blank a1 06 20 da 00 00 4f c2 00 b0 00 00
> >
> > Those Hardware Error messages are annoying, aren't they?  Other people
> > have complained about them in the past.  Would you mind testing a patch
> > that should eliminate them?
> >
> > Alan Stern
> 
> Yes, I can test another patch to fix those messages as well.

Here it is.  Thanks for testing it.

Alan Stern



Index: usb-4.x/drivers/usb/storage/transport.c
===================================================================
--- usb-4.x.orig/drivers/usb/storage/transport.c
+++ usb-4.x/drivers/usb/storage/transport.c
@@ -834,13 +834,25 @@ Retry_Sense:
 			if (result == USB_STOR_TRANSPORT_GOOD) {
 				srb->result = SAM_STAT_GOOD;
 				srb->sense_buffer[0] = 0x0;
+			}
+
+			/*
+			 * ATA-passthru commands use sense data to report
+			 * the command completion status, and often devices
+			 * return Check Condition status when nothing is
+			 * wrong.
+			 */
+			else if (srb->cmnd[0] == ATA_16 ||
+					srb->cmnd[0] == ATA_12) {
+				/* leave the data alone */
+			}
 
 			/*
 			 * If there was a problem, report an unspecified
 			 * hardware error to prevent the higher layers from
 			 * entering an infinite retry loop.
 			 */
-			} else {
+			else {
 				srb->result = DID_ERROR << 16;
 				if ((sshdr.response_code & 0x72) == 0x72)
 					srb->sense_buffer[1] = HARDWARE_ERROR;

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



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

  Powered by Linux