From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH] ARM64: PCI: inherit root controller's dma-coherent
Date: Thu, 27 Nov 2014 10:22:03 +0000 [thread overview]
Message-ID: <20141127102203.GD20649@arm.com> (raw)
In-Reply-To: <2081877.zLc8dS8vkP@wuerfel>
On Thu, Nov 27, 2014 at 09:03:38AM +0000, Arnd Bergmann wrote:
> On Thursday 27 November 2014 13:41:31 Ming Lei wrote:
>
> > @@ -37,6 +38,21 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res,
> > return res->start;
> > }
> >
> > +/* Inherit root controller's dma coherent ops */
> > +static void pci_dma_config(struct pci_dev *dev)
> > +{
> > + struct pci_bus *bus = dev->bus;
> > + struct device *host;
> > +
> > + while (!pci_is_root_bus(bus)) {
> > + bus = bus->parent;
> > + }
> > +
> > + host = bus->dev.parent->parent;
> > + if (of_dma_is_coherent(host->of_node))
> > + set_arch_dma_coherent_ops(&dev->dev);
> > +}
> > +
>
> I think we need something more generic than this: This is not architecture
> specific at all, and we have to deal with IOMMU, swiotlb, dma offset and
> dma mask as well, coherency is definitely not the only issue.
Yeah, and we need to extend the IOMMU binding to express RequesterID ->
StreamID (master ID) mappings at the host controller, too.
Will
next prev parent reply other threads:[~2014-11-27 10:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-27 5:41 [RFC PATCH] ARM64: PCI: inherit root controller's dma-coherent Ming Lei
2014-11-27 7:39 ` Jon Masters
2014-11-27 9:05 ` Arnd Bergmann
2014-11-27 11:36 ` Catalin Marinas
2014-11-27 11:53 ` Arnd Bergmann
2014-11-27 9:03 ` Arnd Bergmann
2014-11-27 10:14 ` Ming Lei
2014-11-27 10:14 ` Ming Lei
2014-11-27 10:22 ` Will Deacon [this message]
2014-12-04 3:40 ` Ming Lei
2014-12-05 13:26 ` Grygorii Strashko
2014-12-05 16:05 ` Arnd Bergmann
2014-12-09 2:53 ` Ming Lei
2014-12-10 16:06 ` Arnd Bergmann
2014-12-10 16:23 ` Robin Murphy
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=20141127102203.GD20649@arm.com \
--to=will.deacon@arm.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.