Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Aug 2011 16:54:22 +0200
From:      Hans Petter Selasky <hselasky@freebsd.org>
To:        Andriy Gapon <avg@freebsd.org>
Cc:        "svn-src-head@FreeBSD.org" <svn-src-head@freebsd.org>, "svn-src-all@FreeBSD.org" <svn-src-all@freebsd.org>, "src-committers@FreeBSD.org" <src-committers@freebsd.org>
Subject:   Re: svn commit: r223989 - head/sys/dev/usb/input
Message-ID:  <201108291654.23054.hselasky@freebsd.org>
In-Reply-To: <4E5BA31C.7070103@FreeBSD.org>
References:  <201108291627.42477.hselasky@freebsd.org> <4E5BA31C.7070103@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 29 August 2011 16:33:00 Andriy Gapon wrote:
> Not sure if this answers my question, which is not about pause vs
> ukbd_yield, but is about ukbd_yield vs kern_yield.
> In other words, why you couldn't simply use kern_yield where you used
> ukbd_yield?

Is this a new function. I think I used the following as an example:

void
uio_yield(void)
{
        struct thread *td;

        td = curthread;
        DROP_GIANT();
        thread_lock(td);
        sched_prio(td, td->td_user_pri);
        mi_switch(SW_INVOL | SWT_RELINQUISH, NULL);
        thread_unlock(td);
        PICKUP_GIANT();
}

As long as the kern_yield() lets the USB worker threads and XHCI interrupts 
run it should be fine. pause() is better though.

--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201108291654.23054.hselasky>