From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Srinath Mannam <srinath.mannam@broadcom.com>,
Robin Murphy <robin.murphy@arm.com>,
Joerg Roedel <joro@8bytes.org>,
Eric Auger <eric.auger@redhat.com>,
poza@codeaurora.org, Ray Jui <rjui@broadcom.com>,
bcm-kernel-feedback-list@broadcom.com, linux-pci@vger.kernel.org,
iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 3/3] PCI: iproc: Add sorted dma ranges resource entries to host bridge
Date: Tue, 7 May 2019 10:41:02 +0100 [thread overview]
Message-ID: <20190507094102.GA10964@e121166-lin.cambridge.arm.com> (raw)
In-Reply-To: <20190506211208.GA156478@google.com>
On Mon, May 06, 2019 at 04:12:08PM -0500, Bjorn Helgaas wrote:
> On Fri, May 03, 2019 at 07:35:34PM +0530, Srinath Mannam wrote:
> > The IPROC host controller allows only a subset of physical address space
> > as target of inbound PCI memory transactions addresses.
> >
> > PCIe devices memory transactions targeting memory regions that
> > are not allowed for inbound transactions in the host controller
> > are rejected by the host controller and cannot reach the upstream
> > buses.
> >
> > Firmware device tree description defines the DMA ranges that are
> > addressable by devices DMA transactions; parse the device tree
> > dma-ranges property and add its ranges to the PCI host bridge dma_ranges
> > list; the iova_reserve_pci_windows() call in the driver will reserve the
> > IOVA address ranges that are not addressable (ie memory holes in the
> > dma-ranges set) so that they are not allocated to PCI devices for DMA
> > transfers.
> >
> > All allowed address ranges are listed in dma-ranges DT parameter.
> >
> > Example:
> >
> > dma-ranges = < \
> > 0x43000000 0x00 0x80000000 0x00 0x80000000 0x00 0x80000000 \
> > 0x43000000 0x08 0x00000000 0x08 0x00000000 0x08 0x00000000 \
> > 0x43000000 0x80 0x00000000 0x80 0x00000000 0x40 0x00000000>
> >
> > In the above example of dma-ranges, memory address from
> >
> > 0x0 - 0x80000000,
> > 0x100000000 - 0x800000000,
> > 0x1000000000 - 0x8000000000 and
> > 0x10000000000 - 0xffffffffffffffff.
> >
> > are not allowed to be used as inbound addresses.
> >
> > Based-on-patch-by: Oza Pawandeep <oza.oza@broadcom.com>
> > Signed-off-by: Srinath Mannam <srinath.mannam@broadcom.com>
> > [lorenzo.pieralisi@arm.com: updated commit log]
> > Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > Reviewed-by: Oza Pawandeep <poza@codeaurora.org>
> > Reviewed-by: Eric Auger <eric.auger@redhat.com>
> > ---
> > drivers/pci/controller/pcie-iproc.c | 44 ++++++++++++++++++++++++++++++++++++-
> > 1 file changed, 43 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/pci/controller/pcie-iproc.c b/drivers/pci/controller/pcie-iproc.c
> > index c20fd6b..94ba5c0 100644
> > --- a/drivers/pci/controller/pcie-iproc.c
> > +++ b/drivers/pci/controller/pcie-iproc.c
> > @@ -1146,11 +1146,43 @@ static int iproc_pcie_setup_ib(struct iproc_pcie *pcie,
> > return ret;
> > }
> >
> > +static int
> > +iproc_pcie_add_dma_range(struct device *dev, struct list_head *resources,
> > + struct of_pci_range *range)
>
> Just FYI, I cherry-picked these commits from Lorenzo's branch to fix
> the formatting of this prototype to match the rest of the file, e.g.:
Thank you, I noticed too but I forgot to update it before merging
v6 from the list.
Thanks,
Lorenzo
> > static int iproc_pcie_map_dma_ranges(struct iproc_pcie *pcie)
> > ...
> > static int iproce_pcie_get_msi(struct iproc_pcie *pcie,
next prev parent reply other threads:[~2019-05-07 9:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-03 14:05 [PATCH v6 0/3] PCIe Host request to reserve IOVA Srinath Mannam
2019-05-03 14:05 ` [PATCH v6 1/3] PCI: Add dma_ranges window list Srinath Mannam
2019-05-03 14:05 ` [PATCH v6 2/3] iommu/dma: Reserve IOVA for PCIe inaccessible DMA address Srinath Mannam
2019-05-03 14:05 ` [PATCH v6 3/3] PCI: iproc: Add sorted dma ranges resource entries to host bridge Srinath Mannam
2019-05-06 21:12 ` Bjorn Helgaas
2019-05-07 9:41 ` Lorenzo Pieralisi [this message]
2019-05-07 9:55 ` Srinath Mannam
2019-05-03 15:53 ` [PATCH v6 0/3] PCIe Host request to reserve IOVA Lorenzo Pieralisi
2019-05-03 16:06 ` Srinath Mannam
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=20190507094102.GA10964@e121166-lin.cambridge.arm.com \
--to=lorenzo.pieralisi@arm.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=eric.auger@redhat.com \
--cc=helgaas@kernel.org \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=poza@codeaurora.org \
--cc=rjui@broadcom.com \
--cc=robin.murphy@arm.com \
--cc=srinath.mannam@broadcom.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
all inboxes | Powered by JetHome®