Re: Coherent DMA mask warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Greg,

in our case, the warning was down to the device itself (Zorro device,
even older than platform devices) having no storage for
coherent_dma_mask allocated. That caused dma_alloc_coherent to fail.

Please verify that the device allocated by the platform driver does
have storage for coherent_dma_mask allocated. (As Lino pointed out,
check the return code of dma_alloc_coherent in the first instance.)

Apologies if we dropped you from the CC list on that conversation...

Cheers,

  Michael


On Wed, Mar 28, 2018 at 1:46 AM, Greg Ungerer <gerg@xxxxxxxxxxxxxx> wrote:
Hi Michael,

On 26/02/18 14:42, Michael Schmitz wrote:

the driver in question must use dma_alloc_coherent without good reason,
then ...

The line that triggers it in my case is

         esp->command_block = dma_alloc_coherent(esp->dev, 16,
                                                 &esp->command_block_dma,
                                                 GFP_KERNEL);

Am I reading the DMA API documentation correctly if I conclude DMA
addressable main memory on the m68k architecture is always consistent or
coherent (some semantic confusion about the two), regardless of the need
for processor cache maintenance on most processors?


It turned out that it was the freescale FEC ethernet driver in my case.
(https://www.spinics.net/lists/linux-m68k/msg11113.html)

I don't think there is any doubt that it is using dma_alloc_coherent()
correctly. And I haven't seen any reports of this warning triggering
on ARM platforms that use this driver (iMX family). Things is they all
use devicetree whereas the ColdFire uses the old style platform driver
setup.

Regards
Greg



Geert: I suppose ARAnyM uses no driver that would do DMA. The SCSI
driver might go through the motions and register DMA accessible memory
for use as dribble buffer, but it does not use the DMA API for that
(needs to access ST-RAM from either pool set aside at boot right after
the end of kernel code, or from ioremapped ST-RAM if the kernel runs in
FastRAM).

Cheers,

        Michael




Am 26.02.2018 um 12:50 schrieb Greg Ungerer:

On 25/02/18 20:47, Geert Uytterhoeven wrote:

Hi Michael,

On Sat, Feb 24, 2018 at 10:40 PM, Michael Schmitz <schmitzmic@xxxxxxxxx>
wrote:

I just the saw a coherent DMA warning triggered by zorro_esp after
updating to 4.16-rc2 (commit 205e1b7f51e4af2643eb1d61a6503e415cd1e014).
What DMA mask should Zorro devices use? The full 32 bit address space
can be used by the Amiga DMA engines, right?

Are DMA engines on m68k at all coherent? We do use explicit cache push
or invalidate on the address range programmed for DMA, so no coherent
DMA?


Greg reported a similar issue.
https://lkml.org/lkml/2018/2/23/1336

Haven't looked into it myself yet (it doesn't trigger on ARAnyM ;-)


Funny thing is that platform I see it on doesn't use DMA at all...

Regards
Greg



Gr{oetje,eeting}s,

                         Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 --
geert@xxxxxxxxxxxxxx

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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux