From patchwork Thu Oct 30 21:00:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Bresticker X-Patchwork-Id: 5200561 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AD7DC9F349 for ; Thu, 30 Oct 2014 21:03:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D81CC2014A for ; Thu, 30 Oct 2014 21:03:22 +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 01B5E20121 for ; Thu, 30 Oct 2014 21:03:22 +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 1Xjwq4-0007lO-TF; Thu, 30 Oct 2014 21:01:00 +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 1Xjwq2-0007ZR-CY for linux-arm-kernel@lists.infradead.org; Thu, 30 Oct 2014 21:00:59 +0000 Received: by mail-pa0-f73.google.com with SMTP id lj1so1058343pab.0 for ; Thu, 30 Oct 2014 14:00:36 -0700 (PDT) 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; bh=T3EmxDw/Sbe9lIlGhZwBAdSm0z5NFy/rJQtagNwKj8U=; b=QReqP588v5ZaFUQB/yuJA4JcH8iJpdlhf1HBhEIs9VrJ6sG9cOkF51LLxIhslqreZi jg7E/B4jAZ0YogNZa6cwPYuCuryCm62yIllXg/o8HnSqfF5Z4L++oMe67Iy6opN/gFyE TScmlf39J+EZaflywSByNdw0xKKwpWMV7/t+vnC6XO2EJm8hn3rAf7GVs5J6m0JzL2RK +RzwdirJdfQ6gL6kaIt0yN9j5bg0gCuXuL0Za8NiR4ehRXoW0aHO+nPmnqjTd51Uu50r 5XZqI7J3QlxNMqORsauv1RX1nCUjPv8d1mnjSkwT1A8AnP0xnbJ+LA8364rE08brDSgs jMYw== X-Gm-Message-State: ALoCoQmT5Yj/nXpOOTu87gzRHgnf3yWxSzNTR7K8ANh8AHIQ3wmVEJ9hmLxr/iTZTThkcZFllbJT X-Received: by 10.66.102.42 with SMTP id fl10mr13820336pab.45.1414702835759; Thu, 30 Oct 2014 14:00:35 -0700 (PDT) Received: from corpmail-nozzle1-1.hot.corp.google.com ([100.108.1.104]) by gmr-mx.google.com with ESMTPS id l45si479322yha.2.2014.10.30.14.00.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Oct 2014 14:00:35 -0700 (PDT) Received: from abrestic.mtv.corp.google.com ([172.22.65.70]) by corpmail-nozzle1-1.hot.corp.google.com with ESMTP id rxwURYdE.1; Thu, 30 Oct 2014 14:00:35 -0700 Received: by abrestic.mtv.corp.google.com (Postfix, from userid 137652) id 95468220EB2; Thu, 30 Oct 2014 14:00:34 -0700 (PDT) From: Andrew Bresticker To: Mathias Nyman , Greg Kroah-Hartman Subject: [PATCH] xhci: Set shared HCD's hcd_priv in xhci_gen_setup Date: Thu, 30 Oct 2014 14:00:33 -0700 Message-Id: <1414702833-29156-1-git-send-email-abrestic@chromium.org> X-Mailer: git-send-email 2.1.0.rc2.206.gedb03e5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141030_140058_446163_697A75F6 X-CRM114-Status: GOOD ( 13.29 ) X-Spam-Score: -1.3 (-) Cc: Andrew Bresticker , Thierry Reding , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org 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.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 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 --- 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 280dde9..dc0022c 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c @@ -231,11 +231,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; }