From owner-freebsd-bugs@FreeBSD.ORG Sun May 7 10:20:17 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C7ACC16A407 for ; Sun, 7 May 2006 10:20:17 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E50443D48 for ; Sun, 7 May 2006 10:20:17 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k47AKGpl048677 for ; Sun, 7 May 2006 10:20:16 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k47AKGMr048676; Sun, 7 May 2006 10:20:16 GMT (envelope-from gnats) Resent-Date: Sun, 7 May 2006 10:20:16 GMT Resent-Message-Id: <200605071020.k47AKGMr048676@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Szalai Andras Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1E48216A401 for ; Sun, 7 May 2006 10:17:57 +0000 (UTC) (envelope-from szalai.andras@t-online.hu) Received: from tristania.mooo.com (dsl51B61544.pool.t-online.hu [81.182.21.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6080B43D46 for ; Sun, 7 May 2006 10:17:55 +0000 (GMT) (envelope-from szalai.andras@t-online.hu) Received: by tristania.kispest.home (Postfix, from userid 1000) id D934314D836; Sun, 7 May 2006 12:17:54 +0200 (CEST) Message-Id: <20060507101754.D934314D836@tristania.kispest.home> Date: Sun, 7 May 2006 12:17:54 +0200 (CEST) From: Szalai Andras To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: kern/96901: [patch] Add support for X-Micro Flash Disk X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Szalai Andras List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 May 2006 10:20:17 -0000 >Number: 96901 >Category: kern >Synopsis: [patch] Add support for X-Micro Flash Disk >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: Sun May 07 10:20:16 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Szalai Andras >Release: FreeBSD 6.0-RELEASE-p7 i386 >Organization: none >Environment: System: FreeBSD tristania.kispest.home 6.0-RELEASE-p7 FreeBSD 6.0-RELEASE-p7 #6: Sun Apr 30 17:39:34 CEST 2006 root@tristania.kispest.home:/usr/src/sys/i386/compile/TRISTANIA i386 This device is an ordinary USB flash disk made by X-Micro. Device identification: # camcontrol inquiry da0 pass0: Removable Direct Access SCSI-0 device pass0: Serial Number pass0: 40.000MB/s transfers # usbdevs -v (only relevant lines are shown) Controller /dev/usb1: addr 1: high speed, self powered, config 1, EHCI root hub(0x0000), nVidia(0x0000), rev 1.00 port 2 addr 2: high speed, power 200 mA, config 1, Flash Disk(0x1600), X-Micro(0x0d7d), rev 1.00 >Description: With a stock kernel, the device doesn't work after plugging it in. Kernel log: May 6 09:42:42 tristania kernel: umass0: X-Micro Flash Disk, rev 2.00/1.00, addr 2 May 6 09:42:42 tristania kernel: da0 at umass-sim0 bus 0 target 0 lun 0 May 6 09:42:42 tristania kernel: da0: Removable Direct Access SCSI-0 device May 6 09:42:42 tristania kernel: da0: 40.000MB/s transfers May 6 09:42:42 tristania kernel: da0: 492MB (1007616 512 byte sectors: 64H 32S/T 492C) May 6 09:42:42 tristania kernel: umass0: Phase Error, residue = 0 May 6 09:42:42 tristania kernel: (da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0x4, scsi status == 0x0 May 6 09:42:42 tristania kernel: umass0: Phase Error, residue = 0 May 6 09:42:42 tristania kernel: (da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0x4, scsi status == 0x0 May 6 09:42:42 tristania kernel: umass0: Phase Error, residue = 0 May 6 09:42:42 tristania kernel: (da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0x4, scsi status == 0x0 May 6 09:42:42 tristania kernel: umass0: Phase Error, residue = 0 May 6 09:42:42 tristania kernel: (da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0x4, scsi status == 0x0 May 6 09:42:42 tristania kernel: umass0: Phase Error, residue = 0 May 6 09:42:42 tristania kernel: (da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0x4, scsi status == 0x0 May 6 09:42:42 tristania kernel: umass0: Phase Error, residue = 0 May 6 09:42:42 tristania kernel: (da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0x4, scsi status == 0x0 The problem seems to be that the device doesn't like the SYNCHRONIZE CACHE command which therefore must not be issued. >How-To-Repeat: Just plug in the device. >Fix: Here is my patch which corrects the problem. --- xmicro.patch begins here --- diff -ru --new-file orig/sys/cam/scsi/scsi_da.c new/sys/cam/scsi/scsi_da.c --- orig/sys/cam/scsi/scsi_da.c Thu Jun 9 19:35:04 2005 +++ new/sys/cam/scsi/scsi_da.c Sat Apr 29 09:47:55 2006 @@ -354,6 +354,13 @@ {T_DIRECT, SIP_MEDIA_REMOVABLE, "Kingston" , "DataTraveler II+", "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE }, + { + /* + * X-Micro Flash Disk + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "X-Micro" , "Flash Disk", "*"}, + /*quirks*/ DA_Q_NO_SYNC_CACHE + }, }; static disk_strategy_t dastrategy; --- xmicro.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: