From owner-svn-src-all@FreeBSD.ORG Wed May 13 17:58:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20EC81065674; Wed, 13 May 2009 17:58:38 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0FF388FC16; Wed, 13 May 2009 17:58:38 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4DHwbDJ063226; Wed, 13 May 2009 17:58:37 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4DHwbsF063225; Wed, 13 May 2009 17:58:37 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200905131758.n4DHwbsF063225@svn.freebsd.org> From: Andrew Thompson Date: Wed, 13 May 2009 17:58:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192051 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2009 17:58:38 -0000 Author: thompsa Date: Wed May 13 17:58:37 2009 New Revision: 192051 URL: http://svn.freebsd.org/changeset/base/192051 Log: The transfer must return USB_ERR_CANCELLED when the device is gone due to the way usb drivers work. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_transfer.c Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Wed May 13 17:53:04 2009 (r192050) +++ head/sys/dev/usb/usb_transfer.c Wed May 13 17:58:37 2009 (r192051) @@ -1439,7 +1439,11 @@ usb2_start_hardware(struct usb2_xfer *xf /* Check if the device is still alive */ if (info->udev->state < USB_STATE_POWERED) { USB_BUS_LOCK(bus); - usb2_transfer_done(xfer, USB_ERR_NOT_CONFIGURED); + /* + * Must return cancelled error code else + * device drivers can hang. + */ + usb2_transfer_done(xfer, USB_ERR_CANCELLED); USB_BUS_UNLOCK(bus); return; }