Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752749AbbBMIxF (ORCPT ); Fri, 13 Feb 2015 03:53:05 -0500 Received: from mga03.intel.com ([134.134.136.65]:19454 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752042AbbBMIxD (ORCPT ); Fri, 13 Feb 2015 03:53:03 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,569,1418112000"; d="scan'208";a="454112585" Message-ID: <54DDBBB0.7070602@linux.intel.com> Date: Fri, 13 Feb 2015 10:54:08 +0200 From: Mathias Nyman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Alan Stern , Mathias Nyman , Sneeker Yeh CC: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Felipe Balbi , Greg Kroah-Hartman , Grant Likely , Huang Rui , Kishon Vijay Abraham I , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, Andy Green , Jassi Brar , Sneeker Yeh Subject: Re: [PATCH v3 1/5] xhci: add a quirk for device disconnection errata for Synopsis Designware USB3 core References: In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2135 Lines: 51 On 12.02.2015 17:18, Alan Stern wrote: > On Thu, 12 Feb 2015, Mathias Nyman wrote: > >> On 25.01.2015 10:13, Sneeker Yeh wrote: >>> This issue is defined by a three-way race at disconnect, between >>> 1) Class driver interrupt endpoint resheduling attempts if the ISR gave an ep >>> error event due to device detach (it would try 3 times) >>> 2) Disconnect interrupt on PORTSC_CSC, which is cleared by hub thread >>> asynchronously >>> 3) The hardware IP was configured in silicon with >>> - DWC_USB3_SUSPEND_ON_DISCONNECT_EN=1 >>> - Synopsys IP version is < 3.00a >>> The IP will auto-suspend itself on device detach with some phy-specific interval >>> after CSC is cleared by 2) >>> >>> If 2) and 3) complete before 1), the interrupts it expects will not be generated >>> by the autosuspended IP, leading to a deadlock. Even later disconnection >>> procedure would detect that corresponding urb is still in-progress and issue a >>> ep stop command, auto-suspended IP still won't respond to that command. > > If the Synopsys IP provides a way to do it, it would be better to turn > off the autosuspend feature entirely. Doesn't autosuspend violate the > xHCI specification? > >> So did I understand correctly that the class driver submits a new urb which >> is enqueued by xhci_urb_enqueue() before the hub thread notices the device is disconnected. >> Then hub thread clears CSC bit, controller suspends and the new urb is never given back? >> >> Doesn't the CSC bit and PORT_CONNECT bit show the device is disconnected when we enter >> xhci_enqueue_urb(), even it the hub thread doesn't know this yet? > > What if the device disconnects _after_ the new URB is enqueued? True, those URBs would be left hanging. So if possible, tweaking the Synopsis autosuspend feature would be nicer. If its not possible then I guess a quirk patch like this will do. -Mathias -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/