From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] USB: set device dma_mask without reference to global data
Date: Thu, 9 May 2013 22:33:49 +0100 [thread overview]
Message-ID: <20130509213349.GN21614@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <201305080142.12025.arnd@arndb.de>
On Wed, May 08, 2013 at 01:42:11AM +0200, Arnd Bergmann wrote:
> On Wednesday 08 May 2013, Greg Kroah-Hartman wrote:
> > On Tue, May 07, 2013 at 04:53:52PM -0600, Stephen Warren wrote:
> > > From: Stephen Warren <swarren@nvidia.com>
>
> > > Suggested-by: Arnd Bergmann <arnd@arndb.de>
> > > Signed-off-by: Stephen Warren <swarren@nvidia.com>
> >
> > So this needs to go in for 3.10, right? Any older kernels as well? If
> > so, which ones?
>
> The fix should definitely go into 3.10, but I'd suggest waiting with
> the backport for a couple of -rc releases to avoid possible regressions.
> We know that the current code is broken, but few people fully understand
> what is going on with coherent_dma_mask, so it might cause new problems
> in combination with some other unknown bug, and I don't see this as
> urgent: none of the ARM defconfigs build this driver as a loadable
> module and there is no bug in the built-in case. For some reason, only
> the ARM back-end drivers are broken.
>
> The first occurence was apparently in 3.3, but only in ehci-tegra.c,
> while the other drivers subsequently copied the bug.
I've already suggested this approach:
diff --git a/arch/arm/include/asm/device.h b/arch/arm/include/asm/device.h
index dc662fc..51bb740 100644
--- a/arch/arm/include/asm/device.h
+++ b/arch/arm/include/asm/device.h
@@ -22,6 +22,7 @@ struct dev_archdata {
struct omap_device;
struct pdev_archdata {
+ u64 dma_mask;
#ifdef CONFIG_ARCH_OMAP
struct omap_device *od;
#endif
And then we can have dev->dma_mask pointed at that instead, which fully
eliminates any possible problems of things like dma_set_mask() interfering
with dma_set_coherent_mask().
Even better - because this is a common problem - would be to make 'dma_mask'
be a member of struct platform_device so that all arches can sort this
out once and for all (correction: generic code/drivers can in an arch-
independent way.) IOW:
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 9abf1db..121c74c 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -26,6 +26,7 @@ struct platform_device {
struct device dev;
u32 num_resources;
struct resource *resource;
+ u64 dma_mask;
const struct platform_device_id *id_entry;
next prev parent reply other threads:[~2013-05-09 21:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-07 22:53 [PATCH] USB: set device dma_mask without reference to global data Stephen Warren
2013-05-07 23:04 ` Greg Kroah-Hartman
2013-05-07 23:42 ` Arnd Bergmann
2013-05-08 14:14 ` Alan Stern
2013-05-08 15:10 ` Arnd Bergmann
2013-05-09 21:33 ` Russell King - ARM Linux [this message]
2013-05-08 1:13 ` Peter Chen
2013-05-08 2:26 ` Stephen Warren
2013-05-08 2:54 ` Peter Chen
2013-05-08 7:11 ` Matthijs Kooijman
2013-05-08 7:28 ` Matthijs Kooijman
2013-05-08 13:50 ` Rob Herring
2013-05-08 14:07 ` Arnd Bergmann
2013-05-08 7:24 ` Arnd Bergmann
2013-05-09 21:39 ` Russell King - ARM Linux
2013-05-08 22:42 ` Stephen Warren
2013-05-09 21:36 ` Russell King - ARM Linux
2013-05-08 5:11 ` Tony Prisk
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=20130509213349.GN21614@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).