PERFORCE change 154775 for review

Weongyo Jeong weongyo at FreeBSD.org
Mon Dec 15 21:02:09 PST 2008


http://perforce.freebsd.org/chv.cgi?CH=154775

Change 154775 by weongyo at 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);
 }


More information about the p4-projects mailing list