lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 6 Feb 2017 17:13:39 +0800
From:   Peter Chen <peter.chen@....com>
To:     <gregkh@...uxfoundation.org>, <stern@...land.harvard.edu>,
        <ulf.hansson@...aro.org>, <broonie@...nel.org>, <sre@...nel.org>,
        <robh+dt@...nel.org>, <shawnguo@...nel.org>, <rjw@...ysocki.net>,
        <dbaryshkov@...il.com>
CC:     <heiko@...ech.de>, <linux-arm-kernel@...ts.infradead.org>,
        <p.zabel@...gutronix.de>, <devicetree@...r.kernel.org>,
        <pawel.moll@....com>, <mark.rutland@....com>,
        <linux-usb@...r.kernel.org>, <arnd@...db.de>,
        <s.hauer@...gutronix.de>, <mail@...iej.szmigiero.name>,
        <troy.kisky@...ndarydevices.com>, <festevam@...il.com>,
        <oscar@...andei.net>, <stephen.boyd@...aro.org>,
        <linux-pm@...r.kernel.org>, <stillcompiling@...il.com>,
        <linux-kernel@...r.kernel.org>, <mka@...omium.org>,
        <vaibhav.hiremath@...aro.org>, <gary.bisson@...ndarydevices.com>,
        <hverkuil@...all.nl>, <krzk@...nel.org>,
        Peter Chen <peter.chen@....com>,
        Sriram Dash <sriram.dash@....com>
Subject: [PATCH v12 7/9] usb: ehci: use bus->sysdev for DMA configuration

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 <arnd@...db.de>
Cc: Sriram Dash <sriram.dash@....com>
Signed-off-by: Peter Chen <peter.chen@....com>
---
 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ