On Thu, Sep 21, 2017 at 9:25 AM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote: > 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; > This worked without issue. Below is the dmesg output: [ 117.051572] usb 2-1.3: new high-speed USB device number 3 using ehci-pci [ 117.187951] usb 2-1.3: New USB device found, idVendor=0bc2, idProduct=3332 [ 117.187954] usb 2-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 117.187956] usb 2-1.3: Product: External [ 117.187958] usb 2-1.3: Manufacturer: Seagate [ 117.187959] usb 2-1.3: SerialNumber: 2GHP5NM9 [ 117.300041] usb-storage 2-1.3:1.0: USB Mass Storage device detected [ 117.300198] usb-storage 2-1.3:1.0: Quirks match for vid 0bc2 pid 3332: 200 [ 117.300238] scsi host6: usb-storage 2-1.3:1.0 [ 117.300323] usbcore: registered new interface driver usb-storage [ 117.323440] usbcore: registered new interface driver uas [ 118.328943] scsi 6:0:0:0: Direct-Access Seagate External SG12 PQ: 0 ANSI: 4 [ 118.330154] sd 6:0:0:0: Attached scsi generic sg2 type 0 [ 118.330595] sd 6:0:0:0: [sdb] 3907029164 512-byte logical blocks: (2.00 TB/1.82 TiB) [ 118.330599] sd 6:0:0:0: [sdb] Assuming Write Enabled [ 118.330603] sd 6:0:0:0: [sdb] Assuming drive cache: write through [ 118.399609] sdb: sdb1 [ 118.400996] sd 6:0:0:0: [sdb] Attached SCSI disk [ 119.093551] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null) -- 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