* Re: [RFC PATCH v1 24/40] metag: DMA
[not found] ` <50AF9C06.3010705@imgtec.com>
@ 2012-11-23 16:20 ` James Hogan
2012-11-23 16:47 ` Arnd Bergmann
0 siblings, 1 reply; 4+ messages in thread
From: James Hogan @ 2012-11-23 16:20 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linux-arch, linux-kernel
On 23/11/12 15:53, James Hogan wrote:
> On 09/11/12 14:25, Arnd Bergmann wrote:
>> On Wednesday 31 October 2012, James Hogan wrote:
>>> +static inline void
>>> +dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
>>> + enum dma_data_direction direction)
>>> +{
>>> + BUG_ON(!valid_dma_direction(direction));
>>> + dma_sync_for_cpu((void *)bus_to_virt(dma_addr), size, direction);
>>> +}
>>
>> bus_to_virt is deprecated an should not be visible to device drivers
>> any more for new stuff. Maybe you can remove the definition and introduce
>> a __bus_to_virt() function for internal use that also returns a pointer
>> type instead.
>
> Hi Arnd,
>
> Is there any reason not to just directly use phys_to_virt (which
> bus_to_virt was defined as before)?
>
> Thanks
> James
>
asm-generic/io.h has bitten me. Does the following look reasonable?
Thanks
James
Subject: [PATCH 1/1] asm-generic/io.h: check CONFIG_VIRT_TO_BUS
Make asm-generic/io.h check CONFIG_VIRT_TO_BUS before defining
virt_to_bus() and bus_to_virt(), otherwise it's easy to accidentally
have a silently failing incorrect direct mapped definition rather then
no definition at all.
Signed-off-by: James Hogan <james.hogan@imgtec.com>
---
include/asm-generic/io.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index 616eea5..34823ef 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -350,6 +350,7 @@ extern void ioport_unmap(void __iomem *p);
#define xlate_dev_kmem_ptr(p) p
#define xlate_dev_mem_ptr(p) __va(p)
+#ifdef CONFIG_VIRT_TO_BUS
#ifndef virt_to_bus
static inline unsigned long virt_to_bus(volatile void *address)
{
@@ -361,6 +362,7 @@ static inline void *bus_to_virt(unsigned long address)
return (void *) address;
}
#endif
+#endif
#define memset_io(a, b, c) memset(__io_virt(a), (b), (c))
#define memcpy_fromio(a, b, c) memcpy((a), __io_virt(b), (c))
--
1.7.7.6
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [RFC PATCH v1 24/40] metag: DMA
2012-11-23 16:20 ` [RFC PATCH v1 24/40] metag: DMA James Hogan
@ 2012-11-23 16:47 ` Arnd Bergmann
2013-01-09 16:04 ` James Hogan
0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2012-11-23 16:47 UTC (permalink / raw)
To: James Hogan; +Cc: linux-arch, linux-kernel
On Friday 23 November 2012, James Hogan wrote:
> Subject: [PATCH 1/1] asm-generic/io.h: check CONFIG_VIRT_TO_BUS
>
> Make asm-generic/io.h check CONFIG_VIRT_TO_BUS before defining
> virt_to_bus() and bus_to_virt(), otherwise it's easy to accidentally
> have a silently failing incorrect direct mapped definition rather then
> no definition at all.
>
> Signed-off-by: James Hogan <james.hogan@imgtec.com>
Good catch!
Acked-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC PATCH v1 24/40] metag: DMA
2012-11-23 16:47 ` Arnd Bergmann
@ 2013-01-09 16:04 ` James Hogan
2013-01-09 16:08 ` Arnd Bergmann
0 siblings, 1 reply; 4+ messages in thread
From: James Hogan @ 2013-01-09 16:04 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linux-arch, linux-kernel
On 23/11/12 16:47, Arnd Bergmann wrote:
> On Friday 23 November 2012, James Hogan wrote:
>> Subject: [PATCH 1/1] asm-generic/io.h: check CONFIG_VIRT_TO_BUS
>>
>> Make asm-generic/io.h check CONFIG_VIRT_TO_BUS before defining
>> virt_to_bus() and bus_to_virt(), otherwise it's easy to accidentally
>> have a silently failing incorrect direct mapped definition rather then
>> no definition at all.
>>
>> Signed-off-by: James Hogan <james.hogan@imgtec.com>
>
> Good catch!
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
>
Hi Arnd,
Would you like me to include this in the meta patchset or is it okay for
you to take it through the asm-generic tree? (I can resend separately if
you like)
Thanks
James
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC PATCH v1 24/40] metag: DMA
2013-01-09 16:04 ` James Hogan
@ 2013-01-09 16:08 ` Arnd Bergmann
0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2013-01-09 16:08 UTC (permalink / raw)
To: James Hogan; +Cc: linux-arch, linux-kernel
On Wednesday 09 January 2013, James Hogan wrote:
> Would you like me to include this in the meta patchset or is it okay for
> you to take it through the asm-generic tree? (I can resend separately if
> you like)
I usually prefer patches to go through the tree of whoever needs them
for asm-generic.
Arnd
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-01-09 16:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1351700061-7203-1-git-send-email-james.hogan@imgtec.com>
[not found] ` <1351700061-7203-25-git-send-email-james.hogan@imgtec.com>
[not found] ` <201211091425.13492.arnd@arndb.de>
[not found] ` <50AF9C06.3010705@imgtec.com>
2012-11-23 16:20 ` [RFC PATCH v1 24/40] metag: DMA James Hogan
2012-11-23 16:47 ` Arnd Bergmann
2013-01-09 16:04 ` James Hogan
2013-01-09 16:08 ` Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox