NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

re: kern/46648: disconnecting usb mouse crashes system

The following reply was made to PR kern/46648; it has been noted by GNATS.

From: matthew green <>
To: (Christos Zoulas)
Subject: re: kern/46648: disconnecting usb mouse crashes system
Date: Mon, 02 Jul 2012 17:47:31 +1000

 > | hmmmm, this problem looks pretty annoying, and might affect many
 > | devices.  the problem seems to be that:
 > | 
 > |    - device was pulled out with active transfers
 > | 
 > |    - the handling of an error in the transfer callback function
 > |    is to call usbd_clear_endpoint_stall_async(), which then
 > |    sends a clear endpoint transfer
 > | 
 > |    - adapter transfer list is empty, causing kmem_alloc call,
 > |    triggering the assertion since this is happening from the
 > |    softintr thread
 > | 
 > | this idiom is used in many of the USB drivers, so a solution that
 > | does not require each one changing seems appropriate.
 > | 
 > | i'm not sure yet exactly the right answer.  it's clear to me (and
 > | has been or a while, since before usbmp) that the USB softintr
 > | does way too much work.
 > Have a pre-allocated xfer to be used on disconnect. Does this need
 > to be per driver or per bus?
 if only it were that simple.  the layering makes this
 pretty ugly to consider.
 i think usbd_clear_endpoint_stall_async() can be changed
 to use the usb task thread to send the message.
 then the handful of usbd_clear_endpoint_stall() may need
 help, but it should fix this case.

Home | Main Index | Thread Index | Old Index