From owner-freebsd-usb@FreeBSD.ORG Wed Jan 26 18:10:10 2011 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5A80106566C for ; Wed, 26 Jan 2011 18:10:10 +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 7B3128FC08 for ; Wed, 26 Jan 2011 18:10:10 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p0QIAAgq084331 for ; Wed, 26 Jan 2011 18:10:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p0QIAA3X084330; Wed, 26 Jan 2011 18:10:10 GMT (envelope-from gnats) Date: Wed, 26 Jan 2011 18:10:10 GMT Message-Id: <201101261810.p0QIAA3X084330@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: CDP Cc: Subject: Re: usb/150401: [umass] [usb8] Errors from USB drives mixed between UFS and ZFS X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: CDP List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 18:10:10 -0000 The following reply was made to PR usb/150401; it has been noted by GNATS. From: CDP To: bug-followup@FreeBSD.org, decibel@decibel.org, jim@nasby.net Cc: Subject: Re: usb/150401: [umass] [usb8] Errors from USB drives mixed between UFS and ZFS Date: Wed, 26 Jan 2011 18:44:11 +0200 This is a multi-part message in MIME format. --------------010404030104040904000001 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I've had my share of problems with USB external HDD's since I upgraded to 8.x. I believe the root of your problems is the same as in my case. Please take a look at this thread: http://lists.freebsd.org/pipermail/freebsd-usb/2011-January/009894.html I've also attached the patch that fixes the problem in my case. Note that it is intended for 8.2-RC2. Regards, Claudiu Dragalina-Paraipan --------------010404030104040904000001 Content-Type: text/plain; name="cam_periph.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="cam_periph.patch" --- sys/cam/cam_periph.c.orig 2011-01-26 09:38:21.000000000 +0200 +++ sys/cam/cam_periph.c 2011-01-26 09:38:02.000000000 +0200 @@ -1024,7 +1024,9 @@ int frozen = 0; u_int sense_key; int depth = done_ccb->ccb_h.recovery_depth; + int xpt_done_ccb; + xpt_done_ccb = FALSE; status = done_ccb->ccb_h.status; if (status & CAM_DEV_QFRZN) { frozen = 1; @@ -1049,14 +1051,22 @@ if (sense_key != SSD_KEY_NO_SENSE) { saved_ccb->ccb_h.status |= CAM_AUTOSNS_VALID; - } else { + + xpt_done_ccb = TRUE; + } /*else { saved_ccb->ccb_h.status &= ~CAM_STATUS_MASK; saved_ccb->ccb_h.status |= CAM_AUTOSENSE_FAIL; - } + }*/ bcopy(saved_ccb, done_ccb, sizeof(union ccb)); xpt_free_ccb(saved_ccb); + + periph->flags &= ~CAM_PERIPH_RECOVERY_INPROG; + + if (xpt_done_ccb == FALSE) + xpt_action(done_ccb); + break; } default: @@ -1084,7 +1094,9 @@ */ if (frozen != 0) done_ccb->ccb_h.status |= CAM_DEV_QFRZN; - (*done_ccb->ccb_h.cbfcnp)(periph, done_ccb); + + if (xpt_done_ccb == TRUE) + (*done_ccb->ccb_h.cbfcnp)(periph, done_ccb); } static void --------------010404030104040904000001--