From owner-freebsd-bugs@FreeBSD.ORG Sun Jan 8 19:00:20 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3DE01065676 for ; Sun, 8 Jan 2012 19:00:20 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 9CAC78FC14 for ; Sun, 8 Jan 2012 19:00:20 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q08J0KVQ015281 for ; Sun, 8 Jan 2012 19:00:20 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q08J0KuH015280; Sun, 8 Jan 2012 19:00:20 GMT (envelope-from gnats) Resent-Date: Sun, 8 Jan 2012 19:00:20 GMT Resent-Message-Id: <201201081900.q08J0KuH015280@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, Bartosz Fabianowski Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24235106566C for ; Sun, 8 Jan 2012 18:50:02 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 0F5FC8FC12 for ; Sun, 8 Jan 2012 18:50:02 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q08Io1KK092548 for ; Sun, 8 Jan 2012 18:50:01 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q08Io1aC092547; Sun, 8 Jan 2012 18:50:01 GMT (envelope-from nobody) Message-Id: <201201081850.q08Io1aC092547@red.freebsd.org> Date: Sun, 8 Jan 2012 18:50:01 GMT From: Bartosz Fabianowski To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/163932: [PATCH] [cam] Fix detection of LUN 1 for Garmin GPS devices X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 19:00:20 -0000 >Number: 163932 >Category: kern >Synopsis: [PATCH] [cam] Fix detection of LUN 1 for Garmin GPS devices >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Jan 08 19:00:20 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Bartosz Fabianowski >Release: 9-STABLE >Organization: >Environment: >Description: Recent Garmin GPS units present as two USB mass storage devices, representing internal storage (LUN 0) and SD card (LUN 1). However, the list of LUNs is incorrectly reported by the firmware so that FreeBSD sees LUN 0 only. I noticed this problem with a Garmin Dakota 20: http://lists.freebsd.org/pipermail/freebsd-usb/2012-January/010971.html The same problem was as reported with a Garmin Edge 705: http://lists.freebsd.org/pipermail/freebsd-scsi/2011-December/005159.html The problem exists in FreeBSD 9 and 10. >How-To-Repeat: Plug in a Garmin GPS unit with two LUNs. 1. Notice that only one umass device appears. 2. Notice that "camcontrol reportluns" reports LUN 0 twice instead of LUN 0 and LUN 1: %camcontrol reportluns da0 2 LUNs found 0 0 >Fix: The attached patch enables the CAM_QUIRK_NOLUNS quirk. With this, FreeBSD assumes that the device's two LUNs are consecutively numbered and therefore correctly probes LUN 0 and LUN 1. Patch attached with submission follows: --- sys/cam/scsi/scsi_xpt.c.orig 2012-01-08 20:20:11.000000000 +0200 +++ sys/cam/scsi/scsi_xpt.c 2012-01-08 19:54:16.000000000 +0200 @@ -527,6 +527,10 @@ CAM_QUIRK_NOLUNS, /*mintags*/0, /*maxtags*/0 }, { + { T_DIRECT, SIP_MEDIA_REMOVABLE, "Garmin", "*", "*" }, + CAM_QUIRK_NORPTLUNS, /*mintags*/2, /*maxtags*/255 + }, + { /* Default tagged queuing parameters for all devices */ { T_ANY, SIP_MEDIA_REMOVABLE|SIP_MEDIA_FIXED, >Release-Note: >Audit-Trail: >Unformatted: