Bug 76653

Summary: [umass] [patch] Problem with Asahi Optical usb device (Pentax Optio S50)
Product: Base System Reporter: guzman <guzman>
Component: usbAssignee: freebsd-usb mailing list <usb>
Status: Closed DUPLICATE    
Severity: Affects Only Me CC: imp
Priority: Normal    
Version: 5.3-RELEASE   
Hardware: Any   
OS: Any   

Description guzman 2005-01-25 09:10:17 UTC
I have a Pentax Optio S50, identified as a Asahi Optical usb device, and it refused absolutly to work.
Here is the dmesg output :
umass0: PENTAX product 0x001f, rev 1.10/0.00, addr 2
umass0: CBI reset failed, IOERROR
umass0: CBI bulk-in stall clear failed, IOERROR
umass0: CBI bulk-out stall clear failed, IOERROR
Last 3 lines repeated 4 times.

Note that this device used to work on a FreeBSD 4.10 kernel.

Fix: I've managed to make it work just changing sys/dev/usb/umass.c :


But there is still lots of error in dmesg :
umass0: PENTAX product 0x001f, rev 1.10/0.00, addr 2
daregister: setting no 6 byte
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <PENTAX DIGITAL_CAMERA 1.00> Removable Direct Access SCSI-0 device 
da0: 1.000MB/s transfers
da0: 965MB (1976320 512 byte sectors: 64H 32S/T 965C)
umass0: Phase Error, residue = 0
(da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0x4, scsi status == 0x0
Last 2 lines repeated a lot of times.

Well it does work, I can mount the device and access pictures.--gnZW9zGRn1qeRpNDvnFGXBKynWYWQYkOd1AiLBBokypHW5SG
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- umass.c     Mon Sep 20 07:28:08 2004
+++ /usr/src/sys/dev/usb/umass.c        Tue Jan 25 00:46:50 2005
@@ -316,7 +316,7 @@
 
 Static struct umass_devdescr_t umass_devdescrs[] = {
        { USB_VENDOR_ASAHIOPTICAL, PID_WILDCARD, RID_WILDCARD,
-         UMASS_PROTO_ATAPI | UMASS_PROTO_CBI_I,
+         UMASS_PROTO_ATAPI | UMASS_PROTO_BBB,
          RS_NO_CLEAR_UA
        },
        { USB_VENDOR_FUJIPHOTO, USB_PRODUCT_FUJIPHOTO_MASS0100, RID_WILDCARD,
How-To-Repeat: Every times you plug the device, on every usb port.
Comment 1 iedowse freebsd_committer 2005-03-25 00:58:42 UTC
State Changed
From-To: open->feedback


Does this device work if you comment out the entire entry in 
the umass_devdescrs[] table rather than just changing the CBI_I 
to BBB?
Comment 2 Kris Kennaway freebsd_committer 2005-07-30 02:34:21 UTC
State Changed
From-To: feedback->closed

Feedback timeout
Comment 3 Csaba Henk 2005-10-06 11:44:42 UTC
Hi!

Please reopen this PR. I can serve with the requested feedback.

Note that I have a Pentax Optio S40 but the behaviour shown is the same
with this device (both the original, problematic behaviour and the one
shown after applying the fix).

If I take out the USB_VENDOR_ASAHIOPTICAL entry from umass_devdescrs,
the behaviour is the same as with the provided fix: there are "phase
error" messages, but the da0 device works aptly. Here is the exact
batch of kernel messages after plugging the camera in:

umass0: PENTAX product 0x0015, rev 1.10/0.00, addr 3
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <PENTAX DIGITAL_CAMERA 1.00> Removable Direct Access SCSI-0 device 
da0: 1.000MB/s transfers
da0: 483MB (990976 512 byte sectors: 64H 32S/T 483C)
umass0: Phase Error, residue = 0
(da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0x4, scsi status == 0x0
umass0: Phase Error, residue = 0
(da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0x4, scsi status == 0x0
umass0: Phase Error, residue = 0
(da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0x4, scsi status == 0x0
umass0: Phase Error, residue = 0
(da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0x4, scsi status == 0x0
umass0: Phase Error, residue = 0
(da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0x4, scsi status == 0x0
umass0: Phase Error, residue = 0
(da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0x4, scsi status == 0x0

For my system, kern.osreldate is 700000, but I don't think that this would have
too much importance in this case. 

Regards,
Csaba
Comment 4 Giorgos Keramidas freebsd_committer 2005-10-07 08:17:11 UTC
State Changed
From-To: closed->open

Reopen.  We have feedback.
Comment 5 Ganbold 2006-08-08 05:14:01 UTC
Hi,

I have Pentax Optio S60 and I got it working in Dell D620 under 
FreeBSD-6.1-STABLE by patching umass.c and scsi_da.c.

# uname -an
FreeBSD devil.micom.mng.net 6.1-STABLE FreeBSD 6.1-STABLE #7: Tue Aug  8 
12:52:48 ULAST 2006     
tsgan@devil.micom.mng.net:/usr/obj/usr/src/sys/DEVIL  i386

Aug  8 12:59:39 devil kernel: umass0: PENTAX product 0x0047, rev 
1.10/0.00, addr 2
Aug  8 12:59:40 devil kernel: da0 at umass-sim0 bus 0 target 0 lun 0
Aug  8 12:59:40 devil kernel: da0: <PENTAX DIGITAL_CAMERA 1.00> 
Removable Direct Access SCSI-0 device
Aug  8 12:59:40 devil kernel: da0: 1.000MB/s transfers
Aug  8 12:59:40 devil kernel: da0: 243MB (498176 512 byte sectors: 64H 
32S/T 243C)

# usbdevs -v
...
Controller /dev/usb2:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), 
Intel(0x0000), rev 1.00
 port 1 powered
 port 2 addr 2: full speed, self powered, config 1, product 
0x0047(0x0047), PENTAX(0x0a17), rev 0.00
...

Patches are here:

-----------------------------------------------------------------------------------
--- /usr/src/sys/dev/usb/umass.c-orig   Tue Aug  8 12:54:25 2006
+++ /usr/src/sys/dev/usb/umass.c        Tue Aug  8 12:55:37 2006
@@ -321,7 +321,7 @@

 Static struct umass_devdescr_t umass_devdescrs[] = {
        { USB_VENDOR_ASAHIOPTICAL, PID_WILDCARD, RID_WILDCARD,
-         UMASS_PROTO_ATAPI | UMASS_PROTO_CBI_I,
+         UMASS_PROTO_ATAPI | UMASS_PROTO_BBB,
          RS_NO_CLEAR_UA
        },
        { USB_VENDOR_ADDON, USB_PRODUCT_ADDON_ATTACHE, RID_WILDCARD,
-----------------------------------------------------------------------------------
--- /usr/src/sys/cam/scsi/scsi_da.c-orig        Tue Aug  8 12:53:37 2006
+++ /usr/src/sys/cam/scsi/scsi_da.c     Tue Aug  8 12:47:15 2006
@@ -436,6 +436,11 @@
                "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE
        },
        {
+               /* PENTAX Optio S60. */
+               {T_DIRECT, SIP_MEDIA_REMOVABLE, "PENTAX", 
"DIGITAL_CAMERA", "*"},
+               /*quirks*/ DA_Q_NO_SYNC_CACHE
+       },
+       {
                /*
                 * Genesys 6-in-1 Card Reader
                 * PR: usb/94647

hth,

Ganbold
Comment 6 Mark Linimon freebsd_committer freebsd_triage 2007-06-26 22:28:42 UTC
Responsible Changed
From-To: freebsd-i386->freebsd-usb

Reassign.
Comment 7 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:41 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 8 Warner Losh freebsd_committer 2019-01-09 06:14:41 UTC

*** This bug has been marked as a duplicate of bug 93389 ***