From: Andreas Herrmann <andreas.herrmann@caviumnetworks.com>
To: Florian Fainelli <f.fainelli@gmail.com>
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>
Subject: Re: [PATCH 3/3] USB: host: Introduce flag to enable use of 64-bit dma_mask for ehci-platform
Date: Fri, 14 Nov 2014 09:51:57 +0100 [thread overview]
Message-ID: <20141114085157.GA13424@alberich> (raw)
In-Reply-To: <CAGVrzcbAjMGBdTenpJv6_OQ4oPYGScQ0gMOFsO8gf-R7Wy-=Lg@mail.gmail.com>
On Thu, Nov 13, 2014 at 08:44:17PM -0800, Florian Fainelli wrote:
> 2014-11-13 13:36 GMT-08:00 Andreas Herrmann
> <andreas.herrmann@caviumnetworks.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.
>
> Why not just allow enforcing an arbitrary DMA mask?
I thought about that but as it's currently just 32 or 64 bits
a flag is sufficient. (At the moment I am not aware that
other ehci-platform devices would require something else.)
I'll change the flag to a mask if desired.
Alan, what's your opinion about this?
Andreas
> > Cc: David Daney <david.daney@cavium.com>
> > Cc: Alex Smith <alex.smith@imgtec.com>
> > Cc: Alan Stern <stern@rowland.harvard.edu>
> > Signed-off-by: Andreas Herrmann <andreas.herrmann@caviumnetworks.com>
> > ---
> > 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(-)
> >
> > 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 2da18ea..6df808b 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 7eb4dcd..f69529e 100644
> > --- a/include/linux/usb/ehci_pdriver.h
> > +++ b/include/linux/usb/ehci_pdriver.h
> > @@ -45,6 +45,7 @@ struct usb_ehci_pdata {
> > unsigned big_endian_desc:1;
> > unsigned big_endian_mmio:1;
> > unsigned no_io_watchdog:1;
> > + unsigned dma_mask_64:1;
> >
> > /* Turn on all power and clocks */
> > int (*power_on)(struct platform_device *pdev);
> > --
> > 1.7.9.5
> >
> >
>
>
>
> --
> Florian
next prev parent reply other threads:[~2014-11-14 8:52 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-13 21:36 [PATCH 0/3] USB: host: Misc patches to remove hard-coded octeon platform information Andreas Herrmann
2014-11-13 21:36 ` [PATCH 1/3] USB: host: Remove ehci-octeon and ohci-octeon drivers Andreas Herrmann
2014-11-14 9:31 ` Ralf Baechle
2014-11-14 9:58 ` Andreas Herrmann
2014-11-25 1:21 ` Greg KH
2014-11-25 10:23 ` Andreas Herrmann
2014-11-25 11:28 ` [PATCH 1/3 v2] " Andreas Herrmann
2014-11-25 17:19 ` Greg KH
2014-11-13 21:36 ` [PATCH 2/3] USB: host: Remove hard-coded octeon platform information for ehci/ohci Andreas Herrmann
2014-11-14 9:33 ` Ralf Baechle
2014-11-13 21:36 ` [PATCH 3/3] USB: host: Introduce flag to enable use of 64-bit dma_mask for ehci-platform Andreas Herrmann
2014-11-14 4:44 ` Florian Fainelli
2014-11-14 8:51 ` Andreas Herrmann [this message]
2014-11-14 15:23 ` Alan Stern
2014-11-14 17:34 ` Florian Fainelli
2014-11-13 22:13 ` [PATCH 0/3] USB: host: Misc patches to remove hard-coded octeon platform information Alan Stern
2014-11-14 11:47 ` Andreas Herrmann
2014-11-14 20:32 ` Aaro Koskinen
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=20141114085157.GA13424@alberich \
--to=andreas.herrmann@caviumnetworks.com \
--cc=alex.smith@imgtec.com \
--cc=david.daney@cavium.com \
--cc=f.fainelli@gmail.com \
--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