public inbox for iommu@lists.linux-foundation.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@armlinux.org.uk>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "open list:DRM PANEL DRIVERS" <dri-devel@lists.freedesktop.org>,
	iommu@lists.linux-foundation.org,
	Robin Murphy <robin.murphy@arm.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>
Subject: Re: [PATCH] of/platform: Initialise AMBA default DMA masks
Date: Tue, 28 Aug 2018 15:14:14 +0100	[thread overview]
Message-ID: <20180828141413.GH30658@n2100.armlinux.org.uk> (raw)
In-Reply-To: <CACRpkdbLOGE2TiNxnV+L9Y=9QJ9jt-tv4GjDB3iTpJFj_w-5SQ@mail.gmail.com>

On Tue, Aug 28, 2018 at 03:25:55PM +0200, Linus Walleij wrote:
> On Tue, Aug 28, 2018 at 11:21 AM Christoph Hellwig <hch@lst.de> wrote:
> 
> > > +     dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
> > > +     if (!dev->dev.dma_mask)
> > > +             dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
> >
> > We should never set dma_mask to point to the coherent_dma_mask,
> > as that will cause problems with devices that have different
> > mask for the two.
> >
> > How about something like this?
> (...)
> > +       u64                     dma_mask;
> 
> We did that before, so this becomes effectively a revert of:
> commit 446b2a9380b64b9d7410d86ee8226031e03645cf
> 
>     DMA-API: amba: get rid of separate dma_mask
> 
>     AMBA Primecell devices always treat streaming and coherent DMA exactly
>     the same, so there's no point in having the masks separated.
> 
> So there is some history around this.
> 
> There is also some code in drivers/amba/bus.c affected by that
> and I need to look over all static amba device allocations if we
> reintroduce this.

I don't have the rest of this thread to read...

But yes, the fundamental fact is that AMBA devices don't have any
care about the differences between coherent and streaming DMA.  The
distinction that we make in the kernel is purely a software one when
it comes to these devices.

Most AMBA devices themselves are not DMA capable, as they are only
connected to the APB (Amba peripheral bus) and they rely on a
separate DMA engine for their DMA.  APB devices should not have DMA
masks - their DMA capabilities are entirely down to the DMA controller.
So, the majority of AMBA devices should not have any DMA masks.

Only those connected to a bus that they can master on (eg AXI) should
have DMA masks - things like the PL08x DMA controllers, PL11x LCD
controllers, etc.  As I've said above, there is no difference between
streaming and coherent DMA for these devices.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 13.8Mbps down 630kbps up
According to speedtest.net: 13Mbps down 490kbps up
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-08-28 14:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-28  8:44 [PATCH] of/platform: Initialise AMBA default DMA masks Linus Walleij
2018-08-28  9:23 ` Christoph Hellwig
2018-08-28 13:25   ` Linus Walleij
2018-08-28 14:14     ` Russell King - ARM Linux [this message]
     [not found]       ` <20180828141413.GH30658-l+eeeJia6m9URfEZ8mYm6t73F7V6hmMc@public.gmane.org>
2018-08-29  5:55         ` Christoph Hellwig
     [not found]           ` <20180829055521.GA28958-jcswGhMUV9g@public.gmane.org>
2018-08-30  8:40             ` Russell King - ARM Linux
     [not found]               ` <20180830084014.GJ30658-l+eeeJia6m9URfEZ8mYm6t73F7V6hmMc@public.gmane.org>
2018-08-30  8:45                 ` Linus Walleij
     [not found]                   ` <CACRpkdYbaZj4z_RYST2+HuA9A1YQZ3-xM0J0xBdFLWzZ_0=u4w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-08-30 17:01                     ` Russell King - ARM Linux
2018-08-29  5:55     ` Christoph Hellwig

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=20180828141413.GH30658@n2100.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linus.walleij@linaro.org \
    --cc=m.szyprowski@samsung.com \
    --cc=robin.murphy@arm.com \
    /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