devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Bresticker <abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
To: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
	Thierry Reding
	<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Alexandre Courbot
	<gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Andrew Bresticker
	<abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
	Mathias Nyman
	<mathias.nyman-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
Subject: [PATCH v8 1/9] xhci: Set shared HCD's hcd_priv in xhci_gen_setup
Date: Mon,  4 May 2015 10:36:34 -0700	[thread overview]
Message-ID: <1430761002-9327-2-git-send-email-abrestic@chromium.org> (raw)
In-Reply-To: <1430761002-9327-1-git-send-email-abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>

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 <abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Reviewed-by: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
Cc: Mathias Nyman <mathias.nyman-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
---
No changes from v5/v6/v7.
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 2af32e2..f9ce741 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -247,11 +247,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 783e819..852b1e9 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -147,11 +147,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 ec8ac16..2901a67 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -4849,9 +4849,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;
 	}
 
-- 
2.2.0.rc0.207.ga3a616c

  parent reply	other threads:[~2015-05-04 17:36 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-04 17:36 [PATCH v8 0/9] Tegra xHCI support Andrew Bresticker
     [not found] ` <1430761002-9327-1-git-send-email-abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2015-05-04 17:36   ` Andrew Bresticker [this message]
     [not found]     ` <1430761002-9327-2-git-send-email-abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2015-05-19 18:39       ` [PATCH v8 1/9] xhci: Set shared HCD's hcd_priv in xhci_gen_setup Andrew Bresticker
     [not found]         ` <CAL1qeaGo2-T=suBiCTtHmyR1sNeS_ZG-2j2FuuLdGc9vmct2ug-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-22 12:19           ` Mathias Nyman
2015-05-04 17:36   ` [PATCH v8 2/9] mailbox: Make mbox_chan_ops const Andrew Bresticker
     [not found]     ` <1430761002-9327-3-git-send-email-abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2015-05-04 19:22       ` Suman Anna
2015-05-04 17:36   ` [PATCH v8 3/9] mailbox: Fix up error handling in mbox_request_channel() Andrew Bresticker
2015-05-04 17:36   ` [PATCH v8 4/9] mfd: Add binding document for NVIDIA Tegra XUSB Andrew Bresticker
     [not found]     ` <1430761002-9327-5-git-send-email-abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2015-05-13 14:39       ` Lee Jones
2015-05-13 16:26         ` Andrew Bresticker
     [not found]           ` <CAL1qeaF-7aAx0gqPe-_D4ZaZET0Kejr801KrbvuQ_2w6c8mcnA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-13 16:50             ` Lee Jones
2015-05-13 17:03               ` Andrew Bresticker
     [not found]                 ` <CAL1qeaE7XHmreQ_b52iop6fOY1osAhjij81c4vVr7_8wO_cYxQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-14  7:29                   ` Lee Jones
2015-05-14  7:32                     ` Jon Hunter
     [not found]                       ` <55544F91.4060402-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-05-14  7:45                         ` Lee Jones
2015-05-14  7:20         ` Jon Hunter
     [not found]           ` <55544CC5.9050001-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-05-14  7:40             ` Lee Jones
2015-05-14  9:14               ` Jon Hunter
2015-05-14  9:30                 ` Lee Jones
2015-05-14 10:09                   ` Jon Hunter
     [not found]                     ` <5554746A.4000608-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-05-14 10:23                       ` Lee Jones
2015-05-14 11:21                         ` Jon Hunter
2015-05-14 17:38               ` Andrew Bresticker
     [not found]                 ` <CAL1qeaEqNejuGkN-ke11mtWnaaRo+XieCBkQ6+NQ-Afym6uxVA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-19 18:36                   ` Andrew Bresticker
     [not found]                     ` <CAL1qeaHy0h7bXhuLHh4AG2Zfu48JYeawgVo4dp_k4oX8YFw6tA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-20  6:35                       ` Lee Jones
2015-05-20 14:52                         ` Thierry Reding
     [not found]                           ` <20150520145227.GA3787-AwZRO8vwLAwmlAP/+Wk3EA@public.gmane.org>
2015-05-21  7:19                             ` Linus Walleij
2015-05-21  8:40                             ` Lee Jones
2015-05-21 10:12                               ` Thierry Reding
     [not found]                                 ` <20150521101247.GA8073-AwZRO8vwLAwmlAP/+Wk3EA@public.gmane.org>
2015-05-26 15:18                                   ` Lee Jones
2015-06-30 18:22                                     ` Grant Likely
2015-05-04 17:36   ` [PATCH v8 6/9] mailbox: Add NVIDIA Tegra XUSB mailbox binding Andrew Bresticker
     [not found]     ` <1430761002-9327-7-git-send-email-abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2015-05-08 20:42       ` Benson Leung
     [not found]         ` <CANLzEksWtzSmz=OCuwVdY5RSG6gDrOoMyGsW3i9jMcjD3WtPKQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-08 20:53           ` Andrew Bresticker
2015-05-08 21:03             ` Benson Leung
2015-05-04 17:36   ` [PATCH v8 7/9] mailbox: Add NVIDIA Tegra XUSB mailbox driver Andrew Bresticker
2015-05-04 17:36   ` [PATCH v8 8/9] usb: Add NVIDIA Tegra xHCI controller binding Andrew Bresticker
2015-05-04 17:36   ` [PATCH v8 9/9] usb: xhci: Add NVIDIA Tegra xHCI host-controller driver Andrew Bresticker
2015-05-12  3:56   ` [PATCH v8 0/9] Tegra xHCI support Jassi Brar
     [not found]     ` <CABb+yY2WhH2gGbCr4n=m9HOa_843MuZDp=QWNDHbtB8AMYYwYA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-26 16:27       ` Andrew Bresticker
2015-05-04 17:36 ` [PATCH v8 5/9] mfd: Add driver for NVIDIA Tegra XUSB Andrew Bresticker
     [not found]   ` <1430761002-9327-6-git-send-email-abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2015-05-13 14:37     ` Lee Jones
2015-05-13 16:31       ` Andrew Bresticker
2015-05-05 14:28 ` [PATCH v8 0/9] Tegra xHCI support Jon Hunter
2015-05-05 14:42   ` Thierry Reding
2015-05-05 14:57     ` Jon Hunter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1430761002-9327-2-git-send-email-abrestic@chromium.org \
    --to=abrestic-f7+t8e8rja9g9huczpvpmw@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mathias.nyman-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
    --cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).