From patchwork Tue Nov 25 00:17:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Bresticker X-Patchwork-Id: 5371071 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 822B9C11AC for ; Tue, 25 Nov 2014 00:20:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9E7B520158 for ; Tue, 25 Nov 2014 00:20:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B4F7F20154 for ; Tue, 25 Nov 2014 00:20:17 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xt3pJ-0005qI-DO; Tue, 25 Nov 2014 00:17:53 +0000 Received: from mail-pa0-f73.google.com ([209.85.220.73]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xt3pF-0005m2-SP for linux-arm-kernel@lists.infradead.org; Tue, 25 Nov 2014 00:17:50 +0000 Received: by mail-pa0-f73.google.com with SMTP id lj1so1485731pab.4 for ; Mon, 24 Nov 2014 16:17:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KVFOqGRB+ifeQHCY8T1QYVYgY68gse5X/c9m7oyWiHQ=; b=BTJh1r73poY4sVsnLEwHTEhiUjt4B8VtB8QZk2JP4vrO9yDcBvYlI1vgGFh24O8JUr UC7lbRTRWGTZZLAXrzOhh2ABFtIiGJlNemroHJmH9TyF1DuvhH5OtZ+fiHy6qRl6q56Z BOd8QFwD+yFoG0AQ2mIWYhcCzsswe5jgwPnARevvVLAeH1dKvyWkxMt4iBwScs7tnI68 Em8uzfXu8rKdcJgKtKQ8H9/vbNtinI+BBlZEnv3sCmqJ0aySf16496pRRzweyA1UudAr 9k/EmED4pjo7C6wXUFRAJC2zJsjktmWUt1tVyAPQ2FZQpsYUxuHpNqmR+hzCfdkMhqjj lBKg== X-Gm-Message-State: ALoCoQmkA0wcw8kI2cmoD+sXCrjPamfKzTDcH0j0GE3zvcaITMI9myafWfcWcrP1ee0rNRarmwuq X-Received: by 10.67.23.33 with SMTP id hx1mr2306510pad.45.1416874649900; Mon, 24 Nov 2014 16:17:29 -0800 (PST) Received: from corpmail-nozzle1-2.hot.corp.google.com ([100.108.1.103]) by gmr-mx.google.com with ESMTPS id t24si513881yht.2.2014.11.24.16.17.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Nov 2014 16:17:29 -0800 (PST) Received: from abrestic.mtv.corp.google.com ([172.22.65.70]) by corpmail-nozzle1-2.hot.corp.google.com with ESMTP id GWROt0Hk.1; Mon, 24 Nov 2014 16:17:29 -0800 Received: by abrestic.mtv.corp.google.com (Postfix, from userid 137652) id C12DC2212CA; Mon, 24 Nov 2014 16:17:27 -0800 (PST) From: Andrew Bresticker To: Stephen Warren , Thierry Reding , Alexandre Courbot , linux-tegra@vger.kernel.org Subject: [PATCH V6 01/12] xhci: Set shared HCD's hcd_priv in xhci_gen_setup Date: Mon, 24 Nov 2014 16:17:13 -0800 Message-Id: <1416874644-12070-2-git-send-email-abrestic@chromium.org> X-Mailer: git-send-email 2.1.0.rc2.206.gedb03e5 In-Reply-To: <1416874644-12070-1-git-send-email-abrestic@chromium.org> References: <1416874644-12070-1-git-send-email-abrestic@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141124_161750_004571_1EE7CDC3 X-CRM114-Status: GOOD ( 14.25 ) X-Spam-Score: -0.7 (/) Cc: Mark Rutland , devicetree@vger.kernel.org, linux-usb@vger.kernel.org, Mathias Nyman , Pawel Moll , Ian Campbell , Andrew Bresticker , Greg Kroah-Hartman , Linus Walleij , Jassi Brar , linux-kernel@vger.kernel.org, Felipe Balbi , Kishon Vijay Abraham I , Olof Johansson , Rob Herring , Alan Stern , linux-arm-kernel@lists.infradead.org, Kumar Gala , Grant Likely , Arnd Bergmann X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP xhci_gen_setup() sets the hcd_priv field for the primary HCD, but not for the shared HCD, requiring xHCI host-controller drivers to set it between usb_create_shared_hcd() and usb_add_hcd(). There's no reason xhci_gen_setup() can't set the shared HCD's hcd_priv as well, so move that bit out of the host-controller drivers and into xhci_gen_setup(). Signed-off-by: Andrew Bresticker Reviewed-by: Felipe Balbi --- No changes from v5. New for v5. Peviously posted here: https://lkml.org/lkml/2014/10/30/726 --- drivers/usb/host/xhci-pci.c | 5 ----- drivers/usb/host/xhci-plat.c | 5 ----- drivers/usb/host/xhci.c | 6 +++--- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index 9a69b1f..31025e4 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c @@ -221,11 +221,6 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) goto dealloc_usb2_hcd; } - /* Set the xHCI pointer before xhci_pci_setup() (aka hcd_driver.reset) - * is called by usb_add_hcd(). - */ - *((struct xhci_hcd **) xhci->shared_hcd->hcd_priv) = xhci; - retval = usb_add_hcd(xhci->shared_hcd, dev->irq, IRQF_SHARED); if (retval) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 3d78b0c..5bc33bc 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -149,11 +149,6 @@ static int xhci_plat_probe(struct platform_device *pdev) if ((node && of_property_read_bool(node, "usb3-lpm-capable")) || (pdata && pdata->usb3_lpm_capable)) xhci->quirks |= XHCI_LPM_SUPPORT; - /* - * Set the xHCI pointer before xhci_plat_setup() (aka hcd_driver.reset) - * is called by usb_add_hcd(). - */ - *((struct xhci_hcd **) xhci->shared_hcd->hcd_priv) = xhci; if (HCC_MAX_PSA(xhci->hcc_params) >= 4) xhci->shared_hcd->can_do_streams = 1; diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 2a5d45b..ae05471 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -4843,9 +4843,9 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks) */ hcd->has_tt = 1; } else { - /* xHCI private pointer was set in xhci_pci_probe for the second - * registered roothub. - */ + xhci = hcd_to_xhci(hcd->primary_hcd); + *((struct xhci_hcd **) hcd->hcd_priv) = xhci; + return 0; }