From owner-p4-projects@FreeBSD.ORG Tue Dec 16 05:02:09 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 93A811065676; Tue, 16 Dec 2008 05:02:09 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24E1E106564A for ; Tue, 16 Dec 2008 05:02:09 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 104C98FC1F for ; Tue, 16 Dec 2008 05:02:09 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id mBG528WH098786 for ; Tue, 16 Dec 2008 05:02:08 GMT (envelope-from weongyo@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id mBG528el098784 for perforce@freebsd.org; Tue, 16 Dec 2008 05:02:08 GMT (envelope-from weongyo@FreeBSD.org) Date: Tue, 16 Dec 2008 05:02:08 GMT Message-Id: <200812160502.mBG528el098784@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to weongyo@FreeBSD.org using -f From: Weongyo Jeong To: Perforce Change Reviews Cc: Subject: PERFORCE change 154775 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2008 05:02:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=154775 Change 154775 by weongyo@weongyo_ws on 2008/12/16 05:01:30 When processing URB_FUNCTION_VENDOR_... and URB_FUNCTION_CLASS_... types of URB, sometimes it's called with locking HAL preemption lock so it can cause LORs. If the requests are going to the OUT (write operation) we try to use usbd_do_request_async() which doesn't sleep With this patch, The Shuttle XPC Accessory PN20 works. Affected files ... .. //depot/projects/ndisusb/sys/compat/ndis/subr_usbd.c#22 edit Differences ... ==== //depot/projects/ndisusb/sys/compat/ndis/subr_usbd.c#22 (text+ko) ==== @@ -590,9 +590,14 @@ USETW(req.wValue, vcreq->uvc_value); USETW(req.wLength, vcreq->uvc_trans_buflen); - mtx_lock(&Giant); - status = usbd_do_request(uaa->device, &req, vcreq->uvc_trans_buf); - mtx_unlock(&Giant); + if (vcreq->uvc_trans_flags & USBD_TRANSFER_DIRECTION_IN) { + mtx_lock(&Giant); + status = usbd_do_request(uaa->device, &req, + vcreq->uvc_trans_buf); + mtx_unlock(&Giant); + } else + status = usbd_do_request_async(uaa->device, &req, + vcreq->uvc_trans_buf); return usbd_usb2urb(status); }