Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Andreas Herrmann <andreas.herrmann@caviumnetworks.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	David Daney <david.daney@cavium.com>,
	Alex Smith <alex.smith@imgtec.com>,
	Linux-MIPS <linux-mips@linux-mips.org>,
	linux-usb <linux-usb@vger.kernel.org>,
	Aaro Koskinen <aaro.koskinen@iki.fi>
Subject: [PATCH resend v3] USB: host: Introduce flag to enable use of 64-bit dma_mask for ehci-platform
Date: Mon, 12 Jan 2015 16:05:52 +0100	[thread overview]
Message-ID: <20150112150552.GA21637@alberich> (raw)
In-Reply-To: <20150109203027.GA5772@kroah.com>


ehci-octeon driver used a 64-bit dma_mask. With removal of ehci-octeon
and usage of ehci-platform ehci dma_mask is now limited to 32 bits
(coerced in ehci_platform_probe).

Provide a flag in ehci platform data to allow use of 64 bits for
dma_mask.

Cc: David Daney <david.daney@cavium.com>
Cc: Alex Smith <alex.smith@imgtec.com>
Signed-off-by: Andreas Herrmann <andreas.herrmann@caviumnetworks.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
---
 arch/mips/cavium-octeon/octeon-platform.c |    4 +---
 drivers/usb/host/ehci-platform.c          |    3 ++-
 include/linux/usb/ehci_pdriver.h          |    1 +
 3 files changed, 4 insertions(+), 4 deletions(-)


Patch rebased on usb-testing as of v3.19-rc2-21-g1d97869.


Thanks,

Andreas


diff --git a/arch/mips/cavium-octeon/octeon-platform.c b/arch/mips/cavium-octeon/octeon-platform.c
index eea60b6..12410a2 100644
--- a/arch/mips/cavium-octeon/octeon-platform.c
+++ b/arch/mips/cavium-octeon/octeon-platform.c
@@ -310,6 +310,7 @@ static struct usb_ehci_pdata octeon_ehci_pdata = {
 #ifdef __BIG_ENDIAN
 	.big_endian_mmio	= 1,
 #endif
+	.dma_mask_64	= 1,
 	.power_on	= octeon_ehci_power_on,
 	.power_off	= octeon_ehci_power_off,
 };
@@ -331,8 +332,6 @@ static void __init octeon_ehci_hw_start(struct device *dev)
 	octeon2_usb_clocks_stop();
 }
 
-static u64 octeon_ehci_dma_mask = DMA_BIT_MASK(64);
-
 static int __init octeon_ehci_device_init(void)
 {
 	struct platform_device *pd;
@@ -347,7 +346,6 @@ static int __init octeon_ehci_device_init(void)
 	if (!pd)
 		return 0;
 
-	pd->dev.dma_mask = &octeon_ehci_dma_mask;
 	pd->dev.platform_data = &octeon_ehci_pdata;
 	octeon_ehci_hw_start(&pd->dev);
 
diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
index 28aae64..63f2622 100644
--- a/drivers/usb/host/ehci-platform.c
+++ b/drivers/usb/host/ehci-platform.c
@@ -155,7 +155,8 @@ static int ehci_platform_probe(struct platform_device *dev)
 	if (!pdata)
 		pdata = &ehci_platform_defaults;
 
-	err = dma_coerce_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32));
+	err = dma_coerce_mask_and_coherent(&dev->dev,
+		pdata->dma_mask_64 ? DMA_BIT_MASK(64) : DMA_BIT_MASK(32));
 	if (err)
 		return err;
 
diff --git a/include/linux/usb/ehci_pdriver.h b/include/linux/usb/ehci_pdriver.h
index 6287b39..db0431b 100644
--- a/include/linux/usb/ehci_pdriver.h
+++ b/include/linux/usb/ehci_pdriver.h
@@ -48,6 +48,7 @@ struct usb_ehci_pdata {
 	unsigned	big_endian_mmio:1;
 	unsigned	no_io_watchdog:1;
 	unsigned	reset_on_resume:1;
+	unsigned	dma_mask_64:1;
 
 	/* Turn on all power and clocks */
 	int (*power_on)(struct platform_device *pdev);
-- 
1.7.9.5

  reply	other threads:[~2015-01-12 15:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-15 13:26 [PATCH 0/2 resend] USB: host: Misc patches to remove hard-coded octeon platform information Andreas Herrmann
2014-12-15 13:28 ` [PATCH 1/2 resend] USB: host: Remove hard-coded octeon platform information for ehci/ohci Andreas Herrmann
2014-12-15 16:04   ` Ralf Baechle
2014-12-15 13:30 ` [PATCH 2/2 resend] USB: host: Introduce flag to enable use of 64-bit dma_mask for ehci-platform Andreas Herrmann
2014-12-15 16:36 ` [PATCH 0/2 resend] USB: host: Misc patches to remove hard-coded octeon platform information Greg KH
2015-01-06 12:46 ` [PATCH 0/2 resend v2] " Andreas Herrmann
2015-01-06 12:48   ` [PATCH 1/2 resend v2] USB: host: Remove hard-coded octeon platform information for ehci/ohci Andreas Herrmann
2015-01-06 12:50   ` [PATCH 2/2 resend v2] USB: host: Introduce flag to enable use of 64-bit dma_mask for ehci-platform Andreas Herrmann
2015-01-06 15:49     ` Alan Stern
2015-01-07 11:12       ` Andreas Herrmann
2015-01-09 20:30     ` Greg KH
2015-01-12 15:05       ` Andreas Herrmann [this message]
2015-01-06 12:52   ` [PATCH 0/2 resend v2] USB: host: Misc patches to remove hard-coded octeon platform information Andreas Herrmann

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=20150112150552.GA21637@alberich \
    --to=andreas.herrmann@caviumnetworks.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=alex.smith@imgtec.com \
    --cc=david.daney@cavium.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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