From owner-freebsd-usb@FreeBSD.ORG Mon Mar 12 08:44:46 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4097F1065672; Mon, 12 Mar 2012 08:44:46 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe05.c2i.net [212.247.154.130]) by mx1.freebsd.org (Postfix) with ESMTP id 5ABB68FC0C; Mon, 12 Mar 2012 08:44:45 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [176.74.212.201] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe05.swip.net (CommuniGate Pro SMTP 5.4.2) with ESMTPA id 247306345; Mon, 12 Mar 2012 09:17:00 +0100 From: Hans Petter Selasky To: Brandon Gooch Date: Mon, 12 Mar 2012 09:15:18 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.3-PRERELEASE; KDE/4.4.5; amd64; ; ) References: In-Reply-To: X-Face: 'mmZ:T{)),Oru^0c+/}w'`gU1$ubmG?lp!=R4Wy\ELYo2)@'UZ24N@d2+AyewRX}mAm; Yp |U[@, _z/([?1bCfM{_"B<.J>mICJCHAzzGHI{y7{%JVz%R~yJHIji`y>Y}k1C4TfysrsUI -%GU9V5]iUZF&nRn9mJ'?&>O MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201203120915.18908.hselasky@c2i.net> Cc: Alexander Motin , Nathan Whitehorn , "freebsd-usb@freebsd.org" Subject: Re: Ongoing battle with umass(4) and xhci(4) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2012 08:44:46 -0000 > > Is there something fishy happening between the USB stack and CAM? hmmm... > No, It is not the CAM layer this time, though there are some bugs there too. In the beginning of the log I see that in the successful case we receive a stall event: -xhci_check_transfer: slot=1 epno=3 remainder=13 status=6 -xhci_check_transfer: TD is last -xhci_cmd_stop_ep: -xhci_check_command: Received command event -xhci_configure_reset_endpoint: Could not stop endpoint 3 -xhci_cmd_reset_ep: -xhci_check_command: Received command event -xhci_cmd_set_tr_dequeue_ptr: -xhci_check_command: Received command event -xhci_cmd_evaluate_ctx: -xhci_check_command: Received command event -xhci_cmd_configure_ep: -xhci_check_command: Received command event -xhci_configure_reset_endpoint: Could not configure endpoint 3 -xhci_ep_clear_stall: -xhci_device_generic_enter: -xhci_setup_generic_chain_sub: NTRB=1 -xhci_setup_generic_chain_sub: LINK=0x82883180 -xhci_setup_generic_chain_sub: NTRB=1 -xhci_setup_generic_chain_sub: LINK=0x82883000 -xhci_setup_generic_chain: first=0xffffff8460883300 last=0xffffff8460883180 -xhci_device_generic_start: -xhci_transfer_insert: qh_pos = 1 -xhci_check_transfer: slot=1 epno=1 remainder=0 status=1 -xhci_check_transfer: slot=1 epno=1 remainder=0 status=1 -xhci_check_transfer: Following next TD -xhci_check_transfer: slot=1 epno=1 remainder=0 status=1 -xhci_check_transfer: slot=1 epno=1 remainder=0 status=1 -xhci_check_transfer: TD is last This is not received in the failing case. Maybe this indicates a lost interrupt or something like that? In /sys/dev/usb/controller/xhci.c static void xhci_interrupt_poll(struct xhci_softc *sc) Add a printf: if (i == XHCI_MAX_EVENTS) { i = 0; j ^= 1; /* check for timeout */ if (!--t) { + printf("XHCI: Timeout\n"); break; } } See if what happens. Also change the xhci.c code to call xhci_interrupt_poll() two times instead of one. --HPS