Yet another Seagate quirk for unusual_uas.h

2017-09-16 Thread Kris Lindgren
oc_name[usb-storage].
[88184.400153] Check proc_name[usb-storage].
[88184.404274] Check proc_name[usb-storage].
[88184.408454] sd 8:0:0:0: Attached scsi generic sg2 type 0
[88184.415358] sd 8:0:0:0: [sdc] 3907029164 512-byte logical blocks:
(2.00 TB/1.81 TiB)
[88184.423138] sd 8:0:0:0: [sdc] Assuming Write Enabled
[88184.428183] sd 8:0:0:0: [sdc] Assuming drive cache: write through
[88184.434391] Check proc_name[usb-storage].
[88184.501083]  sdc: sdc1
[88184.505346] sd 8:0:0:0: [sdc] Attached SCSI disk
[88184.510108] Check proc_name[usb-storage].
[88185.285582] ufsd: "mount" (sdc1): is mounted as NTFS at 2017-09-16 09:22:29
[88187.705544] flashcache flashcache_ioctl 21297
[88187.713636] flashcache flashcache_ioctl 21297
[88265.766096] flashcache flashcache_ioctl 21297
[88265.771943] flashcache flashcache_ioctl 21297
[88270.738679] ufsd: "umount" (sdc1): is unmounted at 2017-09-16 09:23:54
[88272.804359] flashcache flashcache_ioctl 21297
[88272.809101] flashcache flashcache_ioctl 21297
[88280.727432] ext4_init_reserve_inode_table0: sdc1, 0
[88280.732722] ext4_init_reserve_inode_table2: sdc1, 14905, 14905, 1907839, 4096
[88280.742043] EXT4-fs (sdc1): mounted filesystem with ordered data
mode. Opts: 
usrjquota=aquota.user,jqfmt=vfsv0,user_xattr,data=ordered,delalloc,noacl
[88281.726223] EXT4-fs (device sdc1): ext4lazyinit start (start from
0, total 14905)
[88282.800045] flashcache flashcache_ioctl 21297
[88282.804821] flashcache flashcache_ioctl 21297
[88287.456613] flashcache flashcache_ioctl 21297
[88287.461512] flashcache flashcache_ioctl 21297
[88360.898993] EXT4-fs (device sdc1): ext4lazyinit finish

I am currently sustaining 100+ MB/s writes to the drive with those
quirks flags added without any other changes.

I looked at drivers/usb/storage/unusual_uas.h for my kernel (4.2.8)
and the latest master.  It does not appear that this device is
specifically called out as having an unusual uas, other very close
Seagate drives do appear in that list.  What do you need from me to
get this added?

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


Re: Yet another Seagate quirk for unusual_uas.h

2017-09-17 Thread Kris Lindgren
On Sun, Sep 17, 2017 at 3:41 PM, Alan Stern  wrote:
> Please use Reply-To-All so that your message gets sent to the mailing
> and not just to me.
>
> Also, please don't top-post.
>
> On Sun, 17 Sep 2017, Kris Lindgren wrote:
>
>> Sorry, Let me be more specific and answer your questions.
>>
>> Without any changes, I plugin the drive, it will fail with sector 0
>> errors on any action that attempts to write against it.  Such as
>> formating the volume, creating a folder, touching a file, ect ect.
>> Unloading usb_storage and reloading it with:
>> quirks=0bc2:3332:uw causes the drive to function without any issues.
>> Trying just quirks=0bc2:3332:u or quirks=0bc2:3332:t (as some other
>> people reported for other seagate explansions drives) still cause
>> sector 0 errors to show up.
>
> What happens with quirks=0bc2:3332:w (leave out the u)?
> And can you provide the output from lsusb -v for this device?

The drive actually mounts and works fine.  I was able to write 10GB to
it successfully at an average speed of ~133.9MB/s.

# lsusb -v

Bus 002 Device 011: ID 0bc2:3332 Seagate RSS LLC
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   3.00
  bDeviceClass0 (Defined at Interface level)
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize0 9
  idVendor   0x0bc2 Seagate RSS LLC
  idProduct  0x3332
  bcdDevice0.12
  iManufacturer   1 Seagate
  iProduct2 External
  iSerial 3 2GHP5NM9
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength   44
bNumInterfaces  1
bConfigurationValue 1
iConfiguration  0
bmAttributes 0xc0
  Self Powered
MaxPower   24mA
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   2
  bInterfaceClass 8 Mass Storage
  bInterfaceSubClass  6 SCSI
  bInterfaceProtocol 80 Bulk (Zip)
  iInterface  0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81  EP 1 IN
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0400  1x 0 bytes
bInterval   0
UNRECOGNIZED:  06 30 0f 00 00 00
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02  EP 2 OUT
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0400  1x 0 bytes
bInterval   0
UNRECOGNIZED:  06 30 0f 00 00 00
Device Status: 0x000d
  Self Powered
  Test Mode

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   3.00
  bDeviceClass9 Hub
  bDeviceSubClass 0 Unused
  bDeviceProtocol 3
  bMaxPacketSize0 9
  idVendor   0x1d6b Linux Foundation
  idProduct  0x0003 3.0 root hub
  bcdDevice4.02
  iManufacturer   3 Linux 4.2.8 xhci-hcd
  iProduct2 xHCI Host Controller
  iSerial 1 :00:14.0
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength   31
bNumInterfaces  1
bConfigurationValue 1
iConfiguration  0
bmAttributes 0xe0
  Self Powered
  Remote Wakeup
MaxPower0mA
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   1
  bInterfaceClass 9 Hub
  bInterfaceSubClass  0 Unused
  bInterfaceProtocol  0 Full speed (or root) hub
  iInterface  0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81  EP 1 IN
bmAttributes3
  Transfer TypeInterrupt
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0004  1x 4 bytes
bInterval  12
UNRECOGNIZED:  06 30 00 00 02 00
can't get hub descriptor: Broken pipe
Device Status: 0x0001
  Self Powered

Bus 001 Device 002: ID 1005:b155 Apacer Technology, Inc.
Device Descriptor

Re: Yet another Seagate quirk for unusual_uas.h

2017-09-18 Thread Kris Lindgren
On Sun, Sep 17, 2017 at 7:02 PM, Kris Lindgren  wrote:
> On Sun, Sep 17, 2017 at 3:41 PM, Alan Stern  wrote:
>> Please use Reply-To-All so that your message gets sent to the mailing
>> and not just to me.
>>
>> Also, please don't top-post.
>>
>> On Sun, 17 Sep 2017, Kris Lindgren wrote:
>>
>>> Sorry, Let me be more specific and answer your questions.
>>>
>>> Without any changes, I plugin the drive, it will fail with sector 0
>>> errors on any action that attempts to write against it.  Such as
>>> formating the volume, creating a folder, touching a file, ect ect.
>>> Unloading usb_storage and reloading it with:
>>> quirks=0bc2:3332:uw causes the drive to function without any issues.
>>> Trying just quirks=0bc2:3332:u or quirks=0bc2:3332:t (as some other
>>> people reported for other seagate explansions drives) still cause
>>> sector 0 errors to show up.
>>
>> What happens with quirks=0bc2:3332:w (leave out the u)?
>> And can you provide the output from lsusb -v for this device?
>
> The drive actually mounts and works fine.  I was able to write 10GB to
> it successfully at an average speed of ~133.9MB/s.
>
> # lsusb -v
>
> Bus 002 Device 011: ID 0bc2:3332 Seagate RSS LLC
> Device Descriptor:
>   bLength18
>   bDescriptorType 1
>   bcdUSB   3.00
>   bDeviceClass0 (Defined at Interface level)
>   bDeviceSubClass 0
>   bDeviceProtocol 0
>   bMaxPacketSize0 9
>   idVendor   0x0bc2 Seagate RSS LLC
>   idProduct  0x3332
>   bcdDevice0.12
>   iManufacturer   1 Seagate
>   iProduct2 External
>   iSerial 3 2GHP5NM9
>   bNumConfigurations  1
>   Configuration Descriptor:
> bLength 9
> bDescriptorType 2
> wTotalLength   44
> bNumInterfaces  1
> bConfigurationValue 1
> iConfiguration  0
> bmAttributes 0xc0
>   Self Powered
> MaxPower   24mA
> Interface Descriptor:
>   bLength 9
>   bDescriptorType 4
>   bInterfaceNumber0
>   bAlternateSetting   0
>   bNumEndpoints   2
>   bInterfaceClass 8 Mass Storage
>   bInterfaceSubClass  6 SCSI
>   bInterfaceProtocol 80 Bulk (Zip)
>   iInterface  0
>   Endpoint Descriptor:
> bLength 7
> bDescriptorType 5
> bEndpointAddress 0x81  EP 1 IN
> bmAttributes2
>   Transfer TypeBulk
>   Synch Type   None
>   Usage Type   Data
> wMaxPacketSize 0x0400  1x 0 bytes
> bInterval   0
> UNRECOGNIZED:  06 30 0f 00 00 00
>   Endpoint Descriptor:
> bLength 7
> bDescriptorType 5
> bEndpointAddress 0x02  EP 2 OUT
> bmAttributes2
>   Transfer TypeBulk
>   Synch Type   None
>   Usage Type   Data
> wMaxPacketSize 0x0400  1x 0 bytes
> bInterval   0
> UNRECOGNIZED:  06 30 0f 00 00 00
> Device Status: 0x000d
>   Self Powered
>   Test Mode
>
> Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
> Device Descriptor:
>   bLength18
>   bDescriptorType 1
>   bcdUSB   3.00
>   bDeviceClass9 Hub
>   bDeviceSubClass 0 Unused
>   bDeviceProtocol 3
>   bMaxPacketSize0 9
>   idVendor   0x1d6b Linux Foundation
>   idProduct  0x0003 3.0 root hub
>   bcdDevice4.02
>   iManufacturer   3 Linux 4.2.8 xhci-hcd
>   iProduct2 xHCI Host Controller
>   iSerial 1 :00:14.0
>   bNumConfigurations  1
>   Configuration Descriptor:
> bLength 9
> bDescriptorType 2
> wTotalLength   31
> bNumInterfaces  1
> bConfigurationValue 1
> iConfiguration  0
> bmAttributes 0xe0
>   Self Powered
>   Remote Wakeup
> MaxPower0mA
> Interface Descriptor:
>   bLength 9
>   bDescriptorType 4
>   bInterfaceNumber0
>   bAlternateSetting   0
>   bNumEndpoints   1
>   bInterfaceClass 9 Hub
>   bInterfaceSubClass  0 Unused
>  

Re: Yet another Seagate quirk for unusual_uas.h

2017-09-18 Thread Kris Lindgren
On Mon, Sep 18, 2017 at 11:05 AM, Alan Stern  wrote:
> On Mon, 18 Sep 2017, Kris Lindgren wrote:
>
>> >> What happens if you plug the disk drive into a regular Linux desktop
>> >> computer?  Remember, if an unusual_uas.h entry is added, it will affect
>> >> those machines too.
>> >
>> > I will need to get back to you on this.  All of my other machines
>> > running linux, only have usb2.0 hubs.  They are also haven't been used
>> > in some time and are running older versions of Ubuntu.
>>
>> I upgraded a machine to the latest Ubuntu LTS distro - which is using
>> the 4.4 kernel
>>
>> When plugging in the drive without any modification, the drive fails to 
>> mount.
>> Dmesg output:
>> [  378.353553] usb 2-1.3: new high-speed USB device number 3 using ehci-pci
>> [  378.489981] usb 2-1.3: New USB device found, idVendor=0bc2, idProduct=3332
>> [  378.489985] usb 2-1.3: New USB device strings: Mfr=1, Product=2,
>> SerialNumber=3
>> [  378.489987] usb 2-1.3: Product: External
>> [  378.489989] usb 2-1.3: Manufacturer: Seagate
>> [  378.489990] usb 2-1.3: SerialNumber: 2GHP5NM9
>> [  378.650153] usb-storage 2-1.3:1.0: USB Mass Storage device detected
>> [  378.650267] scsi host6: usb-storage 2-1.3:1.0
>> [  378.650359] usbcore: registered new interface driver usb-storage
>> [  378.684653] usbcore: registered new interface driver uas
>> [  379.651163] scsi 6:0:0:0: Direct-Access Seagate  External
>>   SG12 PQ: 0 ANSI: 4
>> [  379.651892] sd 6:0:0:0: Attached scsi generic sg2 type 0
>> [  379.652324] sd 6:0:0:0: [sdb] 3907029164 512-byte logical blocks:
>> (2.00 TB/1.82 TiB)
>> [  379.653077] sd 6:0:0:0: [sdb] Write Protect is off
>> [  379.653081] sd 6:0:0:0: [sdb] Mode Sense: 1c 00 00 00
>> [  379.654529] sd 6:0:0:0: [sdb] Write cache: enabled, read cache:
>> enabled, doesn't support DPO or FUA
>> [  379.723781]  sdb: sdb1
>> [  379.726584] sd 6:0:0:0: [sdb] Attached SCSI disk
>> [  379.907727] sd 6:0:0:0: [sdb] tag#0 FAILED Result:
>> hostbyte=DID_ERROR driverbyte=DRIVER_SENSE
>> [  379.907737] sd 6:0:0:0: [sdb] tag#0 Sense Key : Hardware Error
>> [current] [descriptor]
>> [  379.907741] sd 6:0:0:0: [sdb] tag#0 Add. Sense: No additional sense
>> information
>> [  379.907747] 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
>> [  380.008600] sd 6:0:0:0: [sdb] tag#0 FAILED Result:
>> hostbyte=DID_ERROR driverbyte=DRIVER_SENSE
>> [  380.008608] sd 6:0:0:0: [sdb] tag#0 Sense Key : Hardware Error
>> [current] [descriptor]
>> [  380.008611] sd 6:0:0:0: [sdb] tag#0 Add. Sense: No additional sense
>> information
>> [  380.008616] 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
>> [  380.426654] sd 6:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK
>> driverbyte=DRIVER_SENSE
>> [  380.426662] sd 6:0:0:0: [sdb] tag#0 Sense Key : Illegal Request [current]
>> [  380.42] sd 6:0:0:0: [sdb] tag#0 Add. Sense: Invalid field in cdb
>> [  380.426670] sd 6:0:0:0: [sdb] tag#0 CDB: Synchronize Cache(10) 35
>> 00 00 00 00 00 00 00 00 00
>> [  380.426677] blk_update_request: critical target error, dev sdb, sector 0
>> [  380.426692] JBD2: recovery failed
>> [  380.426698] EXT4-fs (sdb1): error loading journal
>>
>> kernel version is:  4.4.0-93-generic
>
> And if you use the w quirk flag?

So I upgrade to 17.04 which is using the 4.10 kernel.

Without any modification the filesystem fails to mount.

Unloading the usb_storage module and reloading it with
quirks=0bc2:3332:w allows the drive to be succesfully mounted and used
without any errors.

[  168.613814] usb 2-1.3: new high-speed USB device number 3 using ehci-pci
[  168.746541] usb 2-1.3: New USB device found, idVendor=0bc2, idProduct=3332
[  168.746544] usb 2-1.3: New USB device strings: Mfr=1, Product=2,
SerialNumber=3
[  168.746546] usb 2-1.3: Product: External
[  168.746548] usb 2-1.3: Manufacturer: Seagate
[  168.746550] usb 2-1.3: SerialNumber: 2GHP5NM9
[  168.847161] usb-storage 2-1.3:1.0: USB Mass Storage device detected
[  168.847367] usb-storage 2-1.3:1.0: Quirks match for vid 0bc2 pid 3332: 200
[  168.847429] scsi host6: usb-storage 2-1.3:1.0
[  168.847575] usbcore: registered new interface driver usb-storage
[  168.876249] usbcore: registered new interface driver uas
[  169.859397] scsi 6:0:0:0: Direct-Access Seagate  External
  SG12 PQ: 0 ANSI: 4
[  169.860378] sd 6:0:0:0: Attached scsi generic sg2 type 0
[  169.860932] sd 6:0:0:0: [sdb] 3907029164 512-byte logical blocks:
(2.00 TB/1.82 TiB)
[  169.860937] sd 6:0:0

Re: Yet another Seagate quirk for unusual_uas.h

2017-09-20 Thread Kris Lindgren
On Mon, Sep 18, 2017 at 1:14 PM, Alan Stern  wrote:
> On Mon, 18 Sep 2017, Kris Lindgren wrote:
>
>> So I upgrade to 17.04 which is using the 4.10 kernel.
>>
>> Without any modification the filesystem fails to mount.
>>
>> Unloading the usb_storage module and reloading it with
>> quirks=0bc2:3332:w allows the drive to be succesfully mounted and used
>> without any errors.
>
> Okay, so it looks like what you need is the patch below.  Let me know
> if it fixes the problem.
>
> Alan Stern
>
>
>
> Index: usb-4.x/drivers/usb/storage/unusual_devs.h
> ===
> --- usb-4.x.orig/drivers/usb/storage/unusual_devs.h
> +++ usb-4.x/drivers/usb/storage/unusual_devs.h
> @@ -1459,6 +1459,13 @@ UNUSUAL_DEV( 0x0bc2, 0x3010, 0x, 0x0
> USB_SC_DEVICE, USB_PR_DEVICE, NULL,
> US_FL_SANE_SENSE ),
>
> +/* Reported by Kris Lindgren  */
> +UNUSUAL_DEV( 0x0bc2, 0x3332, 0x, 0x,
> +   "Seagate",
> +   "External",
> +   USB_SC_DEVICE, USB_PR_DEVICE, NULL,
> +   US_FL_NO_WP_DETECT ),
> +
>  UNUSUAL_DEV(  0x0d49, 0x7310, 0x, 0x,
> "Maxtor",
> "USB to SATA",
>

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
[ 1343.719969] usb 2-1.3: New USB device found, idVendor=0bc2, idProduct=3332
[ 1343.719973] usb 2-1.3: New USB device strings: Mfr=1, Product=2,
SerialNumber=3
[ 1343.719976] usb 2-1.3: Product: External
[ 1343.719978] usb 2-1.3: Manufacturer: Seagate
[ 1343.719981] usb 2-1.3: SerialNumber: 2GHP5NM9
[ 1343.810149] usb-storage 2-1.3:1.0: USB Mass Storage device detected
[ 1343.810580] usb-storage 2-1.3:1.0: Quirks match for vid 0bc2 pid 3332: 200
[ 1343.810606] scsi host6: usb-storage 2-1.3:1.0
[ 1343.810722] usbcore: registered new interface driver usb-storage
[ 1343.828047] usbcore: registered new interface driver uas
[ 1344.812932] scsi 6:0:0:0: Direct-Access Seagate  External
  SG12 PQ: 0 ANSI: 4
[ 1344.813636] sd 6:0:0:0: Attached scsi generic sg2 type 0
[ 1344.814123] sd 6:0:0:0: [sdb] 3907029164 512-byte logical blocks:
(2.00 TB/1.82 TiB)
[ 1344.814127] sd 6:0:0:0: [sdb] Assuming Write Enabled
[ 1344.814130] sd 6:0:0:0: [sdb] Assuming drive cache: write through
[ 1344.878679]  sdb: sdb1
[ 1344.880193] sd 6:0:0:0: [sdb] Attached SCSI disk
[ 1345.069152] sd 6:0:0:0: [sdb] tag#0 FAILED Result:
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
[ 1345.581679] 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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Yet another Seagate quirk for unusual_uas.h

2017-09-20 Thread Kris Lindgren
On Wed, Sep 20, 2017 at 3:00 PM, Alan Stern  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.
>
>> [ 1343.719969] usb 2-1.3: New USB device found, idVendor=0bc2, idProduct=3332
>> [ 1343.719973] usb 2-1.3: New USB device strings: Mfr=1, Product=2,
>> SerialNumber=3
>> [ 1343.719976] usb 2-1.3: Product: External
>> [ 1343.719978] usb 2-1.3: Manufacturer: Seagate
>> [ 1343.719981] usb 2-1.3: SerialNumber: 2GHP5NM9
>> [ 1343.810149] usb-storage 2-1.3:1.0: USB Mass Storage device detected
>> [ 1343.810580] usb-storage 2-1.3:1.0: Quirks match for vid 0bc2 pid 3332: 200
>> [ 1343.810606] scsi host6: usb-storage 2-1.3:1.0
>> [ 1343.810722] usbcore: registered new interface driver usb-storage
>> [ 1343.828047] usbcore: registered new interface driver uas
>> [ 1344.812932] scsi 6:0:0:0: Direct-Access Seagate  External
>>   SG12 PQ: 0 ANSI: 4
>> [ 1344.813636] sd 6:0:0:0: Attached scsi generic sg2 type 0
>> [ 1344.814123] sd 6:0:0:0: [sdb] 3907029164 512-byte logical blocks:
>> (2.00 TB/1.82 TiB)
>> [ 1344.814127] sd 6:0:0:0: [sdb] Assuming Write Enabled
>> [ 1344.814130] sd 6:0:0:0: [sdb] Assuming drive cache: write through
>> [ 1344.878679]  sdb: sdb1
>> [ 1344.880193] sd 6:0:0:0: [sdb] Attached SCSI disk
>> [ 1345.069152] sd 6:0:0:0: [sdb] tag#0 FAILED Result:
>> 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Yet another Seagate quirk for unusual_uas.h

2017-09-21 Thread Kris Lindgren
On Thu, Sep 21, 2017 at 9:25 AM, Alan Stern  wrote:
> On Wed, 20 Sep 2017, Kris Lindgren wrote:
>
>> On Wed, Sep 20, 2017 at 3:00 PM, Alan Stern  
>> 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.
>  */
>