Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Aug 2011 23:24:58 +0200
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        Andriy Gapon <avg@freebsd.org>
Cc:        freebsd-stable@freebsd.org, Eugene Grosbein <egrosbein@rdtc.ru>, Andrew Boyer <aboyer@averesystems.com>, Vishal.Shah@netapp.com, Jeremiah Lott <jlott@averesystems.com>, Steven Hartland <killing@multiplay.co.uk>
Subject:   Re: USB/coredump hangs in 8 and 9
Message-ID:  <201108182324.58276.hselasky@c2i.net>
In-Reply-To: <4E4D460A.2080100@FreeBSD.org>
References:  <DA1FD6FD-2E57-4EC4-899D-2C1CBB769456@averesystems.com> <4E4D460A.2080100@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 18 August 2011 19:04:10 Andriy Gapon wrote:
> If you can help Hans to figure out what you is wrong with USB subsystem in
> this respect that would help us all.

Hi,

usb_busdma.c:   /* we use "mtx_owned()" instead of this function */
usb_busdma.c:   owned = mtx_owned(uptag->mtx);
usb_compat_linux.c:     do_unlock = mtx_owned(&Giant) ? 0 : 1;
usb_compat_linux.c:     do_unlock = mtx_owned(&Giant) ? 0 : 1;
usb_compat_linux.c:     do_unlock = mtx_owned(&Giant) ? 0 : 1;
usb_hub.c:      if (mtx_owned(&bus->bus_mtx)) {
usb_transfer.c: if (!mtx_owned(info->xfer_mtx)) {
usb_transfer.c: if (mtx_owned(xfer->xroot->xfer_mtx)) {
usb_transfer.c:         while (mtx_owned(&xroot->udev->bus->bus_mtx)) {
usb_transfer.c:         while (mtx_owned(xroot->xfer_mtx)) {

One fix you will need to do, if mtx_owned is not giving correct value is:

static void
usbd_callback_wrapper(struct usb_xfer_queue *pq)
{
        struct usb_xfer *xfer = pq->curr;
        struct usb_xfer_root *info = xfer->xroot;

        USB_BUS_LOCK_ASSERT(info->bus, MA_OWNED);
        if (!mtx_owned(info->xfer_mtx)) {

The above "if" should be anded with && !paniced && !dumping ... or maybe the 
new not scheduling variable is good for this purpose?

                /*
                 * Cases that end up here:
                 *

#if USB_HAVE_BUSDMA
        if (mtx_owned(xfer->xroot->xfer_mtx)) {
                struct usb_xfer_queue *pq;


This case is more like a BUS-DMA error case, and is not so important to 
execute.

--HPS



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