kern/58045: [patch] to add PNY Attache Flash Drive to umass(4)

Rick C.Petty rick at kiwi-computer.com
Tue Oct 14 21:50:12 PDT 2003


>Number:         58045
>Category:       kern
>Synopsis:       [patch] to add PNY Attache Flash Drive to umass(4)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 14 21:50:09 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Rick C. Petty
>Release:        FreeBSD 5.1-CURRENT i386
>Organization:
>Environment:
System: FreeBSD 5.1-CURRENT FreeBSD 5.1-CURRENT #1: Tue Oct 14 13:27:42 EDT 2003 root@:/usr/src/sys/i386/compile/GENERIC i386

>Description:
	PNY's Attache USB 2.0 Flash Drive is a solid-state memory storage
device.  However neither the device nor the vendor are listed in
dev/usb/usbdevs and the drive fails to operate correctly.  The kernel
reports "Phase Errors" with varying sizes of residue (1024, 512, 0) as well
as numerous "Synchronize cache failed" errors.  fdisk(8) does not report
correctly and attempts to write the partition map or mount the drive fail.

The following patches were applied to a CVSup'd 5-CURRENT as of today (adds
the PNY vendor and the product ID which match my flash drive).  I guessed
at the command protocol and "ignore residue" quirk; the patches allowed
fdisk, mount, and read/write to work correctly.  The kernel still reports:

umass0: Phase Error, residue = 0
(da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0x4, scsi status == 0x0

repeatedly, but otherwise it seems to work correctly.  Someone with USB/CAM
knowledge might suggest a better fix; at least this is a [working] start.

>How-To-Repeat:
	CVS to 5.1-CURRENT as of Oct 14 2003, use GENERIC or a kernel
configured with umass & friends.  Plug in USB 2.0 PNY Attache Flash Drive
and try to fdisk(8) or mount da0s1.  Kernel will report numerous Phase
Errors with residue and the operation will not succeed.  With the following
patches, fdisk reported the correct partition table and mount succeeded.

>Fix:

--- usbdevs.patch begins here ---
--- /sys/dev/usb/usbdevs.orig	Fri Oct 10 16:58:46 2003
+++ /sys/dev/usb/usbdevs	Tue Oct 14 18:10:45 2003
@@ -346,6 +346,7 @@ vendor AGATE		0x0c08	Agate Technologies
 vendor DMI		0x0c0b	DMI
 vendor LUWEN		0x0c76	Luwen
 vendor SMC3		0x0d5c  Standard Microsystems
+vendor PNY		0x0d7d	PNY
 vendor HAWKING		0x0e66	Hawking Technologies
 vendor MOTOROLA		0x1063	Motorola
 vendor PLX		0x10b5	PLX
@@ -999,6 +1000,9 @@ product PIENGINEERING PS2USB	0x020b	PS2 
 
 /* PLX products */
 product PLX TESTBOARD		0x9060	test board
+
+/* PNY products */
+product PNY ATTACHE		0x1300	USB 2.0 Flash Drive
 
 /* Primax products */
 product PRIMAX G2X300		0x0300	G2-200 scanner
--- usbdevs.patch ends here ---

--- umass.patch begins here ---
--- /sys/dev/usb/umass.c.orig	Tue Oct 14 07:46:22 2003
+++ /sys/dev/usb/umass.c	Tue Oct 14 18:22:54 2003
@@ -358,6 +358,10 @@ Static struct umass_devdescr_t umass_dev
 	  UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
 	  WRONG_CSWSIG
 	},
+	{ USB_VENDOR_PNY, USB_PRODUCT_PNY_ATTACHE, RID_WILDCARD,
+	  UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
+	  IGNORE_RESIDUE
+	},
 	{ USB_VENDOR_SCANLOGIC, USB_PRODUCT_SCANLOGIC_SL11R, RID_WILDCARD,
 	  UMASS_PROTO_ATAPI | UMASS_PROTO_CBI_I,
 	  NO_QUIRKS
--- umass.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list