Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755957AbbDGOWC (ORCPT ); Tue, 7 Apr 2015 10:22:02 -0400 Received: from mga03.intel.com ([134.134.136.65]:50934 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755908AbbDGOV6 (ORCPT ); Tue, 7 Apr 2015 10:21:58 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,538,1422950400"; d="scan'208";a="691459016" Message-ID: <5523E861.7060807@linux.intel.com> Date: Tue, 07 Apr 2015 17:23:29 +0300 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: Roger Quadros , mathias.nyman@intel.com CC: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/5] usb: xhci: cleanup xhci_hcd allocation References: <1427977409-7671-1-git-send-email-rogerq@ti.com> <1427977409-7671-2-git-send-email-rogerq@ti.com> In-Reply-To: <1427977409-7671-2-git-send-email-rogerq@ti.com> 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: 1478 Lines: 38 Hi On 02.04.2015 15:23, Roger Quadros wrote: > HCD core allocates memory for HCD private data in > usb_create_[shared_]hcd() so make use of that > mechanism to allocate the struct xhci_hcd. > > Introduce struct xhci_driver_overrides to provide > the size of HCD private data and hc_driver operation > overrides. As of now we only need to override the > reset and start methods. > > Signed-off-by: Roger Quadros I'm not sure I fully understand the what's going on, or what the intention of this patch is. So currently xhci driver manages the allocation and freeing of the xhci_hcd structure. We store a pointer to the xhci_hcd structure in the content of both the primary and shared usb_hcds structures hcd_priv field. With this patch xhci would be part of the usb_hcd structure, starting at hcd_priv[0]. (Like EHCI I think) It allocates enough space to include the xhci_hcd in both the primary and shared usb_hcd, but always only use the one in the primary hcd. I'm not sure what to do with the space allocated for the shared hcd's hcd_priv field. This also means that xhci goes away together with the primary hcd. It's possible this has some impact as the xhci driver expects xhci to always exists. -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/