Re: umass quirk for ignoring residue?

2015-07-03 Thread frantisek holop
Martin Pieuchot, 22 Jun 2015 15:17:
  but this did not seem to help.

while the quirk was committed, my enclosure is still
not working.  here is the output with SCSIDEBUG:

umass0 at uhub0 port 1 configuration 1 interface 0 Super Top USB 2.0  IDE 
DEVICE rev 2.00/2.01 addr 6
umass0: using SCSI over Bulk-Only
scsibus4 at umass0: 2 targets, initiator 0
scsi_inqmatch: 2/0/0 , , 
sd1 at scsibus4 targ 1 lun 0: ST916082, 1A, 0 0 SCSI0 0/direct fixed
sd1(umass0:1:0): Check Condition (error 0x70) on opcode 0x1a
SENSE KEY: Illegal Request
 ASC/ASCQ: Illegal Field in CDB
sd1: 152627MB, 512 bytes/sector, 312581808 sectors
sd1(umass0:1:0): Check Condition (error 0x70) on opcode 0x1a
SENSE KEY: Illegal Request
 ASC/ASCQ: Illegal Field in CDB
sd1(umass0:1:0): Check Condition (error 0x70) on opcode 0x5a
SENSE KEY: Illegal Request
 ASC/ASCQ: Illegal Field in CDB

-f
-- 
senility means never having to drink just to forget.



Re: umass quirk for ignoring residue?

2015-06-22 Thread Martin Pieuchot
On 20/06/15(Sat) 18:50, frantisek holop wrote:
 trying to use a replacement usb enclosure for an old 2.5 IDE drive.
 [...] 
 Controller /dev/usb0:
 addr 1: high speed, self powered, config 1, EHCI root hub(0x), 
 Intel(0x8086), rev 1.00
  port 2 addr 6: high speed, self powered, config 1, USB 2.0  IDE 
 DEVICE(0x6600), Super Top(0x14cd), rev 2.01, iSerialNumber ??
 
 apparently the USB 2.0  IDE DEVICE(0x6600) from Super Top(0x14cd)
 is a well known offender...
 
 netbsd/dev/usb: (in usbdevs but no quirk)
   usbdevs
   504:vendor SUPERTOP  0x14cd  SuperTop
   3116:product SUPERTOP IDEBRIDGE  0x6600  SuperTop IDE Bridge
 
 
 freebsd/dev/usb:
   usbdevs
   649:vendor SUPERTOP  0x14cd  Super Top
   4316:product SUPERTOP IDE0x6600  USB-IDE
 
   quirk/usb_quirk.c
   410: USB_QUIRK(SUPERTOP, IDE, 0x, 0x, UQ_MSC_IGNORE_RESIDUE,
   411: UQ_MSC_NO_SYNC_CACHE),
 
 
 linux/drivers/usb:
   storage/unusual_devs.h
   1976:UNUSUAL_DEV(  0x14cd, 0x6600, 0x0201, 0x0201,
   1977:Super Top,
   1978:IDE DEVICE,
   1979:USB_SC_DEVICE, USB_PR_DEVICE, NULL,
   1980:US_FL_IGNORE_RESIDUE ),
 
 
 trying to compare the different kernels re: ignoring residue,
 in openbsd ADEV_NOSENSE seemed like the way to go:

I believe it's the way to go.

 Index: umass_quirks.c
 ===
 RCS file: /cvs/src/sys/dev/usb/umass_quirks.c,v
 retrieving revision 1.31
 diff -u -p -r1.31 umass_quirks.c
 --- umass_quirks.c5 Oct 2014 08:34:14 -   1.31
 +++ umass_quirks.c20 Jun 2015 16:24:11 -
 @@ -465,6 +465,14 @@ const struct umass_quirk umass_quirks[] 
UMATCH_VENDOR_PRODUCT,
NULL, NULL
   },
 +
 + { { USB_VENDOR_SUPERTOP, USB_PRODUCT_SUPERTOP_IDEBRIDGE },
 +  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
 +  0,
 +  ADEV_NOSENSE,
 +  UMATCH_VENDOR_PRODUCT,
 +  NULL, NULL
 + },
  };
  
  const struct umass_quirk *
 Index: usbdevs
 ===
 RCS file: /cvs/src/sys/dev/usb/usbdevs,v
 retrieving revision 1.651
 diff -u -p -r1.651 usbdevs
 --- usbdevs   16 Jun 2015 05:07:25 -  1.651
 +++ usbdevs   20 Jun 2015 16:24:11 -
 @@ -534,6 +534,7 @@ vendor SILICOM0x1485  Silicom
  vendor RALINK0x148f  Ralink Technology
  vendor STARTECH  0x14b0  StarTech.com
  vendor CONCEPTRONIC2 0x14b2  Conceptronic
 +vendor SUPERTOP  0x14cd  SuperTop
  vendor PLANEX3   0x14ea  Planex Communications
  vendor SILICONPORTALS0x1527  Silicon Portals
  vendor UBLOX 0x1546  U-blox
 @@ -4058,6 +4059,9 @@ product SUNTAC VS10U0x0009  Slipper U
  product SUNTAC IS96U 0x000a  Ir-Trinity
  product SUNTAC AS64LX0x000b  U-Cable type A3
  product SUNTAC AS144L4   0x0011  U-Cable type A4
 +
 +/* SuperTop products */
 +product SUPERTOP IDEBRIDGE   0x6600  SuperTop IDE Bridge
  
  /* System TALKS, Inc. */
  product  SYSTEMTALKS SGCX2UL 0x1920  SGC-X2UL
 
 
 but this did not seem to help.
 
 here is the output from usb/umass debug enabled kernel with _only_
 the usbdevs part of the patch, not the quirk.
 connecting the drive, waiting a couple of seconds
 and issuing sudo fdisk sd1:
 
 Jun 20 17:55:13 hatvan /bsd: umass0 at uhub0
 Jun 20 17:55:13 hatvan /bsd:  port 2 configuration 1 interface 0 Super Top 
 USB 2.0  IDE DEVICE rev 2.00/2.01 addr 6
 Jun 20 17:55:13 hatvan /bsd: umass0: using SCSI over Bulk-Only
 Jun 20 17:55:14 hatvan /bsd: umass0: Get Max Lun
 Jun 20 17:55:14 hatvan /bsd: umass0: Max Lun 0
 Jun 20 17:55:14 hatvan /bsd: umass0: opening iface 0xd3364360 epaddr 2 for 
 BULKOUT
 Jun 20 17:55:14 hatvan /bsd: umass0: opening iface 0xd3364360 epaddr 129 for 
 BULKIN
 Jun 20 17:55:14 hatvan /bsd: umass0: umass_attach_bus: SCSI
 Jun 20 17:55:14 hatvan /bsd: sc = 0x0xd3361400, scbus = 0x0xd3362800
 Jun 20 17:55:14 hatvan /bsd: scsibus4 at umass0: 2 targets, initiator 0
 Jun 20 17:55:14 hatvan /bsd: umass0: umass_scsi_cmd: at 1434815714.000358: 
 1:0 xs=0xd9181000 cmd=0x00 datalen=0 (quirks=0x400e, poll=0)
 Jun 20 17:55:14 hatvan /bsd: umass_scsi_cmd: async dir=0, cmdlen=6 datalen=0
 Jun 20 17:55:14 hatvan /bsd: umass0: umass_bbb_transfer cmd=0x00
 Jun 20 17:55:14 hatvan /bsd: umass0: CBW 158: cmdlen=6 
 (0x), data = 0 bytes, dir = out
 Jun 20 17:55:14 hatvan /bsd: umass0: start xfer buffer=0xd3361464 buflen=31 
 flags=0x0 timeout=15000
 Jun 20 17:55:14 hatvan /bsd: umass0: Handling BBB state 1 (BBB CBW), 
 xfer=0xd9183460, NORMAL_COMPLETION
 Jun 20 17:55:14 hatvan /bsd: umass0: no data phase
 Jun 20 17:55:14 hatvan /bsd: umass0: start xfer buffer=0xd3361483 buflen=13 
 flags=0x0 timeout=15000
 Jun 20 17:55:14 hatvan /bsd: umass0: Handling BBB state 4 (BBB CSW, 1st