Date: Mon, 23 Apr 2007 18:39:32 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 118672 for review Message-ID: <200704231839.l3NIdWdk013155@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200704231839.l3NIdWdk013155>