From jbq@caraldi.com  Wed Jul 23 10:41:25 2003
Return-Path: <jbq@caraldi.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id D5AE037B401
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 23 Jul 2003 10:41:25 -0700 (PDT)
Received: from mail.caraldi.com (caraldi.com [62.212.102.95])
	by mx1.FreeBSD.org (Postfix) with ESMTP id D742743FB1
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 23 Jul 2003 10:41:22 -0700 (PDT)
	(envelope-from jbq@caraldi.com)
Received: from watt.intra.caraldi.com (watt.intra.caraldi.com [192.168.100.101])
	by mail.caraldi.com (Postfix) with ESMTP id 92A2720A1
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 23 Jul 2003 19:41:18 +0200 (CEST)
Received: by watt.intra.caraldi.com (Postfix, from userid 1001)
	id 331E019; Wed, 23 Jul 2003 19:41:27 +0200 (CEST)
Message-Id: <20030723174127.331E019@watt.intra.caraldi.com>
Date: Wed, 23 Jul 2003 19:41:27 +0200 (CEST)
From: Jean-Baptiste Quenot <jb.quenot@caraldi.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Kernel quirk for FreeDik USB Mini Data Drive
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         54786
>Category:       kern
>Synopsis:       Kernel quirk for FreeDik USB Mini Data Drive
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    njl
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 23 10:50:09 PDT 2003
>Closed-Date:    Sun Apr 18 21:16:04 PDT 2004
>Last-Modified:  Sun Apr 18 21:16:04 PDT 2004
>Originator:     Jean-Baptiste Quenot
>Release:        FreeBSD 5.1-CURRENT i386
>Organization:
>Environment:
	System: FreeBSD watt.intra.caraldi.com 5.1-CURRENT FreeBSD 5.1-CURRENT #2: Thu Jul 17 18:59:06 CEST 2003 jbq@watt.intra.caraldi.com:/usr/obj/usr/src/sys/WATT i386
>Description:
	Problem with FreeDik USB Mini Data Drive product 0x8001(0x8001), vendor 0x09a6(0x09a6), rev 1.00
	When inserting the device, kernel prints "Synchronize cache failed"
>How-To-Repeat:
	Happens always on FreeBSD 4.8, 5.0 and 5.1
>Fix:
	Added quirk in scsi_da.c:
	------------------------------------------------------------------------
	--- sys/cam/scsi/scsi_da.c.orig	Tue Jun 17 16:06:02 2003
	+++ sys/cam/scsi/scsi_da.c	Thu Jul 17 18:46:07 2003
	@@ -508,6 +508,13 @@
			 */
			{T_DIRECT, SIP_MEDIA_REMOVABLE, "OTi", "Flash Disk", "*"},
			/*quirks*/ DA_Q_NO_6_BYTE
	+	},
	+	{
	+		/*
	+		 * FreeDik USB Mini Data Drive
	+		 */
	+		{T_DIRECT, SIP_MEDIA_REMOVABLE, "FreeDik*", "Mini Data Drive*", "*"},
	+		/*quirks*/ DA_Q_NO_6_BYTE|DA_Q_NO_SYNC_CACHE
		}
	 };
	------------------------------------------------------------------------

	dmesg output is now ok:
	------------------------------------------------------------------------
	da0 at umass-sim0 bus 0 target 0 lun 0
	da0: <FreeDik- Mini Data Drive 1.00> Removable Direct Access SCSI-0 device
	da0: 1.000MB/s transfers
	da0: 63MB (129376 512 byte sectors: 64H 32S/T 63C) 
	------------------------------------------------------------------------

	Exact information used for creating the patch:
	------------------------------------------------------------------------
	# camcontrol devlist
	<FreeDik- Mini Data Drive 1.00>    at scbus0 target 0 lun 0 (da0,pass0)
	------------------------------------------------------------------------
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->njl 
Responsible-Changed-By: njl 
Responsible-Changed-When: Thu Aug 21 21:53:07 PDT 2003 
Responsible-Changed-Why:  
Please try again with a recent -stable or -current.  I believe this 
problem is fixed and the quirk is not needed. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=54786 

From: Jean-Baptiste Quenot <jb.quenot@caraldi.com>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: kern/54786: Kernel quirk for FreeDik USB Mini Data Drive
Date: Thu, 4 Sep 2003 15:03:41 +0200

 After updating /usr/src using HEAD and compiling a new kernel, it still
 doesn't work.  Here is what I get:
 
 -----------------------------------8<-----------------------------------
 Copyright (c) 1992-2003 The FreeBSD Project.
 Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
 	The Regents of the University of California. All rights reserved.
 FreeBSD 5.1-CURRENT #3: Wed Sep  3 10:35:16 CEST 2003
     jbq@watt.intra.caraldi.com:/usr/obj/usr/src/sys/WATT
 Preloaded elf kernel "/boot/kernel/kernel" at 0xc060c000.
 Preloaded elf module "/boot/kernel/acpi.ko" at 0xc060c1f4.
 Timecounter "i8254" frequency 1193182 Hz quality 0
 CPU: AMD Duron(tm) Processor (799.62-MHz 686-class CPU)
   Origin = "AuthenticAMD"  Id = 0x631  Stepping = 1
   Features=0x183f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR>
   AMD Features=0xc0440000<RSVD,AMIE,DSP,3DNow!>
 real memory  = 671023104 (639 MB)
 avail memory = 645210112 (615 MB)
 Pentium Pro MTRR support enabled
 npx0: <math processor> on motherboard
 npx0: INT 16 interface
 acpi0: <VIA694 MSI ACPI> on motherboard
 pcibios: BIOS version 2.10
 Using $PIR table, 9 entries at 0xc00fdaf0
 acpi0: power button is handled as a fixed feature programming model.
 Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000
 [...]
 uhci0: <VIA 83C572 USB controller> port 0xc400-0xc41f at device 7.2 on pci0
 pcib0: slot 7 INTD is routed to irq 10
 usb0: <VIA 83C572 USB controller> on uhci0
 usb0: USB revision 1.0
 uhub0: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
 uhub0: 2 ports with 2 removable, self powered
 umass0: vendor 0x09a6 product 0x8001, rev 1.10/1.00, addr 2
 uhci1: <VIA 83C572 USB controller> port 0xc800-0xc81f at device 7.3 on pci0
 pcib0: slot 7 INTD is routed to irq 10
 usb1: <VIA 83C572 USB controller> on uhci1
 usb1: USB revision 1.0
 uhub1: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
 uhub1: 2 ports with 2 removable, self powered
 [...]
 GEOM: create disk da0 dp=0xc4e00c50
 da0 at umass-sim0 bus 0 target 0 lun 0
 da0: <FreeDik- Mini Data Drive 1.00> Removable Direct Access SCSI-0 device 
 da0: 1.000MB/s transfers
 da0: 63MB (129376 512 byte sectors: 64H 32S/T 63C)
 umass0: Phase Error, residue = 0
 (da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0x4, scsi status == 0x0
 Opened disk da0 -> 5
 Opened disk da0 -> 5
 Opened disk da0 -> 5
 Opened disk da0 -> 5
 Mounting root from ufs:/dev/ad0s1a
 Opened disk da0 -> 5
 -----------------------------------8<-----------------------------------
 
 Maybe the device does not support the Synchronize Cache command.
 -- 
 Jean-Baptiste Quenot
 http://caraldi.com/jbq/

From: Jean-Baptiste Quenot <jb.quenot@caraldi.com>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: kern/54786: Kernel quirk for FreeDik USB Mini Data Drive
Date: Fri, 26 Mar 2004 19:41:42 +0100

 --IS0zKkzwUGydFO0o
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 Please find attached  an updated patch for FreeBSD  5.2-CURRENT (Fri Mar
 26 17:43:44 CET 2004).
 -- 
 Jean-Baptiste Quenot
 http://caraldi.com/jbq/
 
 --IS0zKkzwUGydFO0o
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="freedik-patch-5.2.1-RELEASE"
 
 --- scsi_da.c.orig	Sun Feb 22 02:14:54 2004
 +++ scsi_da.c	Fri Mar 26 15:50:27 2004
 @@ -383,6 +383,13 @@
   		{T_DIRECT, SIP_MEDIA_REMOVABLE, "CREATIVE", "NOMAD_MUVO", "*"},
   		/*quirks*/ DA_Q_NO_SYNC_CACHE|DA_Q_NO_PREVENT
   	},
 +	{
 +		/*
 +		 * FreeDik USB Mini Data Drive
 +		 */
 +		{T_DIRECT, SIP_MEDIA_REMOVABLE, "FreeDik*", "Mini Data Drive*", "*"},
 +		/*quirks*/ DA_Q_NO_SYNC_CACHE
 +	}
  };
  
  static	disk_strategy_t	dastrategy;
 
 --IS0zKkzwUGydFO0o--
State-Changed-From-To: open->closed 
State-Changed-By: njl 
State-Changed-When: Sun Apr 18 21:15:55 PDT 2004 
State-Changed-Why:  
Committed and will hopefully make it into 4.10.  Thanks! 


http://www.freebsd.org/cgi/query-pr.cgi?pr=54786 
>Unformatted:
