Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753361AbbDUHC4 (ORCPT ); Tue, 21 Apr 2015 03:02:56 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:35068 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751495AbbDUHCv (ORCPT ); Tue, 21 Apr 2015 03:02:51 -0400 Message-ID: <5535F606.2070000@ti.com> Date: Tue, 21 Apr 2015 10:02:30 +0300 From: Roger Quadros User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Alan Stern CC: Peter Chen , , , , , , , , , Subject: Re: [RFC][PATCH v2 06/13] usb: hcd: Add hcd add/remove functions for OTG use References: In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1145 Lines: 28 On 20/04/15 16:56, Alan Stern wrote: > On Mon, 20 Apr 2015, Roger Quadros wrote: > >>> I don't understand this. Why do you want to defer the add/remove if >>> the device is OTG? Don't host controller drivers expect these things >>> to execute synchronously? >> >> Sorry for the wrong information. We actually defer only the add as the >> OTG state machine might not yet be in Host ready mode. >> The remove is always synchronous and we ensure that the HCD is removed >> when usb_otg_unregister_hcd() returns. > > That's okay then, but it does leave one potential hole. What happens > if usb_add_hcd() is deferred for so long that usb_remove_hcd() gets > called before the add can complete? We keep track of the HCD state in the OTG state machine and if it was not yet added then _usb_remove_hcd() is not called during usb_otg_unregister_hcd() in the usb_remove_hcd() call. cheers, -roger -- 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/