From patchwork Mon Mar 13 02:18:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 9619703 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AE18760414 for ; Mon, 13 Mar 2017 02:51:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D6C128423 for ; Mon, 13 Mar 2017 02:51:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8DEBD28446; Mon, 13 Mar 2017 02:51:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 706B628423 for ; Mon, 13 Mar 2017 02:51:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EWhKZA5LycmCrrogerRHQBBeub3lLa4zXMuk83pqTsc=; b=SAIaNSyfM0KPo+ 6Z7LSg58rWiJuG6CJvgCDDMIAIGw4QXq24V98wq15svz3Qkf6224C7F9jVh9AJWahDvmR2vGIr8nz V9OC4PoKvxHiHJ7MfZ003eOkGhDHZsdUS85MD/yNKD7hkGvwiNtOcXY+Lw9hY4tPwthJwVdYlBsdX vmXvue7eCTvBXm+/bct0F8F+CfhdTvBJUe0MUz19jwubwhAoD28ZiGIqhWs9ie5KoKxov/6GEINqf AhXGMAsBj4vA4t+aFJ4fXDK6/LGiizjZW7c3DpSRSJtzHTM+lCjDQrNmN3fOgAuAW4A1GmlKHBGyu nCxzi7jxA+X8vxi1KqPQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cnG5G-00070Y-2x; Mon, 13 Mar 2017 02:51:42 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cnG4s-0006Ss-1l for linux-arm-kernel@bombadil.infradead.org; Mon, 13 Mar 2017 02:51:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=x60kI6ZbAPZxAaPv8BeVtemSuqW3PCshn76SOqqOmFE=; b=bf5Sc3NYz4dzIh+/JXsHu9lut 82ALMifnUg+jsnDIjL4R+RQMbUzk7GNHdQ3HjwV6txV6aJ6o5uocBeSD4So+8tQyyYT2xLRn3wyGk kblAlD7g6tTo9dqxqrKToJGBBvhICifdeklsQ2SBFMXkzmng8/IkIW7+n5IX7h67prehAROm4Hr0H spbcSXxO0C3a96l5PqKKDcsDbP4iR1ydxjTXhvezK+6NMblTNceqqd11toYOqv3hVzvxh3HQruVJ/ FBiZB9QWc+8Pbi1OScRfaR+bJgbAnzjzo1goJ01m86SfDx8k2hR/lH2b6CmaZ2QCq7prU0FvnKTMq CluywvgsA==; Received: from mail-sn1nam01on0044.outbound.protection.outlook.com ([104.47.32.44] helo=NAM01-SN1-obe.outbound.protection.outlook.com) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cnFaD-0003BQ-PV for linux-arm-kernel@lists.infradead.org; Mon, 13 Mar 2017 02:19:41 +0000 Received: from BN3PR0301CA0047.namprd03.prod.outlook.com (10.160.152.143) by BY2PR03MB190.namprd03.prod.outlook.com (10.242.36.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12; Mon, 13 Mar 2017 02:19:14 +0000 Received: from BY2FFO11FD046.protection.gbl (2a01:111:f400:7c0c::111) by BN3PR0301CA0047.outlook.office365.com (2a01:111:e400:401e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.961.17 via Frontend Transport; Mon, 13 Mar 2017 02:19:14 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD046.mail.protection.outlook.com (10.1.15.170) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.961.10 via Frontend Transport; Mon, 13 Mar 2017 02:19:05 +0000 Received: from b29397-desktop.ap.freescale.net (b29397-desktop.ap.freescale.net [10.192.242.114]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v2D2IsBZ028817; Sun, 12 Mar 2017 19:18:57 -0700 From: Peter Chen To: Subject: [PATCH 1/5] usb: separate out sysdev pointer from usb_bus Date: Mon, 13 Mar 2017 10:18:41 +0800 Message-ID: <1489371525-18928-2-git-send-email-peter.chen@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1489371525-18928-1-git-send-email-peter.chen@nxp.com> References: <1489371525-18928-1-git-send-email-peter.chen@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131338451533497910; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39410400002)(39850400002)(39400400002)(39450400003)(39380400002)(39840400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(9170700003)(39060400002)(106466001)(5890100001)(2351001)(53936002)(50466002)(48376002)(85426001)(33646002)(5003940100001)(77096006)(105606002)(86362001)(104016004)(76176999)(8676002)(110136004)(36756003)(50986999)(97736004)(189998001)(38730400002)(575784001)(356003)(47776003)(305945005)(50226002)(4326008)(5660300001)(8936002)(81166006)(6916009)(2950100002)(8656002)(2906002)(6666003)(54906002)(7416002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR03MB190; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD046; 1:YkV/1ST+907Q7gUeqkJWlemf95rbo691qMuFLy1+EWoCgExwCuwiXHmd5TKOMK8FMfZ2KosbDXlxEozJ+ce3YDbuquiBRZXlfl61tvT5pfvnS74JfnjOdqTnqYr7m5BD/zU7w+GdY7jkH4RW9NDsF14fXTXkkDRusZzPafg1c0cgXjWl6jxFMKXADpLUKEm7YXTn3a4egg4JlC10+Y0JWgwwJaEBLF1Qc9BjDimmb3hSvoqkbZUITuDBKQc7PJg6VjfwC++jCJHb8PG4nTobSaC8Ydn1kL1YaI8+CZYinRYbAVCl5iSkT7GuUBRKDg2KqX6PD4MpSyJEJbBcZvO27jG+98NDhhefavvLWALMuti1227Ts7CwE3KFOyEs+1zKHhUFpxW+N9GV5baB+HQ7787/8bP998H79WahJfed1f5J6qBuC1OmxOUtKr7oY4C3V4vARxxz9v4liS6KgUzAqGrpDAgqEFstRv03FVWF+3OLMVbQmvfvV/t5JyY8YL9w7SS4KviUrQpgGhwyxnoPagSIN73RWVNoBdRz6RFtmojONcAZmb3DpqEG0OxremF2YSbGhkUxjS5sY3WBXs+6Mawk3FR/fSViZx+ntA/cwyeahp3dAzDGOFzZRduD/BsI52mPaxwTe/0ZDeNeha71lw== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 8fb8c081-ff8a-425d-9a54-08d469b75762 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY2PR03MB190; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB190; 3:+D1V/AzxgOlVp4hLE677y6L84RpzIdvRIGhUI5Gi8TIoVLocHMN73aXo8zRHxGfnk5Z06Xn+q5Rsg82hD2KgygiTiy3QTOlO2kEYCvVlNiGhndNa0fvQdGLQRlz9BXd8fIvDNnv1GJqTz7tRy2m160i3UXucmth5yIEMOTw5W/PlKRZKQcDMcQxY4HKx8fFfqggL9T7an8qtzyfZMlQCMk7CqzK4Ii4wDztfcEwLTSLbeBjeEn1zSK656v7BmtNJOb5Ha5IHZilTOJNs7EQ/nXyaMQ9zBnjaI7d7mlPmJoy4yAskDy7a32diVKLh1Mvu1D5qEluRICzPgo7eOX8HwUN78daRopFREJQviX/sjL8D93+uWO5s/eKnzpo38v8i; 25:qhg8mWy8Krli3Y8R58wGRTOXX5DS2VICrXNRjgrXYPog+oZMA3lUOGnGfoaA9VQNz/o5Y14XBqflbd6stCWNeABSoRwJGdmsIymYO0d3jE2OUPnBjNUE8OA31l6PFFnb9/WMRk9ljV4MGpaj83sT+cyQz3m7zNmqs4JbeC7CudG7/tDnHVi6a2MyVjhH5bjiZewLq+7oLUZLKJ/kmxhDfqD199YX75dnDTHS8tB4zf2qZm6kkllPQSAgAGgvxE4vxabbuf8ZNhx87HOc5IT1MivfORxpLoqeziPbvDZP+dQZgYRLoy3VH+pmmEP5HGHfYtE4lOY5/RvDB4Ux3+TGqxH/6RRBqPrgwnMEDu71oCuWRMPA40UW2LTbLZcEKJNCJ4K7E4qOyZQ7L/EvjwysNGwtbKSHY4A9ACJE9g/X09W2dkhN4frELjepMBGUIkFC8kFeBRnYLFI1a7TH0edETw== X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB190; 31:TiGsLwX++t43OuuphD1sYn2wrGdEjcnqns0mnWsB4bMqaljC/xhUyBfAQUkgrsWH4uSleIAzDZcImuM999Eh9l3s2RDFqjQXZQ+Xma5wAcLRvycjMKeuRXVjZXIgiahomZIYyNa3hzSlFjP+yxH5gtfgak0ZERcBuybl4zNP0Vlt2H3cZYOtfxhezEKXBinAa6RQxGsl4IMK6iF9C9WHhvF/QobimCzfhaNHzTyczgP/22zHmxQamotAuewPohX7AmH1FO0lB7Wsbhp8Cmnm79LPyjaWy2zVwUaH29tHQAI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(31051911155226)(185117386973197)(82608151540597)(198206253151910)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13015025)(13017025)(8121501046)(5005006)(13024025)(13023025)(13018025)(3002001)(10201501046)(6055026)(6096035)(20161123563025)(20161123559025)(20161123561025)(20161123556025)(20161123565025); SRVR:BY2PR03MB190; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR03MB190; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB190; 4:6e/+zsN9KB06WBX7+kTEL7LX4mVMN0D2zI/9b6GsKugBxouddPQWZBnoALy5rpk224ncv0Y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cyfbPrnbVf5k; 24:V94uRIPL4VRnvCUOuOwblrjiDJpk2IRocu9djS9mK4R7CsrbNWMUAkPR11imBYMrUVa/li525snzM7IqxPBLyskJpyYwK7517yqmu7jiU0U= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB190; 7:z+vwVhyCllTMC25RQnvx8v8hGiPyVLhscwez3bLLyB27A/t721xshNnK2bM8H1tdf3NQ6toOrlQdtU+tGxnkkmJ639qMY+xhVyk9HIr4+tE8HVWMTI/eeHPnZsajww26+I28VL3GcYwblvO2WMzX8W0w3wPyT9Pbliw55i/eLf1Dm2GIDuRHgyO5/snJt2xgYhgFJ0DBXu38ga1tiS3UpngMck/kHRGJexvKGr/KkwsspBeJYap12y1l4DJNAzxoTpKtlMQp3jHtvYnbHIqxgAwGdCUwV3DF/BsC1BNT/rgh4spCs9EntZJbURaEjMKWhHzid4DZQlTU4/exCStivg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2017 02:19:05.7376 (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: BY2PR03MB190 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170313_021938_192497_C6FA34E4 X-CRM114-Status: GOOD ( 21.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Chen , Grygorii Strashko , Mathias Nyman , Felipe Balbi , Arnd Bergmann , Dann Frazier , Catalin Marinas , Yoshihiro Shimoda , linux-usb@vger.kernel.org, Stephen Boyd , Bjorn Andersson , David Fisher , "Thang Q. Nguyen" , Leo Li , Ming Lei , Sinjan Kumar , Sriram Dash , Jon Masters , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Arnd Bergmann For xhci-hcd platform device, all the DMA parameters are not configured properly, notably dma ops for dwc3 devices. The idea here is that you pass in the parent of_node along with the child device pointer, so it would behave exactly like the parent already does. The difference is that it also handles all the other attributes besides the mask. sysdev will represent the physical device, as seen from firmware or bus.Splitting the usb_bus->controller field into the Linux-internal device (used for the sysfs hierarchy, for printks and for power management) and a new pointer (used for DMA, DT enumeration and phy lookup) probably covers all that we really need. Signed-off-by: Arnd Bergmann Signed-off-by: Sriram Dash Tested-by: Baolin Wang Tested-by: Brian Norris Tested-by: Alexander Sverdlin Tested-by: Vivek Gautam Signed-off-by: Mathias Nyman Signed-off-by: Peter Chen Cc: Felipe Balbi Cc: Grygorii Strashko Cc: Sinjan Kumar Cc: David Fisher Cc: Catalin Marinas Cc: "Thang Q. Nguyen" Cc: Yoshihiro Shimoda Cc: Stephen Boyd Cc: Bjorn Andersson Cc: Ming Lei Cc: Jon Masters Cc: Dann Frazier Cc: Peter Chen Cc: Leo Li --- drivers/usb/core/buffer.c | 12 +++---- drivers/usb/core/hcd.c | 80 ++++++++++++++++++++++++++--------------------- drivers/usb/core/usb.c | 18 +++++------ include/linux/usb.h | 1 + include/linux/usb/hcd.h | 3 ++ 5 files changed, 64 insertions(+), 50 deletions(-) diff --git a/drivers/usb/core/buffer.c b/drivers/usb/core/buffer.c index b9bf6e2..b64568c 100644 --- a/drivers/usb/core/buffer.c +++ b/drivers/usb/core/buffer.c @@ -66,7 +66,7 @@ int hcd_buffer_create(struct usb_hcd *hcd) int i, size; if (!IS_ENABLED(CONFIG_HAS_DMA) || - (!hcd->self.controller->dma_mask && + (!is_device_dma_capable(hcd->self.sysdev) && !(hcd->driver->flags & HCD_LOCAL_MEM))) return 0; @@ -75,7 +75,7 @@ int hcd_buffer_create(struct usb_hcd *hcd) if (!size) continue; snprintf(name, sizeof(name), "buffer-%d", size); - hcd->pool[i] = dma_pool_create(name, hcd->self.controller, + hcd->pool[i] = dma_pool_create(name, hcd->self.sysdev, size, size, 0); if (!hcd->pool[i]) { hcd_buffer_destroy(hcd); @@ -130,7 +130,7 @@ void *hcd_buffer_alloc( /* some USB hosts just use PIO */ if (!IS_ENABLED(CONFIG_HAS_DMA) || - (!bus->controller->dma_mask && + (!is_device_dma_capable(bus->sysdev) && !(hcd->driver->flags & HCD_LOCAL_MEM))) { *dma = ~(dma_addr_t) 0; return kmalloc(size, mem_flags); @@ -140,7 +140,7 @@ void *hcd_buffer_alloc( if (size <= pool_max[i]) return dma_pool_alloc(hcd->pool[i], mem_flags, dma); } - return dma_alloc_coherent(hcd->self.controller, size, dma, mem_flags); + return dma_alloc_coherent(hcd->self.sysdev, size, dma, mem_flags); } void hcd_buffer_free( @@ -157,7 +157,7 @@ void hcd_buffer_free( return; if (!IS_ENABLED(CONFIG_HAS_DMA) || - (!bus->controller->dma_mask && + (!is_device_dma_capable(bus->sysdev) && !(hcd->driver->flags & HCD_LOCAL_MEM))) { kfree(addr); return; @@ -169,5 +169,5 @@ void hcd_buffer_free( return; } } - dma_free_coherent(hcd->self.controller, size, addr, dma); + dma_free_coherent(hcd->self.sysdev, size, addr, dma); } diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 612fab6..2342c1f 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -1073,6 +1073,7 @@ static void usb_deregister_bus (struct usb_bus *bus) static int register_root_hub(struct usb_hcd *hcd) { struct device *parent_dev = hcd->self.controller; + struct device *sysdev = hcd->self.sysdev; struct usb_device *usb_dev = hcd->self.root_hub; const int devnum = 1; int retval; @@ -1119,7 +1120,7 @@ static int register_root_hub(struct usb_hcd *hcd) /* Did the HC die before the root hub was registered? */ if (HCD_DEAD(hcd)) usb_hc_died (hcd); /* This time clean up */ - usb_dev->dev.of_node = parent_dev->of_node; + usb_dev->dev.of_node = sysdev->of_node; } mutex_unlock(&usb_bus_idr_lock); @@ -1465,19 +1466,19 @@ void usb_hcd_unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb) dir = usb_urb_dir_in(urb) ? DMA_FROM_DEVICE : DMA_TO_DEVICE; if (IS_ENABLED(CONFIG_HAS_DMA) && (urb->transfer_flags & URB_DMA_MAP_SG)) - dma_unmap_sg(hcd->self.controller, + dma_unmap_sg(hcd->self.sysdev, urb->sg, urb->num_sgs, dir); else if (IS_ENABLED(CONFIG_HAS_DMA) && (urb->transfer_flags & URB_DMA_MAP_PAGE)) - dma_unmap_page(hcd->self.controller, + dma_unmap_page(hcd->self.sysdev, urb->transfer_dma, urb->transfer_buffer_length, dir); else if (IS_ENABLED(CONFIG_HAS_DMA) && (urb->transfer_flags & URB_DMA_MAP_SINGLE)) - dma_unmap_single(hcd->self.controller, + dma_unmap_single(hcd->self.sysdev, urb->transfer_dma, urb->transfer_buffer_length, dir); @@ -1520,11 +1521,11 @@ int usb_hcd_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb, return ret; if (IS_ENABLED(CONFIG_HAS_DMA) && hcd->self.uses_dma) { urb->setup_dma = dma_map_single( - hcd->self.controller, + hcd->self.sysdev, urb->setup_packet, sizeof(struct usb_ctrlrequest), DMA_TO_DEVICE); - if (dma_mapping_error(hcd->self.controller, + if (dma_mapping_error(hcd->self.sysdev, urb->setup_dma)) return -EAGAIN; urb->transfer_flags |= URB_SETUP_MAP_SINGLE; @@ -1555,7 +1556,7 @@ int usb_hcd_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb, } n = dma_map_sg( - hcd->self.controller, + hcd->self.sysdev, urb->sg, urb->num_sgs, dir); @@ -1570,12 +1571,12 @@ int usb_hcd_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb, } else if (urb->sg) { struct scatterlist *sg = urb->sg; urb->transfer_dma = dma_map_page( - hcd->self.controller, + hcd->self.sysdev, sg_page(sg), sg->offset, urb->transfer_buffer_length, dir); - if (dma_mapping_error(hcd->self.controller, + if (dma_mapping_error(hcd->self.sysdev, urb->transfer_dma)) ret = -EAGAIN; else @@ -1585,11 +1586,11 @@ int usb_hcd_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb, ret = -EAGAIN; } else { urb->transfer_dma = dma_map_single( - hcd->self.controller, + hcd->self.sysdev, urb->transfer_buffer, urb->transfer_buffer_length, dir); - if (dma_mapping_error(hcd->self.controller, + if (dma_mapping_error(hcd->self.sysdev, urb->transfer_dma)) ret = -EAGAIN; else @@ -2495,24 +2496,8 @@ static void init_giveback_urb_bh(struct giveback_urb_bh *bh) tasklet_init(&bh->bh, usb_giveback_urb_bh, (unsigned long)bh); } -/** - * usb_create_shared_hcd - create and initialize an HCD structure - * @driver: HC driver that will use this hcd - * @dev: device for this HC, stored in hcd->self.controller - * @bus_name: value to store in hcd->self.bus_name - * @primary_hcd: a pointer to the usb_hcd structure that is sharing the - * PCI device. Only allocate certain resources for the primary HCD - * Context: !in_interrupt() - * - * Allocate a struct usb_hcd, with extra space at the end for the - * HC driver's private data. Initialize the generic members of the - * hcd structure. - * - * Return: On success, a pointer to the created and initialized HCD structure. - * On failure (e.g. if memory is unavailable), %NULL. - */ -struct usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver, - struct device *dev, const char *bus_name, +struct usb_hcd *__usb_create_hcd(const struct hc_driver *driver, + struct device *sysdev, struct device *dev, const char *bus_name, struct usb_hcd *primary_hcd) { struct usb_hcd *hcd; @@ -2553,8 +2538,9 @@ struct usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver, usb_bus_init(&hcd->self); hcd->self.controller = dev; + hcd->self.sysdev = sysdev; hcd->self.bus_name = bus_name; - hcd->self.uses_dma = (dev->dma_mask != NULL); + hcd->self.uses_dma = (sysdev->dma_mask != NULL); init_timer(&hcd->rh_timer); hcd->rh_timer.function = rh_timer_func; @@ -2569,6 +2555,30 @@ struct usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver, "USB Host Controller"; return hcd; } +EXPORT_SYMBOL_GPL(__usb_create_hcd); + +/** + * usb_create_shared_hcd - create and initialize an HCD structure + * @driver: HC driver that will use this hcd + * @dev: device for this HC, stored in hcd->self.controller + * @bus_name: value to store in hcd->self.bus_name + * @primary_hcd: a pointer to the usb_hcd structure that is sharing the + * PCI device. Only allocate certain resources for the primary HCD + * Context: !in_interrupt() + * + * Allocate a struct usb_hcd, with extra space at the end for the + * HC driver's private data. Initialize the generic members of the + * hcd structure. + * + * Return: On success, a pointer to the created and initialized HCD structure. + * On failure (e.g. if memory is unavailable), %NULL. + */ +struct usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver, + struct device *dev, const char *bus_name, + struct usb_hcd *primary_hcd) +{ + return __usb_create_hcd(driver, dev, dev, bus_name, primary_hcd); +} EXPORT_SYMBOL_GPL(usb_create_shared_hcd); /** @@ -2588,7 +2598,7 @@ EXPORT_SYMBOL_GPL(usb_create_shared_hcd); struct usb_hcd *usb_create_hcd(const struct hc_driver *driver, struct device *dev, const char *bus_name) { - return usb_create_shared_hcd(driver, dev, bus_name, NULL); + return __usb_create_hcd(driver, dev, dev, bus_name, NULL); } EXPORT_SYMBOL_GPL(usb_create_hcd); @@ -2715,7 +2725,7 @@ int usb_add_hcd(struct usb_hcd *hcd, struct usb_device *rhdev; if (IS_ENABLED(CONFIG_USB_PHY) && !hcd->usb_phy) { - struct usb_phy *phy = usb_get_phy_dev(hcd->self.controller, 0); + struct usb_phy *phy = usb_get_phy_dev(hcd->self.sysdev, 0); if (IS_ERR(phy)) { retval = PTR_ERR(phy); @@ -2733,7 +2743,7 @@ int usb_add_hcd(struct usb_hcd *hcd, } if (IS_ENABLED(CONFIG_GENERIC_PHY) && !hcd->phy) { - struct phy *phy = phy_get(hcd->self.controller, "usb"); + struct phy *phy = phy_get(hcd->self.sysdev, "usb"); if (IS_ERR(phy)) { retval = PTR_ERR(phy); @@ -2781,7 +2791,7 @@ int usb_add_hcd(struct usb_hcd *hcd, */ retval = hcd_buffer_create(hcd); if (retval != 0) { - dev_dbg(hcd->self.controller, "pool alloc failed\n"); + dev_dbg(hcd->self.sysdev, "pool alloc failed\n"); goto err_create_buf; } @@ -2791,7 +2801,7 @@ int usb_add_hcd(struct usb_hcd *hcd, rhdev = usb_alloc_dev(NULL, &hcd->self, 0); if (rhdev == NULL) { - dev_err(hcd->self.controller, "unable to allocate root hub\n"); + dev_err(hcd->self.sysdev, "unable to allocate root hub\n"); retval = -ENOMEM; goto err_allocate_root_hub; } diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index a2ccc69f..4cd6e0e 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c @@ -453,9 +453,9 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent, * Note: calling dma_set_mask() on a USB device would set the * mask for the entire HCD, so don't do that. */ - dev->dev.dma_mask = bus->controller->dma_mask; - dev->dev.dma_pfn_offset = bus->controller->dma_pfn_offset; - set_dev_node(&dev->dev, dev_to_node(bus->controller)); + dev->dev.dma_mask = bus->sysdev->dma_mask; + dev->dev.dma_pfn_offset = bus->sysdev->dma_pfn_offset; + set_dev_node(&dev->dev, dev_to_node(bus->sysdev)); dev->state = USB_STATE_ATTACHED; dev->lpm_disable_count = 1; atomic_set(&dev->urbnum, 0); @@ -803,7 +803,7 @@ struct urb *usb_buffer_map(struct urb *urb) if (!urb || !urb->dev || !(bus = urb->dev->bus) - || !(controller = bus->controller)) + || !(controller = bus->sysdev)) return NULL; if (controller->dma_mask) { @@ -841,7 +841,7 @@ void usb_buffer_dmasync(struct urb *urb) || !(urb->transfer_flags & URB_NO_TRANSFER_DMA_MAP) || !urb->dev || !(bus = urb->dev->bus) - || !(controller = bus->controller)) + || !(controller = bus->sysdev)) return; if (controller->dma_mask) { @@ -875,7 +875,7 @@ void usb_buffer_unmap(struct urb *urb) || !(urb->transfer_flags & URB_NO_TRANSFER_DMA_MAP) || !urb->dev || !(bus = urb->dev->bus) - || !(controller = bus->controller)) + || !(controller = bus->sysdev)) return; if (controller->dma_mask) { @@ -925,7 +925,7 @@ int usb_buffer_map_sg(const struct usb_device *dev, int is_in, if (!dev || !(bus = dev->bus) - || !(controller = bus->controller) + || !(controller = bus->sysdev) || !controller->dma_mask) return -EINVAL; @@ -961,7 +961,7 @@ void usb_buffer_dmasync_sg(const struct usb_device *dev, int is_in, if (!dev || !(bus = dev->bus) - || !(controller = bus->controller) + || !(controller = bus->sysdev) || !controller->dma_mask) return; @@ -989,7 +989,7 @@ void usb_buffer_unmap_sg(const struct usb_device *dev, int is_in, if (!dev || !(bus = dev->bus) - || !(controller = bus->controller) + || !(controller = bus->sysdev) || !controller->dma_mask) return; diff --git a/include/linux/usb.h b/include/linux/usb.h index 7e68259..1487526 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -354,6 +354,7 @@ struct usb_devmap { */ struct usb_bus { struct device *controller; /* host/master side hardware */ + struct device *sysdev; /* as seen from firmware or bus */ int busnum; /* Bus number (in order of reg) */ const char *bus_name; /* stable id (PCI slot_name etc) */ u8 uses_dma; /* Does the host controller use DMA? */ diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 40edf6a..4e8590a 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h @@ -437,6 +437,9 @@ extern int usb_hcd_alloc_bandwidth(struct usb_device *udev, struct usb_host_interface *new_alt); extern int usb_hcd_get_frame_number(struct usb_device *udev); +struct usb_hcd *__usb_create_hcd(const struct hc_driver *driver, + struct device *sysdev, struct device *dev, const char *bus_name, + struct usb_hcd *primary_hcd); extern struct usb_hcd *usb_create_hcd(const struct hc_driver *driver, struct device *dev, const char *bus_name); extern struct usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver,