|
Description
|
Category
driver
Sub-Category
usb-ehci
Description
snv_b63, "amanda" backup to a zfs pool on an usb2.0 hdd stalled, system
must be power-cycled.
The ehci_intr() handler is blocked on a
mutex_enter(0xfffffffec00b60c0) call, and that mutex is held by
another thread, that is trying to allocate an ehci transfer wrapper
data structure in ehci_create_transfer_wrapper(), called from a
ehci_hcdi_pipe_bulk_xfer(). The system is running low on available
memory, so that "ddi_dma_mem_alloc(... DDI_DMA_SLEEP ...)" is
sleeping while holding the ehcip->ehci_int_mutex !
(same issue exists with ohci_intr handler?)
...
ffffff00078b3c80 fffffffffbc27ef0 0 0 168 >>>fffffffec00b60c0<<<
PC: resume_from_intr+0xbb THREAD: unix`thread_create_intr()
stack pointer for thread ffffff00078b3c80: ffffff00078b3a30
[ ffffff00078b3a30 resume_from_intr+0xbb() ]
swtch+0x9f()
turnstile_block+0x76b()
mutex_vector_enter+0x345()
ehci_intr+0x2a()
av_dispatch_autovect+0x78()
dispatch_hardint+0x2f()
switch_sp_and_call+0x13()
0xffffff0006ff41f8()
...
> 0xfffffffec00b60c0::mutex
ADDR TYPE HELD MINSPL OLDSPL WAITERS
fffffffec00b60c0 adapt ffffff00078e3c80 - - yes
> ffffff00078e3c80::findstack -v
stack pointer for thread ffffff00078e3c80: ffffff00078e31d0
[ ffffff00078e31d0 _resume_from_idle+0xf8() ]
ffffff00078e3210 swtch+0x17f()
ffffff00078e3240 cv_wait+0x61(ffffff00078e3e56, ffffff00078e3e58)
ffffff00078e3290 delay+0xba(a)
ffffff00078e3340 page_create_io+0x1f1(fffffffffbc29c40, fffffffed7268000, 2000, 3,
fffffffffbc29b60, fffffffed7268000, fffffffffbc0df40)
ffffff00078e3380 page_create_io_wrapper+0x50(fffffffed7268000, 2000, 0,
fffffffffbc0df40)
ffffff00078e3410 segkmem_xalloc+0xbc(fffffffffbc97c10, 0, 2000, 0, 0,
fffffffffb80a580, fffffffffbc0df40)
ffffff00078e3450 segkmem_alloc_io_2G+0x3b(fffffffffbc97c10, 2000, 0)
ffffff00078e3590 vmem_xalloc+0x4fc(fffffffec005a000, 2000, 1000, 0, 0, 0, 0, 0)
ffffff00078e3600 vmem_alloc+0x159(fffffffec005a000, 2000, 0)
ffffff00078e3690 kalloca+0x20c(1000, 1000, 1, 0, fffffffed17f5028)
ffffff00078e3710 i_ddi_mem_alloc+0x17a(fffffffec01f93e8, fffffffed17f5028, d, 1, 10,
ffffff00078e38a8, fffffffec8895d18, 0, fffffffed6bfa8c0)
ffffff00078e37d0 ddi_dma_mem_alloc+0x256(fffffffed17f5000, d, ffffff00078e38a8, 10, 1
, 0, fffffffec8895d18, ffffff00078e3838, fffffffec8895cd8)
ffffff00078e38d0 ehci_create_transfer_wrapper+0x109(fffffffec00b6000,
fffffffec1ab7b80, d, 100)
ffffff00078e3930 ehci_allocate_tw_resources+0x38(fffffffec00b6000, fffffffec1ab7b80,
d, 100, 1)
ffffff00078e3960 ehci_allocate_bulk_resources+0x51(fffffffec00b6000, fffffffec1ab7b80
, fffffffee5d00790, 100)
ffffff00078e39d0 ehci_hcdi_pipe_bulk_xfer+0x78(fffffffec179b540, fffffffee5d00790,
100)
ffffff00078e3a40 usb_pipe_bulk_xfer+0xe6(fffffffec19e2e98, fffffffee5d00790, 100)
ffffff00078e3a80 scsa2usb_handle_status_start+0x7c(fffffffec1a62040, fffffffee5d00790
)
ffffff00078e3ad0 scsa2usb_bulk_only_transport+0x139(fffffffec1a62040,
fffffffec2077598)
ffffff00078e3b10 scsa2usb_cmd_transport+0x114(fffffffec1a62040, fffffffec2077598)
ffffff00078e3b60 scsa2usb_transport_request+0x52(fffffffec1a62040, 0)
ffffff00078e3bc0 scsa2usb_work_thread+0xa3(fffffffec1a62040)
ffffff00078e3c60 taskq_d_thread+0xbb(fffffffec21f47b0)
ffffff00078e3c70 thread_start+8()
Maybe the ehci_int_mutex could be temporarily dropped in
ehci_create_transfer_wrapper(), while we're trying to
allocate memory with DDI_DMA_SLEEP / KM_SLEEP?
Frequency
Occasionally
Regression
Solaris 10
Steps to Reproduce
Configure snv_63 x86 system as an amanda backup server, and try to use it to
backup huge amounts of data to an usb2.0 hdd.
Expected Result
System keeps running.
Actual Result
Occasionally, box hangs and needs to be power cycled.
USB console keyboard becomes unusable.
(But a PS/2 keyboard can be used to break into kmdb)
Error Message(s)
Test Case
Workaround
Suggested fix:
==============
diff -r 3e0ae05d7190 usr/src/uts/common/io/usb/hcd/ehci/ehci_xfer.c
--- a/usr/src/uts/common/io/usb/hcd/ehci/ehci_xfer.cThu Apr 12 23:27:05 2007 -0700
+++ b/usr/src/uts/common/io/usb/hcd/ehci/ehci_xfer.cMon Apr 16 15:20:35 2007 +0200
@@ -2920,7 +2920,13 @@ ehci_allocate_tw_resources(
{
ehci_trans_wrapper_t*tw;
+ASSERT(mutex_owned(&ehcip->ehci_int_mutex));
+
+mutex_exit(&ehcip->ehci_int_mutex);
+
tw = ehci_create_transfer_wrapper(ehcip, pp, tw_length, usb_flags);
+
+mutex_enter(&ehcip->ehci_int_mutex);
if (tw == NULL) {
USB_DPRINTF_L2(PRINT_MASK_LISTS, ehcip->ehci_log_hdl,
@@ -2996,7 +3002,7 @@ ehci_create_transfer_wrapper(
"ehci_create_transfer_wrapper: length = 0x%lx flags = 0x%x",
length, usb_flags);
-ASSERT(mutex_owned(&ehcip->ehci_int_mutex));
+ASSERT(!mutex_owned(&ehcip->ehci_int_mutex));
/* SLEEP flag should not be used in interrupt context */
if (servicing_interrupt()) {
diff -r 3e0ae05d7190 usr/src/uts/common/io/usb/hcd/openhci/ohci.c
--- a/usr/src/uts/common/io/usb/hcd/openhci/ohci.cThu Apr 12 23:27:05 2007 -0700
+++ b/usr/src/uts/common/io/usb/hcd/openhci/ohci.cMon Apr 16 15:23:13 2007 +0200
@@ -6733,7 +6733,13 @@ ohci_allocate_tw_resources(
{
ohci_trans_wrapper_t*tw;
+ASSERT(mutex_owned(&ohcip->ohci_int_mutex));
+
+mutex_exit(&ohcip->ohci_int_mutex);
+
tw = ohci_create_transfer_wrapper(ohcip, pp, tw_length, usb_flags);
+
+mutex_enter(&ohcip->ohci_int_mutex);
if (tw == NULL) {
USB_DPRINTF_L2(PRINT_MASK_LISTS, ohcip->ohci_log_hdl,
@@ -6805,7 +6811,7 @@ ohci_create_transfer_wrapper(
"ohci_create_transfer_wrapper: length = 0x%lx flags = 0x%x",
length, usb_flags);
-ASSERT(mutex_owned(&ohcip->ohci_int_mutex));
+ASSERT(!mutex_owned(&ohcip->ohci_int_mutex));
/* isochronous pipe should not call into this function */
if ((ph->p_ep.bmAttributes & USB_EP_ATTR_MASK) ==
diff -r 3e0ae05d7190 usr/src/uts/common/io/usb/hcd/uhci/uhciutil.c
--- a/usr/src/uts/common/io/usb/hcd/uhci/uhciutil.cThu Apr 12 23:27:05 2007 -0700
+++ b/usr/src/uts/common/io/usb/hcd/uhci/uhciutil.cMon Apr 16 15:32:24 2007 +0200
@@ -1569,8 +1569,10 @@ uhci_insert_intr_td(
"uhci_insert_intr_td: length: 0x%lx", length);
/* Allocate a transaction wrapper */
-if ((tw = uhci_create_transfer_wrapper(uhcip, pp, length, flags)) ==
- NULL) {
+mutex_exit(&uhcip->uhci_int_mutex);
+tw = uhci_create_transfer_wrapper(uhcip, pp, length, flags);
+mutex_enter(&uhcip->uhci_int_mutex);
+if (tw == NULL) {
USB_DPRINTF_L2(PRINT_MASK_LISTS, uhcip->uhci_log_hdl,
"uhci_insert_intr_td: TW allocation failed");
@@ -1744,7 +1746,7 @@ uhci_create_transfer_wrapper(
"uhci_create_transfer_wrapper: length = 0x%lx flags = 0x%x",
length, usb_flags);
-ASSERT(mutex_owned(&uhcip->uhci_int_mutex));
+ASSERT(!mutex_owned(&uhcip->uhci_int_mutex));
/* isochronous pipe should not call into this function */
if (UHCI_XFER_TYPE(&ph->p_ep) == USB_EP_ATTR_ISOCH) {
@@ -2151,8 +2153,10 @@ uhci_insert_ctrl_td(
}
/* Allocate a transaction wrapper */
-if ((tw = uhci_create_transfer_wrapper(uhcip, pp,
- ctrl_buf_size, flags)) == NULL) {
+mutex_exit(&uhcip->uhci_int_mutex);
+tw = uhci_create_transfer_wrapper(uhcip, pp, ctrl_buf_size, flags);
+mutex_enter(&uhcip->uhci_int_mutex);
+if (tw == NULL) {
USB_DPRINTF_L2(PRINT_MASK_LISTS, uhcip->uhci_log_hdl,
"uhci_insert_ctrl_td: TW allocation failed");
@@ -2801,8 +2805,10 @@ uhci_insert_bulk_td(
/*
* Create transfer wrapper
*/
-if ((tw = uhci_create_transfer_wrapper(uhcip, pp, req->bulk_len,
- flags)) == NULL) {
+mutex_exit(&uhcip->uhci_int_mutex);
+tw = uhci_create_transfer_wrapper(uhcip, pp, req->bulk_len, flags);
+mutex_enter(&uhcip->uhci_int_mutex);
+if (tw == NULL) {
USB_DPRINTF_L2(PRINT_MASK_LISTS, uhcip->uhci_log_hdl,
"uhci_insert_bulk_td: TW allocation failed");
Submitter wants to work on bug
Yes
Additional configuration information
- ASUS M2NPV-VM / 4GB memory
- % psrinfo -vp
The physical processor has 2 virtual Prozessoren (0 1)
x86 (AuthenticAMD 40F32 family 15 model 67 step 2 clock 2600 MHz)
AMD Athlon(tm) 64 X2 Dual Core Processor 5200+
- Maxtor 300GB USB2.0 hdd
|