devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jim Quinlan <jim2101024@gmail.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	Brian Norris <computersforpeace@gmail.com>,
	Russell King <rmk+kernel@armlinux.org.uk>,
	Robin Murphy <robin.murphy@arm.com>,
	Jonas Gorski <jonas.gorski@gmail.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
	<devicetree@vger.kernel.org>,
	Linux-MIPS <linux-mips@linux-mips.org>,
	linux-pci <linux-pci@vger.kernel.org>,
	Kevin Cernekee <cernekee@gmail.com>,
	Ralf Baechle <ralf@linux-mips.org>,
	bcm-kern
Subject: Re: [PATCH v4 4/8] PCI: brcmstb: Add dma-range mapping for inbound traffic
Date: Mon, 12 Feb 2018 08:39:43 -0500	[thread overview]
Message-ID: <CANCKTBvS8jCgoq4EzBSdXeQ_Hc50+WHfyAoc=H8LJTbF3dCtNA@mail.gmail.com> (raw)
In-Reply-To: <CANCKTBszKRp7gYKE=S3fA0=MoOVFFkO6PgmR476t3HAJ9US2gg@mail.gmail.com>

On Fri, Jan 26, 2018 at 12:46 PM, Jim Quinlan <jim2101024@gmail.com> wrote:
> On Fri, Jan 26, 2018 at 2:53 AM, Christoph Hellwig <hch@lst.de> wrote:
>> On Wed, Jan 24, 2018 at 12:04:58PM -0800, Florian Fainelli wrote:
>>> This looks nicer than the current shape, but this still requires to
>>> register a PCI fixup to override phys_to_dma() and dma_to_phys(), and it
>>> would appear that you have dodged my question about how this is supposed
>>> to fit with an entirely modular PCIe root complex driver? Are you
>>> suggesting that we split the module into a built-in part and a modular part?
>>
>> I don't think entirely modular PCI root bridges should be a focal point
>> for the design.  If we happen to support them by other design choices:
>> fine, but they should not be a priority.
>
> I disagree.  If there is one common thing our customers request  it is
> the ability to remove (or control the insmod of after boot)  the pcie
> RC driver.  I didn't add this in as a "nice-to-have".
>
>>
>> That being said if we have core dma mapping or PCIe code that has
>> a list of offsets and the root complex only populates them it should
>> work just fine.
>
> I'm looking at arch/arm/include/asm/dma-mapping.h.  In addition to
> overriding dma_to_phsy() and phys_to_dma(), it looks like I may have
> to define __arch_pfn_to_dma(), __arch_dma_to_pfn(),
> __arch_dma_to_virt(), __arch_virt_to_dma().  Do  you agree or is this
> not necessary?  If it is, this seems more intrusive than our
> pcie-brcmstb-dma.c solution which  doesn't require tentacles into
> major include files and Kconfigs.
>
> Another issue is that our function wrappers -- depending upon whether
> we are dealing with a pci device or not -- will have to possibly call
> the actual ARM and ARM64 definitions of these functions, which have
> been of course #ifdef'd out.  This means that our code must contain
> identical copies of these functions' code and that the code must
> somehow be kept in sync.  Do you see a solution to this?
>
> Jim

Cristoph,
Could you please respond to my comments?  Even a negative response is
better than none.  The problem with doing what you suggested is with
ARM -- ARM64 and MIPS relatively uncomplicated .  With ARM, I have to
define the aforementioned functions -- the only way of doing this is
to define arch/arm/mach-bcm/include/mach/memory.h, and for that to be
picked up we no longer can have CONFIG_ARCH_MULTIPLATFORM=y, which is
an unacceptable cost to pay for just an unusual PCIe RC controller.

Regarding my current submission -- you are right, SWIOTLB will not
work for EPs that require it.  However, we don't care about these
devices, and can just bailout with EPs when the dma_mask is <=
0xffff_ffff or if swiotlb_force ==  SWIOTLB_FORCE.  Note that this
would only affect PCIe DMA.  We also have no plan of using MIPS64.

-- Jim

  reply	other threads:[~2018-02-12 13:39 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
     [not found] ` <1516058925-46522-1-git-send-email-jim2101024-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
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
     [not found]     ` <CAL_JsqKpWNJXNpKS5qC99N0+H_P37DcRE-rN9HFwT5tVmRFCNw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-18  7:31       ` Christoph Hellwig
2018-01-18 15:09         ` Florian Fainelli
     [not found]           ` <EDAEFB0F-BB7C-444A-B282-F178F5ADFCBF-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-18 15:23             ` Christoph Hellwig
2018-01-19 19:47               ` Florian Fainelli
2018-01-23 13:20                 ` Christoph Hellwig
2018-01-24 20:04                   ` Florian Fainelli
     [not found]                     ` <f746f9d5-b12d-9ffc-83e3-3851b4de6e52-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-26  7:53                       ` Christoph Hellwig
2018-01-26 17:46                         ` Jim Quinlan
2018-02-12 13:39                           ` Jim Quinlan [this message]
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='CANCKTBvS8jCgoq4EzBSdXeQ_Hc50+WHfyAoc=H8LJTbF3dCtNA@mail.gmail.com' \
    --to=jim2101024@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=cernekee@gmail.com \
    --cc=computersforpeace@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=hch@lst.de \
    --cc=jonas.gorski@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=ralf@linux-mips.org \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=robh+dt@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=will.deacon@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;
as well as URLs for NNTP newsgroup(s).