Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754812AbcKJIiC (ORCPT ); Thu, 10 Nov 2016 03:38:02 -0500 Received: from mail-sn1nam01on0061.outbound.protection.outlook.com ([104.47.32.61]:31422 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752287AbcKJIh7 (ORCPT ); Thu, 10 Nov 2016 03:37:59 -0500 Authentication-Results: spf=none (sender IP is 192.88.168.50) smtp.mailfrom=lvd5587.freescale.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=nxp.com; X-IncomingTopHeaderMarker: OriginalChecksum:;UpperCasedChecksum:;SizeAsReceived:1022;Count:11 From: Sriram Dash To: , CC: , , , , , , Arnd Bergmann , Sriram Dash Subject: [PATCH v3 4/6] usb: xhci: use bus->sysdev for DMA configuration Date: Thu, 10 Nov 2016 13:49:59 +0530 Message-ID: <1478766001-26463-5-git-send-email-sriram.dash@nxp.com> X-Mailer: git-send-email 1.7.7.4 In-Reply-To: <1478766001-26463-1-git-send-email-sriram.dash@nxp.com> References: <1478766001-26463-1-git-send-email-sriram.dash@nxp.com> X-IncomingHeaderCount: 11 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131232397512502873;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Forefront-Antispam-Report: CIP:192.88.168.50;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6039001)(6009001)(7916002)(2980300002)(428002)(189002)(199003)(5660300001)(33646002)(36756003)(50226002)(960300001)(5003940100001)(356003)(45336002)(48376002)(8676002)(103686003)(105586002)(106466001)(189998001)(46386002)(8666005)(2906002)(52956003)(8936002)(6666003)(47776003)(626004)(87936001)(68736007)(2950100002)(42882006)(4326007)(101416001)(7416002)(586003)(90966002)(81156014)(86372001)(81166006)(76176999)(92566002)(50986999)(50466002)(42186005)(7846002)(5001770100001)(305945005)(4720700003)(97736004)(7059030);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR03MB2893;H:tx30smr01.am.freescale.net;FPR:;SPF:None;PTR:InfoDomainNonexistent;MX:1;A:0;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11FD029;1:uCAKqs0yjnb+KPLjaPD/uhrF8wynQpXMapNfTBe1OO8xL5L7G+9DE3l//8GPlMOVgvYkD8dLlvvHJvK+bH41pEV6fi/0FNTn4URYsUXWWvXyY9J9PK7jR/CeEgAYWUdVtJAAGSKohVIQjyZOEB/mnaRmlzRSC408EEvF4o/QNRikQqeSWvMOWDZeit8bS6ziaxP99HMbJnDAGOXOMB8KCFdY2E+dNF2cCzEpdoanEnsik2Z+x2LxmklvXpWN24QzRaEAbH1sn/FBhytbwzhIXoIc/2NLeuRKhhhhbIGRtJz5XRRM4HDxgJhHR0QedBuunXVBQTj0umg0FUehXRBKauBk/Po+LWuCEbSBm9/+21X3+RfYkHf9auAj3oyKZ/7pHgp0Tu//tryhZEYnp1y0/gy2TANmD3N2yZfthKehlTFDpS1721b9pL306YHKtIR6YkQEPG0siDZUhZpDww2LnJaubNENlMuPURu93+SXSGjDgw7Cq6Hdpt4fAlpemAH+lUU1f2tcFls/Ke8qFOJgRvDckw7zmtjcXN7JSZEYybj89nty3yan7gFpQ8/u1V9S/VwE2fyHLMqgtdQPwr7TEFZv1KZi7TekF6FYynaToC6tweCLMV2ZFO8SLnWIUpTxb9rowF3HQPY/RJHtaSzHWQ== MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;MWHPR03MB2893;2:en6+Y7PKYivkUtUrxjFRw8vTxOjqWQr9t7jIwLThcUamm05ZxThnC0XdICkBc4ooRUL+tWt7Zy3Bh9EWJXrvKPJar5znn6QWogDzUHotcj+bH6FOJA/uLbQvNs/x2iVxEs5xI/F7Li/V9HIVFODDF5Ok94YDtqgxGQz37CKM5IY=;3:uWV6CACoToIU0qWVPJloDi9wpnkMNjBpNBHFd0KbMY/nbgXSMvDj7sM5E0NiDR0gi/y/Wl0G5psqzuDo6NWuGclCa/rns3q2usSRtgMsShQ9Ww2N6Keev4q/TdmEYPJLtNUb2IUrdHECmW64hUlPWsT4MVe63pbkJoPHTZPgTLCDVf3uCcoJLAgT7EpfFt5ZNHHeY1HcmIywazGZ8N/Qr3hclnvIB3aZP0WyfiCMNVpnr455u6bLs75cmBfdaZgbzllWzTnigtO65sUa3lA2xQ== X-MS-Office365-Filtering-Correlation-Id: 5850c1fe-bae7-430d-6e59-08d40942b738 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:MWHPR03MB2893; X-Microsoft-Exchange-Diagnostics: 1;MWHPR03MB2893;25:bdGkAucuSyOhpu7qEIRcAKPOMMIlwYyXOUXox6RJyrRLwxiGaZjgEdyqhB+wq/nMADQj+v/rLODxgyEt2asZs9do0EmLAkce+ruEl3R2BITXWR6xw0Crs+3Ned8L9xWgGaOTPNYx626JWdXX0x5hnLyWpTtBC4SXAl5Wd/b3687iSoNfgaeH06OLumozWiGAmRDyY+HsNbDqKuP9D6jhCCXXKvrglcP6JqevVzY8JB8/1aVtXPb4+F7RlTcMNW61YuOL3LmnXzVYVVlLadpGKizjN05OlDU0fUGvmm+qDUS9qGhX0YQal/3Hh3hfGLgX2qEsKGQFJcet/ffgLeii2jzTvrX9lSWdpSI8YaAR3tu59Km9UJ7Xy15RXfS5LyVZQr75yd/MpsAvVCOEC5jkBVImqdl5gpyYu6MHruXJDyOfVrKvx7XahfV3dwwnmyJN1AwBHZyJdWuZbDHtDaypqYWEB4pv3Jo2mYGADnVA2omDd/o7pr19oQzU9s/gWRCcNTybqeMbbHoF9ifqGVF10cnt3IxfoX+ToRnflONF8aM0pxYEwsrka0t7LTY+EimH4cXsL3NycLKgx1vR7QF//9mtRbfviSG71FfTBhMiygYNBQipZ53ViMc63j3XLQwEv7cm3+JVV9s4Ljy52cTBZm/D+mmmTgyhzfUv8g2voKim7IBYC7uZB4R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test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(5005006)(13023025)(8121501046)(13024025)(13017025)(13015025)(13018025)(3002001)(10201501046)(6055026);SRVR:MWHPR03MB2893;BCL:0;PCL:0;RULEID:(400006);SRVR:MWHPR03MB2893; X-Forefront-PRVS: 01221E3973 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;MWHPR03MB2893;23:MzeYGj+t1DlhhzDvYEeDToZpxBSwwi9w8hyjXl1rg?= =?us-ascii?Q?7UcH1WXalK94suCfYP0blPLJDDzLfBxMw4SXYHtEyP0GGL9l+SNzOjkNLvKU?= =?us-ascii?Q?h0rHNYLYpJb1+vFARHfH8rKEah7bUsiBZPtJLBk7BeoNszy88qiuhUOGPMmb?= =?us-ascii?Q?urKOCWt5hzlHicB+BTyTgHn0Mr3OuKq2PLCWwgc6W6YEAgHRMvfR2DQHlWvx?= =?us-ascii?Q?bao59+BG6bsmOnm5xhDIId0WrqrpQqrX0Q8c7uG2soUEtKFGmPyABTtPX9LE?= =?us-ascii?Q?gmG7BEtJSDSRJTqJ4r9Yx5UPPPtWFb5H5F2GBtLFFmGTLzS/qiz7bqWv6tzt?= =?us-ascii?Q?HQpA4VosZlCMNyCjHnCHqXu6K+Bfd5UV6k0KZccXSomMkZL5/3srqfG2tmuv?= =?us-ascii?Q?pTrvhLAIKp2iRmttxBype+ya/6mNyovwtQZ8w7zx76wODSznWw9olvSLJN5t?= =?us-ascii?Q?9SPmhoZ6BoaBgoh7zjiKEn+lkVFO98zq9Q5FKBeDfzIUYwTW+GZuR7qw1cUx?= =?us-ascii?Q?bCdjALDIm43Clo8CnAv20dRAQLVYHdu2WSH+8GZpthH2iwKkQefciOvUi/tK?= =?us-ascii?Q?l9o9OvV4O6FwDGO5bWEA+02NwV/SzD8GIswe74xgIemQgeSj0hmR71/M56q1?= =?us-ascii?Q?bxvjic1fqsjvjyz4+70H2QiuoGuPgBZShSinIYGc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X9EnGo0fDv6i2SR/RXSUUL7lGfFSBPF94J4QF7b8DQAAQmjgON2L43wdCINVCXZDIjcve962PQ4Ol2jI57cR8SJd85OkPM06zi0EPH7B3ThfvUdzs8kPREenMGayVQsTGt+jXwSHJ3gchnclANd8n4PuNW0qV/xYS58pb/tfy521ioC0C+8S0ogr;24:v3irV86ctNaBIJkcaxVxzDqAAj6R2a2gF7/hYLz504s30XWjg3WH/lPbobs9L4N8R+i+hP04FpNrbDU26KMlUXD6j5gKwnuNbegMXoUTb+8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;MWHPR03MB2893;7:9CsQdXh2qSGOMrMNAQXeYtQ6iDh5qkfL7Qg3cWG/0NchAkSd02a+i6Wz17PjScx6nx4psMiota+wDCDtMXM/5q0bL19XRH0vrQbOcrmoDinkLCV8awX5YcYZQ6Av7KnMMxMHwPRKp7XYkWQOShfdW/hPIJCSFokhY5tkuwkhZg+7stlSd3y6qIkDXcE/jb3upmhBTQXvcfC1NJs8UGF3c7sQSdmfir6xvI7ahq4WmF7fl65Rnz/GtG+xa3rNUUI+2q1fIrcNBAZ1SSrqENWOHD7W+0mHMHwvQSdn494f6DJOampcpGyAJl5vUgscZ6peE16V7CXDi1ucdXQCp51UMT5sww0W3D2cL5bPI0deofI= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2016 08:22:31.0786 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR03MB2893 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 7473 Lines: 216 From: Arnd Bergmann For xhci-hcd platform device, all the DMA parameters are not configured properly, notably dma ops for dwc3 devices. So, set the dma for xhci from sysdev. sysdev is pointing to device that is known to the system firmware or hardware. Signed-off-by: Arnd Bergmann Signed-off-by: Sriram Dash --- Changes in v3: - No update Changes in v2: - Separate out xhci driver changes apart drivers/usb/host/xhci-mem.c | 12 ++++++------ drivers/usb/host/xhci-plat.c | 33 ++++++++++++++++++++++++++------- drivers/usb/host/xhci.c | 15 +++++++++++---- 3 files changed, 43 insertions(+), 17 deletions(-) diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 6afe323..79608df 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c @@ -586,7 +586,7 @@ static void xhci_free_stream_ctx(struct xhci_hcd *xhci, unsigned int num_stream_ctxs, struct xhci_stream_ctx *stream_ctx, dma_addr_t dma) { - struct device *dev = xhci_to_hcd(xhci)->self.controller; + struct device *dev = xhci_to_hcd(xhci)->self.sysdev; size_t size = sizeof(struct xhci_stream_ctx) * num_stream_ctxs; if (size > MEDIUM_STREAM_ARRAY_SIZE) @@ -614,7 +614,7 @@ static struct xhci_stream_ctx *xhci_alloc_stream_ctx(struct xhci_hcd *xhci, unsigned int num_stream_ctxs, dma_addr_t *dma, gfp_t mem_flags) { - struct device *dev = xhci_to_hcd(xhci)->self.controller; + struct device *dev = xhci_to_hcd(xhci)->self.sysdev; size_t size = sizeof(struct xhci_stream_ctx) * num_stream_ctxs; if (size > MEDIUM_STREAM_ARRAY_SIZE) @@ -1644,7 +1644,7 @@ void xhci_slot_copy(struct xhci_hcd *xhci, static int scratchpad_alloc(struct xhci_hcd *xhci, gfp_t flags) { int i; - struct device *dev = xhci_to_hcd(xhci)->self.controller; + struct device *dev = xhci_to_hcd(xhci)->self.sysdev; int num_sp = HCS_MAX_SCRATCHPAD(xhci->hcs_params2); xhci_dbg_trace(xhci, trace_xhci_dbg_init, @@ -1716,7 +1716,7 @@ static void scratchpad_free(struct xhci_hcd *xhci) { int num_sp; int i; - struct device *dev = xhci_to_hcd(xhci)->self.controller; + struct device *dev = xhci_to_hcd(xhci)->self.sysdev; if (!xhci->scratchpad) return; @@ -1792,7 +1792,7 @@ void xhci_free_command(struct xhci_hcd *xhci, void xhci_mem_cleanup(struct xhci_hcd *xhci) { - struct device *dev = xhci_to_hcd(xhci)->self.controller; + struct device *dev = xhci_to_hcd(xhci)->self.sysdev; int size; int i, j, num_ports; @@ -2334,7 +2334,7 @@ static int xhci_setup_port_arrays(struct xhci_hcd *xhci, gfp_t flags) int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) { dma_addr_t dma; - struct device *dev = xhci_to_hcd(xhci)->self.controller; + struct device *dev = xhci_to_hcd(xhci)->self.sysdev; unsigned int val, val2; u64 val_64; struct xhci_segment *seg; diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index ed56bf9..beb95c8 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -139,6 +140,7 @@ static int xhci_plat_probe(struct platform_device *pdev) { const struct of_device_id *match; const struct hc_driver *driver; + struct device *sysdev; struct xhci_hcd *xhci; struct resource *res; struct usb_hcd *hcd; @@ -155,22 +157,39 @@ static int xhci_plat_probe(struct platform_device *pdev) if (irq < 0) return -ENODEV; + /* + * sysdev must point to a device that is known to the system firmware + * or PCI hardware. We handle these three cases here: + * 1. xhci_plat comes from firmware + * 2. xhci_plat is child of a device from firmware (dwc3-plat) + * 3. xhci_plat is grandchild of a pci device (dwc3-pci) + */ + sysdev = &pdev->dev; + if (sysdev->parent && !sysdev->of_node && sysdev->parent->of_node) + sysdev = sysdev->parent; +#ifdef CONFIG_PCI + else if (sysdev->parent && sysdev->parent->parent && + sysdev->parent->parent->bus == &pci_bus_type) + sysdev = sysdev->parent->parent; +#endif + /* Try to set 64-bit DMA first */ - if (WARN_ON(!pdev->dev.dma_mask)) + if (WARN_ON(!sysdev->dma_mask)) /* Platform did not initialize dma_mask */ - ret = dma_coerce_mask_and_coherent(&pdev->dev, + ret = dma_coerce_mask_and_coherent(sysdev, DMA_BIT_MASK(64)); else - ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); + ret = dma_set_mask_and_coherent(sysdev, DMA_BIT_MASK(64)); /* If seting 64-bit DMA mask fails, fall back to 32-bit DMA mask */ if (ret) { - ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); + ret = dma_set_mask_and_coherent(sysdev, DMA_BIT_MASK(32)); if (ret) return ret; } - hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev)); + hcd = __usb_create_hcd(driver, sysdev, &pdev->dev, + dev_name(&pdev->dev), NULL); if (!hcd) return -ENOMEM; @@ -220,13 +239,13 @@ static int xhci_plat_probe(struct platform_device *pdev) goto disable_clk; } - if (device_property_read_bool(&pdev->dev, "usb3-lpm-capable")) + if (device_property_read_bool(sysdev, "usb3-lpm-capable")) xhci->quirks |= XHCI_LPM_SUPPORT; if (HCC_MAX_PSA(xhci->hcc_params) >= 4) xhci->shared_hcd->can_do_streams = 1; - hcd->usb_phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy", 0); + hcd->usb_phy = devm_usb_get_phy_by_phandle(sysdev, "usb-phy", 0); if (IS_ERR(hcd->usb_phy)) { ret = PTR_ERR(hcd->usb_phy); if (ret == -EPROBE_DEFER) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 1a4ca02..6ce610b 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -231,6 +231,9 @@ static int xhci_free_msi(struct xhci_hcd *xhci) static int xhci_setup_msi(struct xhci_hcd *xhci) { int ret; + /* + * TODO:Check with MSI Soc for sysdev + */ struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller); ret = pci_enable_msi(pdev); @@ -257,7 +260,7 @@ static int xhci_setup_msi(struct xhci_hcd *xhci) */ static void xhci_free_irq(struct xhci_hcd *xhci) { - struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller); + struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.sysdev); int ret; /* return if using legacy interrupt */ @@ -743,7 +746,7 @@ void xhci_shutdown(struct usb_hcd *hcd) struct xhci_hcd *xhci = hcd_to_xhci(hcd); if (xhci->quirks & XHCI_SPURIOUS_REBOOT) - usb_disable_xhci_ports(to_pci_dev(hcd->self.controller)); + usb_disable_xhci_ports(to_pci_dev(hcd->self.sysdev)); spin_lock_irq(&xhci->lock); xhci_halt(xhci); @@ -760,7 +763,7 @@ void xhci_shutdown(struct usb_hcd *hcd) /* Yet another workaround for spurious wakeups at shutdown with HSW */ if (xhci->quirks & XHCI_SPURIOUS_WAKEUP) - pci_set_power_state(to_pci_dev(hcd->self.controller), PCI_D3hot); + pci_set_power_state(to_pci_dev(hcd->self.sysdev), PCI_D3hot); } #ifdef CONFIG_PM @@ -4832,7 +4835,11 @@ int xhci_get_frame(struct usb_hcd *hcd) int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks) { struct xhci_hcd *xhci; - struct device *dev = hcd->self.controller; + /* + * TODO: Check with DWC3 clients for sysdev according to + * quirks + */ + struct device *dev = hcd->self.sysdev; int retval; /* Accept arbitrarily long scatter-gather lists */ -- 2.1.0