linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: hch@lst.de (Christoph Hellwig)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/9] PCI: host: brcmstb: add dma-ranges for inbound traffic
Date: Thu, 19 Oct 2017 11:16:44 +0200	[thread overview]
Message-ID: <20171019091644.GA14983@lst.de> (raw)
In-Reply-To: <CANCKTBv+yiCNsrnx3m+W9wPqC4NdKPZ2p=zLtSa8fX6v1rPcYQ@mail.gmail.com>

On Wed, Oct 18, 2017 at 10:41:17AM -0400, Jim Quinlan wrote:
> That's what brcm_to_{pci,cpu} are for -- they keep a list of the
> dma-ranges given in the PCIe DT node, and translate from system memory
> addresses to pci-space addresses, and vice versa.  As long as people
> are using the DMA API it should work.  It works for all of the ARM,
> ARM64, and MIPS Broadcom systems I've tested, using eight different EP
> devices.  Note that I am not thrilled to be advocating this mechanism
> but it seemed the best alternative.

Say we are using your original example ranges:

 memc0-a@[        0....3fffffff] <=> pci@[        0....3fffffff]
 memc0-b@[100000000...13fffffff] <=> pci@[ 40000000....7fffffff]
 memc1-a@[ 40000000....7fffffff] <=> pci@[ 80000000....bfffffff]
 memc1-b@[300000000...33fffffff] <=> pci@[ c0000000....ffffffff]
 memc2-a@[ 80000000....bfffffff] <=> pci@[100000000...13fffffff]
 memc2-b@[c00000000...c3fffffff] <=> pci@[140000000...17fffffff]

and now you get a dma mapping request for physical addresses
3fffff00 to 4000000f, which would span two of your ranges.  How
is this going to work?

> I would prefer that the same code work for all three architectures.
> What I would like from ARM/ARM64 is the ability to override
> phys_to_dma() and dma_to_phys(); I thought the chances of that being
> accepted would be slim.  But you are right, I should ask the
> maintainers.

It is still better than trying to stack dma ops, which is a receipe
for problems down the road.

  reply	other threads:[~2017-10-19  9:16 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-11 22:34 PCI: brcmstb: Add Broadcom Settopbox PCIe support Jim Quinlan
2017-10-11 22:34 ` [PATCH 1/9] SOC: brcmstb: add memory API Jim Quinlan
2017-10-12 14:41   ` Julien Thierry
2017-10-12 16:53     ` Florian Fainelli
2017-10-17  8:24   ` Christoph Hellwig
2017-10-17 16:12     ` Florian Fainelli
2017-10-18  6:46       ` Christoph Hellwig
2017-10-18 16:47         ` Florian Fainelli
2017-10-11 22:34 ` [PATCH 2/9] PCI: host: brcmstb: add DT docs for Brcmstb PCIe device Jim Quinlan
2017-10-12  0:55   ` Brian Norris
2017-10-12 17:52     ` Jim Quinlan
2017-10-17 20:24   ` Rob Herring
2017-10-17 22:42     ` Jim Quinlan
2017-10-19 21:49       ` Rob Herring
2017-10-19 21:58         ` Florian Fainelli
2017-10-20 17:27           ` Brian Norris
2017-10-20 21:39             ` Rob Herring
2017-10-19 23:04         ` Jim Quinlan
2017-10-11 22:34 ` [PATCH 3/9] PCI: host: brcmstb: Broadcom PCIe Host Controller Jim Quinlan
2017-10-11 22:34 ` [PATCH 4/9] arm64: dma-mapping: export symbol arch_setup_dma_ops Jim Quinlan
2017-10-12 17:06   ` Robin Murphy
2017-10-12 18:15     ` Jim Quinlan
2017-10-11 22:34 ` [PATCH 5/9] PCI: host: brcmstb: add dma-ranges for inbound traffic Jim Quinlan
2017-10-12 18:04   ` Robin Murphy
2017-10-12 21:43     ` Jim Quinlan
2017-10-17  8:14     ` Christoph Hellwig
2017-10-17 16:11       ` Jim Quinlan
2017-10-18  6:53         ` Christoph Hellwig
2017-10-18 14:41           ` Jim Quinlan
2017-10-19  9:16             ` Christoph Hellwig [this message]
2017-10-19 22:47               ` Jim Quinlan
2017-10-20  7:37                 ` Christoph Hellwig
2017-10-20 14:41                   ` Jim Quinlan
2017-10-20 14:57                     ` Christoph Hellwig
2017-10-20 15:27                       ` Jim Quinlan
2017-10-20 16:17                         ` Christoph Hellwig
2017-10-23  9:06                         ` David Laight
2017-10-24 18:08                           ` Jim Quinlan
2017-10-25  9:36                             ` David Laight
2017-10-11 22:34 ` [PATCH 6/9] PCI/MSI: Enable PCI_MSI_IRQ_DOMAIN support for MIPS Jim Quinlan
2017-10-11 22:34 ` [PATCH 7/9] PCI: host: brcmstb: add MSI capability Jim Quinlan
2017-10-11 22:34 ` [PATCH 8/9] MIPS: BMIPS: add PCI bindings for 7425, 7435 Jim Quinlan
2017-10-11 22:34 ` [PATCH 9/9] MIPS: BMIPS: enable PCI Jim Quinlan

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=20171019091644.GA14983@lst.de \
    --to=hch@lst.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).