Hi Michael,

On Wed, Dec 20, 2017 at 8:33 AM, Michael Schmitz <[email protected]> wrote:
> Am 19.12.2017 um 21:19 schrieb Geert Uytterhoeven:
>> On Tue, Dec 19, 2017 at 1:40 AM, Michael Schmitz <[email protected]> 
>> wrote:
>>> Contrary to the Mac driver, esp->command_block and
>>> esp->command_block_dma are not identical addresses on Amiga. Is there
>>> a generic way to map a DMA address (i.e., physical address AFAIK) to a
>>> kernel virtual one? (I can use esp->command_block in the reconnect
>>> message special case but not otherwise ...)
>>
>> The only generic way is to use the virtual and DMA addresses as returned
>> by the dma_map_*() functions.
>
> Yes, but there is no way to find the mapped virtual address given the
> DMA handle (=physical address). I suppose that would mean walking the
> page tables, looking for a mapping that bears the hallmarks of a DMA
> mapping?

Right. Not taking into account that some regions (e.g. Zorro II) may be mapped
using a fixed large mapping.

That'w why you should keep the DMA address returned by dma_map_*().

>> There may be some platform-specific legacy conversion routines around...
>
> phys_to_virt() does return _a_ mapping but it is not the DMA virtual
> mapping itself. Since we are doing PIO, the cache bits in the mapping
> may not matter at all here so this may be safe in general. It's a hack I
> would not want to submit for review though.

That's meant for RAM mapped by the kernel.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to