From owner-p4-projects@FreeBSD.ORG Mon Apr 23 18:39:32 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8F59F16A404; Mon, 23 Apr 2007 18:39:32 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5045816A40B for ; Mon, 23 Apr 2007 18:39:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 41AE413C43E for ; Mon, 23 Apr 2007 18:39:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l3NIdWet013158 for ; Mon, 23 Apr 2007 18:39:32 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l3NIdWdk013155 for perforce@freebsd.org; Mon, 23 Apr 2007 18:39:32 GMT (envelope-from hselasky@FreeBSD.org) Date: Mon, 23 Apr 2007 18:39:32 GMT Message-Id: <200704231839.l3NIdWdk013155@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 118672 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: Mon, 23 Apr 2007 18:39:33 -0000 http://perforce.freebsd.org/chv.cgi?CH=118672 Change 118672 by hselasky@hselasky_mini_itx on 2007/04/23 18:38:49 USB config thread improvement. Queue the post command before calling the pre command. That way commands queued by the pre command will be queued after the current command. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/usb_subr.c#32 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/usb_subr.c#32 (text+ko) ==== @@ -2678,6 +2678,20 @@ item = (void *)(m->cur_data_ptr); + /* The job of the post-command + * function is to finish the command + * in a separate context to allow calls + * to sleeping functions basically. + * Queue the post command before calling + * the pre command. That way commands + * queued by the pre command will be + * queued after the current command. + */ + item->command_func = command_post_func; + item->command_ref = command_ref; + + USBD_IF_ENQUEUE(&(ctd->cmd_used), m); + /* The job of the pre-command * function is to copy the needed * configuration to the provided @@ -2689,16 +2703,11 @@ (command_pre_func)(ctd->p_softc, (void *)(item+1), command_ref); } - /* The job of the post-command - * function is to finish the command - * in a separate context to allow calls - * to sleeping functions basically + /* Currently we use a separate thread + * to execute the command, but it is not + * impossible that we might use + * a so called taskqueue in the future: */ - item->command_func = command_post_func; - item->command_ref = command_ref; - - USBD_IF_ENQUEUE(&(ctd->cmd_used), m); - if (ctd->flag_config_td_sleep) { ctd->flag_config_td_sleep = 0; wakeup(&(ctd->wakeup_config_td));