linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: florian.fainelli@broadcom.com (Florian Fainelli)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 4/8] PCI: brcmstb: Add dma-range mapping for inbound traffic
Date: Fri, 19 Jan 2018 11:47:54 -0800	[thread overview]
Message-ID: <d62226a2-a92c-cdcb-4a9b-e69ab677bc60@broadcom.com> (raw)
In-Reply-To: <20180118152331.GA24461@lst.de>

On 01/18/2018 07:23 AM, Christoph Hellwig wrote:
> On Thu, Jan 18, 2018 at 07:09:23AM -0800, Florian Fainelli wrote:
>>> But in this case it actually is the example to follow as told
>>> previously.
>>>
>>> NAK again for these chained dma ops that only create problems.
>>
>> Care to explain what should be done instead?
> 
> Override phys_to_dma and dma_to_phys as mips and x86 do for similar
> situations.

How can this work well in the context of a loadable module for instance?
For MIPS, this would mean that we have to override phys_to_dma() and
dma_to_phys() in the platform that is *susceptible* to use this PCIe
controller (arch/mips/bmips) which is fine, but there, we essentially
need to find a way to make this dynamic based on whether the PCIe
controller is loaded or not.

As you might have seen from this patch, what needs to be done is highly
dependent on the processor architecture and its memory controller
physical memory map, so I don't see how we are in any better situation
if we need to replicate 3 times across MIPS, ARM and ARM64 how the
addresses need to be mangled.

Are you suggesting we somehow decouple the memory mangling part into a
portion that can be built into the kernel image (so phys_to_dma() and
dma_to_phys() is resolved at vmlinux link time) and can be selected by
different architectures that need it? If so, yikes.

> 
> Bonous points of finding some generic way of doing it instead of
> hiding it in arch code.
> 

I can see value in having a generic mechanism, ala X86_DMA_REMAP
allowing architectures to have the ability to override phys_to_dma() and
dma_to_phys() but right now, especially if we look at
arch/x86/pci/sta2x11-fixup.c this really appears to be quite messy and
equally ugly than stacking operations...

What is the actual problem you want to avoid with the stacking of DMA
operations, is it because it becomes harder to audit, or are there are
other reasons?
-- 
Florian

  reply	other threads:[~2018-01-19 19:47 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-15 23:28 [PATCH v4 0/8] PCI: brcmstb: Add Broadcom Settopbox PCIe support Jim Quinlan
2018-01-15 23:28 ` [PATCH v4 1/8] SOC: brcmstb: add memory API Jim Quinlan
2018-03-09 15:07   ` James Hogan
2018-01-15 23:28 ` [PATCH v4 2/8] dt-bindings: pci: Add DT docs for Brcmstb PCIe device Jim Quinlan
2018-01-19 19:20   ` Rob Herring
2018-01-15 23:28 ` [PATCH v4 3/8] PCI: brcmstb: Add Broadcom STB PCIe host controller driver Jim Quinlan
2018-01-15 23:28 ` [PATCH v4 4/8] PCI: brcmstb: Add dma-range mapping for inbound traffic Jim Quinlan
2018-01-18  2:15   ` Rob Herring
2018-01-18  7:31     ` Christoph Hellwig
2018-01-18 15:09       ` Florian Fainelli
2018-01-18 15:23         ` Christoph Hellwig
2018-01-19 19:47           ` Florian Fainelli [this message]
2018-01-23 13:20             ` Christoph Hellwig
2018-01-24 20:04               ` Florian Fainelli
2018-01-26  7:53                 ` Christoph Hellwig
2018-01-26 17:46                   ` Jim Quinlan
2018-02-12 13:39                     ` Jim Quinlan
2018-01-15 23:28 ` [PATCH v4 5/8] PCI/MSI: Enable PCI_MSI_IRQ_DOMAIN support for MIPS Jim Quinlan
2018-01-15 23:28 ` [PATCH v4 6/8] PCI: brcmstb: Add MSI capability Jim Quinlan
2018-01-15 23:28 ` [PATCH v4 7/8] MIPS: BMIPS: Add PCI bindings for 7425, 7435 Jim Quinlan
2018-03-09 14:44   ` James Hogan
2018-01-15 23:28 ` [PATCH v4 8/8] 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=d62226a2-a92c-cdcb-4a9b-e69ab677bc60@broadcom.com \
    --to=florian.fainelli@broadcom.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 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).