From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751848AbdBFJPS (ORCPT ); Mon, 6 Feb 2017 04:15:18 -0500 Received: from mail-sn1nam02on0073.outbound.protection.outlook.com ([104.47.36.73]:49816 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751809AbdBFJPM (ORCPT ); Mon, 6 Feb 2017 04:15:12 -0500 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;nxp.com; dkim=none (message not signed) header.d=none; From: Peter Chen To: , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , Peter Chen , Sriram Dash Subject: [PATCH v12 7/9] usb: ehci: use bus->sysdev for DMA configuration Date: Mon, 6 Feb 2017 17:13:39 +0800 Message-ID: <1486372421-29073-8-git-send-email-peter.chen@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1486372421-29073-1-git-send-email-peter.chen@nxp.com> References: <1486372421-29073-1-git-send-email-peter.chen@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131308461095610840;(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)(7916002)(336005)(39410400002)(39400400002)(39840400002)(39380400002)(39860400002)(39850400002)(39450400003)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(4326007)(305945005)(105606002)(189998001)(2950100002)(8656002)(106466001)(76176999)(53936002)(50986999)(104016004)(8936002)(5660300001)(6666003)(5001770100001)(85426001)(2171002)(97736004)(36756003)(33646002)(81156014)(2201001)(47776003)(7416002)(7406005)(48376002)(81166006)(8676002)(50466002)(38730400001)(77096006)(2906002)(68736007)(5003940100001)(86362001)(54906002)(92566002)(356003)(626004)(50226002)(39060400001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0301MB0731;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD038;1:kGhfBU3PfQI0ux8rBIY0VRBS8W/qUH0/Tm+hHx1MeqosS/DxaiDmtMuUrRsg3EvcM4tS//lmhODMZ0Fxks2hql0XA8Cr8xIj0Fe1aFz1COGmiMxDV/rzL4YPhViAD1y5iWhlkQxZKBbZn1+DSrtMkiefw4Bh9l23pyMjWklg81cVCkDpzrS8l4iXUZbrDTi1pV6fohtS+M/FqgBR0FAdlRNb99sOztDJXajLkrTWhBsJ810tD7BnXO30q9ppeovwhgDjRrulUgWqxgjMf34t2+LNG4tT4+p0TQucf/1irlp+IQDfg660J7ThoWQwpQ5k4a/x23bHs2Q2YAIjQ8lLyb7s7XI8CgAwdWh+ArgcmrHpOSe9rf3YdxkUwsQF3IiXIwDKxAvVokV6uJmgOMghhS8lb6TocTG7XqbwYT4WeGSPZdKbiv0Wcj0upzVcwUw0u7oICxhnmGbk6beLxu2No4G/PQ2maI+L4/jhF3+o1OYbnH4PA18qIJ8HYSKpjEdb/NP6aSBoMvimZtfXJ/LE7y0d21AU6ZOgZhRFHgoblAFhknyFFBjbatiovRkAdD1teIa3o//XkPdI2USo1ddOufVyIGHxIjG+Wht0KCe+X1VsdO0fKJpZQNLgiByry1YN5mFESJPtG1B2OKIlCGiyRhsJNR4dh4N0d8ukam5oMRebMPmL68r0OfNVKA/aoIEs05pfaPZQooUrcyspglM8UzHXstSQOPbWBomRP4SMcaVkeZr4CDrXxJvRxNV0hepb1mzc33nSbERjUltNLKRZBw== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: a41d267b-a82a-4ac0-69d8-08d44e70a612 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR0301MB0731; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB0731;3:MecftKV5i6ovbWEtsUsMcobahWdguED74yD6nQx8ishLozbqQy+/RjpvShjtHmfEJV8f9ZFXmaPgBny5AjGVF3qGx87dnORbbSxkcPmfAVH1sRB8HYICq3hoP87LnxD5KfZJ9gfouCKhTjc2VxewknCzSD6wDNJCKtzwK/uoDPKKuGBhnIIx2uUHkNG6eOqZF6mf4QgIjsTi96B1KL4ec+lb862Mi+jJIwQfKyXNchBSHk6LsZah4KTpIKGFQ0wqRu+jTk+O1d+FU7qzpx39AP0Ghi0RjArtimYZENCtMWILzcz9ZZEedLEzT2zuisxO/Wf3ftvG3k7+nTkScrbgzSzFxYIK8U4bEVYbbkJ1PaB3vy8xViQx+JR9y5uCjkJ6;25:rLpfE649tzdbQM19iir6GssMczFxOGJrX8ajjsBRUks89NrFegbMcHWjiJtwaaR/tQtQSYV4zTzFWpeo7JFaWSJyMlUgvWap+v3wY9pCHxBqo3nZ8wj27O0/+fIRUkdR+6mLzCZQwdIY+2z7dSufkO+gWFctcZmmxwHG/Ggry8uU9UeW8yMryq/neZ3b/Q9kuJx5AZFkNKjZ4TXGMl2ozSuY/Z1ERUCcQtjLzHLz4u6QkQ0+rC5P3o+VxXtdlXaHoLHu22V81ocVtvTdKuvsnDJfDKsSe4/En50sGSI8mNuCr95LlopltagbbvBXQPV4CgTvlE+EF9NoKWW5eCS40kYidK1EwnLBwM+k2gE4+iSnKUAxx52SgnaiDJ4q3oNvtrGD5JIHYFp7kLtSjeVAdJ7Cd4EiqhclshenN1cJhUV424W7f1r63HTlZH2l5q2aNChRhmYMkqVmtdG69eDUrg== X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB0731;31:65HE4iWO/2wras2Km8B/SYxeImL4URyan1FDukIIjUaawBpa5sl7knFs7Nigeg67W7aFFIInGRJ+lia22cxyhnCD2ASGnVb/3dqmrg/aFBHvb0+jcxLzKBkOabPPIJmk0jgFGtS4ieCpiWNCmRtktWW8EFA5d9RrytYPwg/Z1EQWA84vah3jdRAbgO/4EeCqaPy2MzRR5zW0FNdaaIu3olIEYu/x+OvXrLcEI7yYz67wL6gjN60WbH6kwa4oDjoCZstjQmk5qcj2uL5LybMptw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6095060)(601004)(2401047)(13023025)(13024025)(13018025)(13017025)(5005006)(8121501046)(20170203043)(13015025)(3002001)(10201501046)(6055026)(6096035)(20161123563025)(20161123556025)(20161123565025)(20161123559025)(20161123561025);SRVR:CY1PR0301MB0731;BCL:0;PCL:0;RULEID:(400006);SRVR:CY1PR0301MB0731; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB0731;4:OC0d+lTbqP0MEL+sDprQRtVI/os1/HByWa5kwqTU5bL92FzPG2eQuMuN4r44JUcl66KZXb2vXuEhJ9V6DxdeXjfFiGuI29xATh8aHkwXMykBPEIM/YTdJPUhL7AjHDmGgC6zd94FFNtp7FWsbaAETtxh6CrxOYsVcxfxuqwutWYvtHIcn/ogD9vp8yq3qT3Nhq1Wv9kXAHNeehf905/WvH5UY5oWZI99k/rhsUaxHwOBbDGbQSxEUWLnh93ITz9WDXWUgSqgrbsGzGrXyE8yIJ3fQfQLfJs5/L+Zl9fUGWdjCV1d6js2lVjlkj15l1RNY6nyNLNGJFd+O/X4GWucEFM4f3erXIaG3gP8bImD5NhMrnYAzCKW69g74rS7NQxFsHmShN/ElE6rot470CQ2qE9Hh+9eGgsZ2k/nq+K77SKADcVYrf7k8DDpE4rYpEHv3kb0rE38bdsXBPVGtDZxdIu/9FmfEO5Rt7eJW1azZU8EWZ2ftdfuk8c9ByTTAAQykv+dpYrRlCZZSZA1Mgw2XVfujhScqEqRZN7EEySI+vuKUgA3dvrHm+mZXFFyItfaf4egeiTgrytwI/5I670fMktzfo8Q3G51CCbBjGcQ7zRUDZ3yjdFpNUm8ezpqdii8DmAilIc9HGVr39K5MQ7MnHBuX2quygaYwh3w+rO4DlbLMf/OhGMtmVAvH+WN5AmhHNCM53otejZzttqiz1DKWxhwTK5eEHAT1ZjnKZkzuV2DEB9YXpolU4LofOGotqDOI4Ckq6mQ+QmiGW3iwZaH3w== X-Forefront-PRVS: 0210479ED8 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR0301MB0731;23:ToyBRWcK1PCxWBOxXLXoWSwLsZQIkDw5WuH+rbS?= =?us-ascii?Q?6XegKHfsKrdEHMGkQVE6NElULXFTsIcUxepeEbM4xDoWg/yea0IQJmvQcFg3?= =?us-ascii?Q?n+paOqNEm5NkGyeXB1/lO5p1Kdy55jrYTToswoOWaazCiRvl44hIUuq9BMBl?= =?us-ascii?Q?tXxUNdsUXOPEbIeyfNGN5zAJ8wdSkPYEm/8ZgajInN4JmFeTp1TVcsvTGm98?= =?us-ascii?Q?K52TwfHiXg9zg61yO7H613Hs1BJj4hCD9E+76XNCWzolT+r9DKBahgy/4tSb?= =?us-ascii?Q?AwHBVz0qf8zs21nvHmB4v1nBzuz6DP0L31GMyS6nRoOJ2V6Kkps5nfcjN0/t?= =?us-ascii?Q?iVi497e+fz3R/FB7SLcJumsvxqLup7y0TpeozP3KecRZ+m1mSCsQ/KbAEnEt?= =?us-ascii?Q?LvZiKEG50PmUZUoJpmW54LOMV6DNyRxYG4xzJmFLGSMR34VFhho+lhNqlnZN?= =?us-ascii?Q?Jmm/2VuS8MLxWs8clYeaGX1IBj1PpllwoOp8JS9+87Crwt6oxl/qEijzpNza?= =?us-ascii?Q?DavVjJlX6IKwa94hk65QyeDuAuCy6l3ayMsNbFTaN1kUeUin0g8BhNxkA4qi?= =?us-ascii?Q?L9cPLgzgUdw1gROV6qM4nRjtui2nGddQ1QLv4THiKJUFB+6Ds4oneLkgm+ZI?= =?us-ascii?Q?Xqh51wbfh+pG5gw2PoS9Av1GsdAr/OI0cv/kgx5a4vJqqi4aOWm/hmgH9Z1U?= =?us-ascii?Q?i492DgK5oj60jO09eFUJyCh0fNnK3ODJTLZw4dYct54QTs5ayeRVry4VsCZd?= =?us-ascii?Q?7zfFn7DzCVyvYBgEHojN8ii3jsCqcedZvIk+MLjIs2xm8tG7xs5MIHjxXji9?= =?us-ascii?Q?1bAQyvJMuzQVilNRSA0vhKRJ9ezBZxixD62JJCqXwVYywOffmxQdV/Elyval?= =?us-ascii?Q?uGhxzO0QRBeqVrFpQBVDb+unSIAhkVfWOK3IceViJNjCV9BLE42WZJLyJpIM?= =?us-ascii?Q?2JamObe5cb9ngXDjQILOiyeiTjEnKcX8lpD57h+w/LonJafcX0mdOMep51UP?= =?us-ascii?Q?EEYoW/3q0x50+yFtFnnkmkKUqH95qocr4Y1c12nIK//NSV6q43/95Kjv+taq?= =?us-ascii?Q?F3uL51SteaXU6A8qOcBdlqq1W1eTNkh/jJGk5km13KgYP/tRpRiykLEEHcD/?= =?us-ascii?Q?q0GHMfWIh2PGczKVB9GWdEivRa9zcTM3SeGlhPxlq5TsWWzcaPPRU8/eI3Dw?= =?us-ascii?Q?lykFK68izW0wq5Lh/tpsEWKnwG3AxlQb86AeLPltdhF9sTzPEKW95JkVKsS5?= =?us-ascii?Q?VFw5GIp5wm5PoTWSWMews5X2ja4ExHpEM80kfocnaF/jAgx5Igi+ZYVqEZKF?= =?us-ascii?Q?3+3nj8fapWLLCmjppbgPubyLQQMhTrK1ok0bPmMNp7cyHK4k+T7C8yV2jL1B?= =?us-ascii?Q?0n3F+7+TWKW6NjpY9RKDCpWE/uHE=3D?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB0731;6:J9JmaFQcmM3f69vD0kkNa6DglezrWFs/sbnJOf6/wDL0OtMcEH1D7xppV4v9mEU7mcbA8cX4WwAlkk/up/ZceBpz4OmqoVjN8/Y3zV0S70cWElLugPwS8zleYf3H/hQ4yCF10ADsqdtd8sCwf5BhVKugCwHENPw0XtbsPiz+TUdAFOqMNv6JoefZmxMJzt5+s+Ls65WSQLl9qkvJa6QHYggFBaRMeTh0SVae7iJNL3LHb8l2ZkwaD3DoLRjmZu/i/Zp8pPwtxsQAR3Hd+PStg+QjIO7TEVXG+4uZw9yBcKwETv4EWMiN9I4+e8GmhRDRSarrMvil0RTeaHL4K7lbt4m+kGKVohEr/5oSoS/pAYIRMuZ+XRahC8XQ3E5ABjMTBdWtNfi/oaPCyhMOFOpVahklWsol+nDtTVzsOjiPyLk=;5:EMlYXDQ3x4PRHlnpHe3FriDyu9uAa79P02uJI+6U/8W9QoWQAVeTtFL5B1VAxP5NwT5bc5mEU+YQUl2Apxl7aq51L9Eex4NEgAO//K9HEQXIbSSiJEXMFBRreTdFXYCKnnzkIfIvVgUQGh7oC3+xJ++bVf2O3loIP+Il5z+Wavk+ZeCaXa1Yzx6rqTuqk0Bk;24:XGjnZcTcSrfKcunAb2MsSgXmZZw61nRLJX0+2/nEby6mXn0ccC3edfb2WIHbFGN1eIdQJH/IiHYyp7wpsFRnajOBYuPtRRCiQlepaQ1PElQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB0731;7:mK47+giXT/o6jk2FaxGf5sZDghfEtjIlfxGartCrA1Nfl2L3C++GGOLtE9UidvZsl5FG4lxOiiygdV4hp+KJ40lUriovNCVh8uQoMo4578V2T1prkJH+kCCMyagEvlcbAUBqJX7ZGvfpAiVpk39FTAvS31oN/7ObAHFPCeHcmEtq18RHOrkf5Zvx2DLJsDRklH9w1NP0mAIcYv2VpAXGyxZVOXKU1REsp5o/1JcbaU7NnyM7aRB2nakEliZSpqGLCvggBvObixbdQyUlLoCUaPiacE6GghsOMeKl4+ho7r7BRQRv+ROoeGHJG07KrpKwNaGoa4dzQ8KQOlDKemgcALRNgsYQ8R+mGthPUYydngWJMmn/Gw8QZR5st2FDqkNF7qOBPaiKADg47I1/6gvrEeMNo72j7IDkV8CYr0hhpuRT770zRc1wVylB9Yg0NJFlkuUdAW88NniC2+g62ER1OOrI1BvmsQtZtnFsIYIupqW2rrovI5Ug7sn2IvY4JgEOsFu0td4F0tHt5SnSB+hcKg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2017 09:15:09.2958 (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: CY1PR0301MB0731 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Set the dma for ehci from sysdev. The sysdev is pointing to device that is known to the system firmware or hardware. Cc: Arnd Bergmann Cc: Sriram Dash Signed-off-by: Peter Chen --- drivers/usb/host/ehci-mem.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c index 4de4301..f54478d 100644 --- a/drivers/usb/host/ehci-mem.c +++ b/drivers/usb/host/ehci-mem.c @@ -46,21 +46,21 @@ static inline void ehci_qtd_init(struct ehci_hcd *ehci, struct ehci_qtd *qtd, INIT_LIST_HEAD (&qtd->qtd_list); } -static struct ehci_qtd *ehci_qtd_alloc (struct ehci_hcd *ehci, gfp_t flags) +static struct ehci_qtd *ehci_qtd_alloc(struct ehci_hcd *ehci, gfp_t flags) { struct ehci_qtd *qtd; dma_addr_t dma; - qtd = dma_pool_alloc (ehci->qtd_pool, flags, &dma); + qtd = dma_pool_alloc(ehci->qtd_pool, flags, &dma); if (qtd != NULL) { ehci_qtd_init(ehci, qtd, dma); } return qtd; } -static inline void ehci_qtd_free (struct ehci_hcd *ehci, struct ehci_qtd *qtd) +static inline void ehci_qtd_free(struct ehci_hcd *ehci, struct ehci_qtd *qtd) { - dma_pool_free (ehci->qtd_pool, qtd, qtd->qtd_dma); + dma_pool_free(ehci->qtd_pool, qtd, qtd->qtd_dma); } @@ -72,12 +72,12 @@ static void qh_destroy(struct ehci_hcd *ehci, struct ehci_qh *qh) BUG (); } if (qh->dummy) - ehci_qtd_free (ehci, qh->dummy); + ehci_qtd_free(ehci, qh->dummy); dma_pool_free(ehci->qh_pool, qh->hw, qh->qh_dma); kfree(qh); } -static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd *ehci, gfp_t flags) +static struct ehci_qh *ehci_qh_alloc(struct ehci_hcd *ehci, gfp_t flags) { struct ehci_qh *qh; dma_addr_t dma; @@ -96,7 +96,7 @@ static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd *ehci, gfp_t flags) INIT_LIST_HEAD(&qh->unlink_node); /* dummy td enables safe urb queuing */ - qh->dummy = ehci_qtd_alloc (ehci, flags); + qh->dummy = ehci_qtd_alloc(ehci, flags); if (qh->dummy == NULL) { ehci_dbg (ehci, "no dummy td\n"); goto fail1; @@ -117,7 +117,7 @@ static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd *ehci, gfp_t flags) * This is the initialisation and cleanup code. */ -static void ehci_mem_cleanup (struct ehci_hcd *ehci) +static void ehci_mem_cleanup(struct ehci_hcd *ehci) { if (ehci->async) qh_destroy(ehci, ehci->async); @@ -138,7 +138,7 @@ static void ehci_mem_cleanup (struct ehci_hcd *ehci) ehci->sitd_pool = NULL; if (ehci->periodic) - dma_free_coherent (ehci_to_hcd(ehci)->self.controller, + dma_free_coherent(ehci_to_hcd(ehci)->self.sysdev, ehci->periodic_size * sizeof (u32), ehci->periodic, ehci->periodic_dma); ehci->periodic = NULL; @@ -154,8 +154,8 @@ static int ehci_mem_init (struct ehci_hcd *ehci, gfp_t flags) int i; /* QTDs for control/bulk/intr transfers */ - ehci->qtd_pool = dma_pool_create ("ehci_qtd", - ehci_to_hcd(ehci)->self.controller, + ehci->qtd_pool = dma_pool_create("ehci_qtd", + ehci_to_hcd(ehci)->self.sysdev, sizeof (struct ehci_qtd), 32 /* byte alignment (for hw parts) */, 4096 /* can't cross 4K */); @@ -164,22 +164,22 @@ static int ehci_mem_init (struct ehci_hcd *ehci, gfp_t flags) } /* QHs for control/bulk/intr transfers */ - ehci->qh_pool = dma_pool_create ("ehci_qh", - ehci_to_hcd(ehci)->self.controller, + ehci->qh_pool = dma_pool_create("ehci_qh", + ehci_to_hcd(ehci)->self.sysdev, sizeof(struct ehci_qh_hw), 32 /* byte alignment (for hw parts) */, 4096 /* can't cross 4K */); if (!ehci->qh_pool) { goto fail; } - ehci->async = ehci_qh_alloc (ehci, flags); + ehci->async = ehci_qh_alloc(ehci, flags); if (!ehci->async) { goto fail; } /* ITD for high speed ISO transfers */ - ehci->itd_pool = dma_pool_create ("ehci_itd", - ehci_to_hcd(ehci)->self.controller, + ehci->itd_pool = dma_pool_create("ehci_itd", + ehci_to_hcd(ehci)->self.sysdev, sizeof (struct ehci_itd), 32 /* byte alignment (for hw parts) */, 4096 /* can't cross 4K */); @@ -188,8 +188,8 @@ static int ehci_mem_init (struct ehci_hcd *ehci, gfp_t flags) } /* SITD for full/low speed split ISO transfers */ - ehci->sitd_pool = dma_pool_create ("ehci_sitd", - ehci_to_hcd(ehci)->self.controller, + ehci->sitd_pool = dma_pool_create("ehci_sitd", + ehci_to_hcd(ehci)->self.sysdev, sizeof (struct ehci_sitd), 32 /* byte alignment (for hw parts) */, 4096 /* can't cross 4K */); @@ -199,7 +199,7 @@ static int ehci_mem_init (struct ehci_hcd *ehci, gfp_t flags) /* Hardware periodic table */ ehci->periodic = (__le32 *) - dma_alloc_coherent (ehci_to_hcd(ehci)->self.controller, + dma_alloc_coherent(ehci_to_hcd(ehci)->self.sysdev, ehci->periodic_size * sizeof(__le32), &ehci->periodic_dma, flags); if (ehci->periodic == NULL) { -- 2.7.4 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Chen Subject: [PATCH v12 7/9] usb: ehci: use bus->sysdev for DMA configuration Date: Mon, 6 Feb 2017 17:13:39 +0800 Message-ID: <1486372421-29073-8-git-send-email-peter.chen@nxp.com> References: <1486372421-29073-1-git-send-email-peter.chen@nxp.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1486372421-29073-1-git-send-email-peter.chen-3arQi8VN3Tc@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org, stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org, ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, shawnguo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org, dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Cc: heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, pawel.moll-5wv7dgnIgG8@public.gmane.org, mark.rutland-5wv7dgnIgG8@public.gmane.org, linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, arnd-r2nGTMty4D4@public.gmane.org, s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org, mail-APzI5cXaD1zVlRWJc41N0YvC60bnQu0Y@public.gmane.org, troy.kisky-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org, festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, oscar-Bdbr4918Nnnk1uMJSBkQmQ@public.gmane.org, stephen.boyd-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, stillcompiling-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, mka-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, vaibhav.hiremath-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, gary.bisson-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org, hverkuil-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org, krzk-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, Peter Chen , Sriram Dash List-Id: devicetree@vger.kernel.org Set the dma for ehci from sysdev. The sysdev is pointing to device that is known to the system firmware or hardware. Cc: Arnd Bergmann Cc: Sriram Dash Signed-off-by: Peter Chen --- drivers/usb/host/ehci-mem.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c index 4de4301..f54478d 100644 --- a/drivers/usb/host/ehci-mem.c +++ b/drivers/usb/host/ehci-mem.c @@ -46,21 +46,21 @@ static inline void ehci_qtd_init(struct ehci_hcd *ehci, struct ehci_qtd *qtd, INIT_LIST_HEAD (&qtd->qtd_list); } -static struct ehci_qtd *ehci_qtd_alloc (struct ehci_hcd *ehci, gfp_t flags) +static struct ehci_qtd *ehci_qtd_alloc(struct ehci_hcd *ehci, gfp_t flags) { struct ehci_qtd *qtd; dma_addr_t dma; - qtd = dma_pool_alloc (ehci->qtd_pool, flags, &dma); + qtd = dma_pool_alloc(ehci->qtd_pool, flags, &dma); if (qtd != NULL) { ehci_qtd_init(ehci, qtd, dma); } return qtd; } -static inline void ehci_qtd_free (struct ehci_hcd *ehci, struct ehci_qtd *qtd) +static inline void ehci_qtd_free(struct ehci_hcd *ehci, struct ehci_qtd *qtd) { - dma_pool_free (ehci->qtd_pool, qtd, qtd->qtd_dma); + dma_pool_free(ehci->qtd_pool, qtd, qtd->qtd_dma); } @@ -72,12 +72,12 @@ static void qh_destroy(struct ehci_hcd *ehci, struct ehci_qh *qh) BUG (); } if (qh->dummy) - ehci_qtd_free (ehci, qh->dummy); + ehci_qtd_free(ehci, qh->dummy); dma_pool_free(ehci->qh_pool, qh->hw, qh->qh_dma); kfree(qh); } -static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd *ehci, gfp_t flags) +static struct ehci_qh *ehci_qh_alloc(struct ehci_hcd *ehci, gfp_t flags) { struct ehci_qh *qh; dma_addr_t dma; @@ -96,7 +96,7 @@ static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd *ehci, gfp_t flags) INIT_LIST_HEAD(&qh->unlink_node); /* dummy td enables safe urb queuing */ - qh->dummy = ehci_qtd_alloc (ehci, flags); + qh->dummy = ehci_qtd_alloc(ehci, flags); if (qh->dummy == NULL) { ehci_dbg (ehci, "no dummy td\n"); goto fail1; @@ -117,7 +117,7 @@ static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd *ehci, gfp_t flags) * This is the initialisation and cleanup code. */ -static void ehci_mem_cleanup (struct ehci_hcd *ehci) +static void ehci_mem_cleanup(struct ehci_hcd *ehci) { if (ehci->async) qh_destroy(ehci, ehci->async); @@ -138,7 +138,7 @@ static void ehci_mem_cleanup (struct ehci_hcd *ehci) ehci->sitd_pool = NULL; if (ehci->periodic) - dma_free_coherent (ehci_to_hcd(ehci)->self.controller, + dma_free_coherent(ehci_to_hcd(ehci)->self.sysdev, ehci->periodic_size * sizeof (u32), ehci->periodic, ehci->periodic_dma); ehci->periodic = NULL; @@ -154,8 +154,8 @@ static int ehci_mem_init (struct ehci_hcd *ehci, gfp_t flags) int i; /* QTDs for control/bulk/intr transfers */ - ehci->qtd_pool = dma_pool_create ("ehci_qtd", - ehci_to_hcd(ehci)->self.controller, + ehci->qtd_pool = dma_pool_create("ehci_qtd", + ehci_to_hcd(ehci)->self.sysdev, sizeof (struct ehci_qtd), 32 /* byte alignment (for hw parts) */, 4096 /* can't cross 4K */); @@ -164,22 +164,22 @@ static int ehci_mem_init (struct ehci_hcd *ehci, gfp_t flags) } /* QHs for control/bulk/intr transfers */ - ehci->qh_pool = dma_pool_create ("ehci_qh", - ehci_to_hcd(ehci)->self.controller, + ehci->qh_pool = dma_pool_create("ehci_qh", + ehci_to_hcd(ehci)->self.sysdev, sizeof(struct ehci_qh_hw), 32 /* byte alignment (for hw parts) */, 4096 /* can't cross 4K */); if (!ehci->qh_pool) { goto fail; } - ehci->async = ehci_qh_alloc (ehci, flags); + ehci->async = ehci_qh_alloc(ehci, flags); if (!ehci->async) { goto fail; } /* ITD for high speed ISO transfers */ - ehci->itd_pool = dma_pool_create ("ehci_itd", - ehci_to_hcd(ehci)->self.controller, + ehci->itd_pool = dma_pool_create("ehci_itd", + ehci_to_hcd(ehci)->self.sysdev, sizeof (struct ehci_itd), 32 /* byte alignment (for hw parts) */, 4096 /* can't cross 4K */); @@ -188,8 +188,8 @@ static int ehci_mem_init (struct ehci_hcd *ehci, gfp_t flags) } /* SITD for full/low speed split ISO transfers */ - ehci->sitd_pool = dma_pool_create ("ehci_sitd", - ehci_to_hcd(ehci)->self.controller, + ehci->sitd_pool = dma_pool_create("ehci_sitd", + ehci_to_hcd(ehci)->self.sysdev, sizeof (struct ehci_sitd), 32 /* byte alignment (for hw parts) */, 4096 /* can't cross 4K */); @@ -199,7 +199,7 @@ static int ehci_mem_init (struct ehci_hcd *ehci, gfp_t flags) /* Hardware periodic table */ ehci->periodic = (__le32 *) - dma_alloc_coherent (ehci_to_hcd(ehci)->self.controller, + dma_alloc_coherent(ehci_to_hcd(ehci)->self.sysdev, ehci->periodic_size * sizeof(__le32), &ehci->periodic_dma, flags); if (ehci->periodic == NULL) { -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: peter.chen@nxp.com (Peter Chen) Date: Mon, 6 Feb 2017 17:13:39 +0800 Subject: [PATCH v12 7/9] usb: ehci: use bus->sysdev for DMA configuration In-Reply-To: <1486372421-29073-1-git-send-email-peter.chen@nxp.com> References: <1486372421-29073-1-git-send-email-peter.chen@nxp.com> Message-ID: <1486372421-29073-8-git-send-email-peter.chen@nxp.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Set the dma for ehci from sysdev. The sysdev is pointing to device that is known to the system firmware or hardware. Cc: Arnd Bergmann Cc: Sriram Dash Signed-off-by: Peter Chen --- drivers/usb/host/ehci-mem.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c index 4de4301..f54478d 100644 --- a/drivers/usb/host/ehci-mem.c +++ b/drivers/usb/host/ehci-mem.c @@ -46,21 +46,21 @@ static inline void ehci_qtd_init(struct ehci_hcd *ehci, struct ehci_qtd *qtd, INIT_LIST_HEAD (&qtd->qtd_list); } -static struct ehci_qtd *ehci_qtd_alloc (struct ehci_hcd *ehci, gfp_t flags) +static struct ehci_qtd *ehci_qtd_alloc(struct ehci_hcd *ehci, gfp_t flags) { struct ehci_qtd *qtd; dma_addr_t dma; - qtd = dma_pool_alloc (ehci->qtd_pool, flags, &dma); + qtd = dma_pool_alloc(ehci->qtd_pool, flags, &dma); if (qtd != NULL) { ehci_qtd_init(ehci, qtd, dma); } return qtd; } -static inline void ehci_qtd_free (struct ehci_hcd *ehci, struct ehci_qtd *qtd) +static inline void ehci_qtd_free(struct ehci_hcd *ehci, struct ehci_qtd *qtd) { - dma_pool_free (ehci->qtd_pool, qtd, qtd->qtd_dma); + dma_pool_free(ehci->qtd_pool, qtd, qtd->qtd_dma); } @@ -72,12 +72,12 @@ static void qh_destroy(struct ehci_hcd *ehci, struct ehci_qh *qh) BUG (); } if (qh->dummy) - ehci_qtd_free (ehci, qh->dummy); + ehci_qtd_free(ehci, qh->dummy); dma_pool_free(ehci->qh_pool, qh->hw, qh->qh_dma); kfree(qh); } -static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd *ehci, gfp_t flags) +static struct ehci_qh *ehci_qh_alloc(struct ehci_hcd *ehci, gfp_t flags) { struct ehci_qh *qh; dma_addr_t dma; @@ -96,7 +96,7 @@ static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd *ehci, gfp_t flags) INIT_LIST_HEAD(&qh->unlink_node); /* dummy td enables safe urb queuing */ - qh->dummy = ehci_qtd_alloc (ehci, flags); + qh->dummy = ehci_qtd_alloc(ehci, flags); if (qh->dummy == NULL) { ehci_dbg (ehci, "no dummy td\n"); goto fail1; @@ -117,7 +117,7 @@ static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd *ehci, gfp_t flags) * This is the initialisation and cleanup code. */ -static void ehci_mem_cleanup (struct ehci_hcd *ehci) +static void ehci_mem_cleanup(struct ehci_hcd *ehci) { if (ehci->async) qh_destroy(ehci, ehci->async); @@ -138,7 +138,7 @@ static void ehci_mem_cleanup (struct ehci_hcd *ehci) ehci->sitd_pool = NULL; if (ehci->periodic) - dma_free_coherent (ehci_to_hcd(ehci)->self.controller, + dma_free_coherent(ehci_to_hcd(ehci)->self.sysdev, ehci->periodic_size * sizeof (u32), ehci->periodic, ehci->periodic_dma); ehci->periodic = NULL; @@ -154,8 +154,8 @@ static int ehci_mem_init (struct ehci_hcd *ehci, gfp_t flags) int i; /* QTDs for control/bulk/intr transfers */ - ehci->qtd_pool = dma_pool_create ("ehci_qtd", - ehci_to_hcd(ehci)->self.controller, + ehci->qtd_pool = dma_pool_create("ehci_qtd", + ehci_to_hcd(ehci)->self.sysdev, sizeof (struct ehci_qtd), 32 /* byte alignment (for hw parts) */, 4096 /* can't cross 4K */); @@ -164,22 +164,22 @@ static int ehci_mem_init (struct ehci_hcd *ehci, gfp_t flags) } /* QHs for control/bulk/intr transfers */ - ehci->qh_pool = dma_pool_create ("ehci_qh", - ehci_to_hcd(ehci)->self.controller, + ehci->qh_pool = dma_pool_create("ehci_qh", + ehci_to_hcd(ehci)->self.sysdev, sizeof(struct ehci_qh_hw), 32 /* byte alignment (for hw parts) */, 4096 /* can't cross 4K */); if (!ehci->qh_pool) { goto fail; } - ehci->async = ehci_qh_alloc (ehci, flags); + ehci->async = ehci_qh_alloc(ehci, flags); if (!ehci->async) { goto fail; } /* ITD for high speed ISO transfers */ - ehci->itd_pool = dma_pool_create ("ehci_itd", - ehci_to_hcd(ehci)->self.controller, + ehci->itd_pool = dma_pool_create("ehci_itd", + ehci_to_hcd(ehci)->self.sysdev, sizeof (struct ehci_itd), 32 /* byte alignment (for hw parts) */, 4096 /* can't cross 4K */); @@ -188,8 +188,8 @@ static int ehci_mem_init (struct ehci_hcd *ehci, gfp_t flags) } /* SITD for full/low speed split ISO transfers */ - ehci->sitd_pool = dma_pool_create ("ehci_sitd", - ehci_to_hcd(ehci)->self.controller, + ehci->sitd_pool = dma_pool_create("ehci_sitd", + ehci_to_hcd(ehci)->self.sysdev, sizeof (struct ehci_sitd), 32 /* byte alignment (for hw parts) */, 4096 /* can't cross 4K */); @@ -199,7 +199,7 @@ static int ehci_mem_init (struct ehci_hcd *ehci, gfp_t flags) /* Hardware periodic table */ ehci->periodic = (__le32 *) - dma_alloc_coherent (ehci_to_hcd(ehci)->self.controller, + dma_alloc_coherent(ehci_to_hcd(ehci)->self.sysdev, ehci->periodic_size * sizeof(__le32), &ehci->periodic_dma, flags); if (ehci->periodic == NULL) { -- 2.7.4