From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
To: Nathan Chancellor <natechancellor@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Kishon Vijay Abraham I <kishon@ti.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jingoo Han <jingoohan1@gmail.com>,
Gustavo Pimentel <gustavo.pimentel@synopsys.com>,
Marek Vasut <marek.vasut+renesas@gmail.com>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
Shawn Lin <shawn.lin@rock-chips.com>,
Heiko Stuebner <heiko@sntech.de>,
Andrew Murray <andrew.murray@arm.com>,
linux-pci <linux-pci@vger.kernel.org>,
LAK <linux-arm-kernel@lists.infradead.org>,
Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
"open list:ARM/Rockchip SoC..."
<linux-rockchip@lists.infradead.org>,
LKML <linux-kernel@vger.kernel.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@vger.kernel.org>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
clang-built-linux@googlegroups.com
Subject: Re: [PATCH v4 5/6] PCI: rcar: Add support for rcar PCIe controller in endpoint mode
Date: Wed, 12 Feb 2020 07:38:32 +0000 [thread overview]
Message-ID: <CA+V-a8vMcRvsh7+pcgD4jk50X0DtZ9uXFegZVXM5M1k-R6jOVA@mail.gmail.com> (raw)
In-Reply-To: <20200212034239.GA38314@ubuntu-m2-xlarge-x86>
Hi Nathan,
On Wed, Feb 12, 2020 at 3:42 AM Nathan Chancellor
<natechancellor@gmail.com> wrote:
>
> Hi Lad,
>
> On Sat, Feb 08, 2020 at 06:36:40PM +0000, Lad Prabhakar wrote:
> > This patch adds support for rcar PCIe controller to work in endpoint mode.
> >
> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> > ---
> > drivers/pci/controller/Kconfig | 7 +
> > drivers/pci/controller/Makefile | 1 +
> > drivers/pci/controller/pcie-rcar-ep.c | 492 ++++++++++++++++++++++++++++++++++
> > drivers/pci/controller/pcie-rcar.h | 6 +
> > 4 files changed, 506 insertions(+)
> > create mode 100644 drivers/pci/controller/pcie-rcar-ep.c
> >
>
> <snip>
>
> > diff --git a/drivers/pci/controller/pcie-rcar-ep.c b/drivers/pci/controller/pcie-rcar-ep.c
> > new file mode 100644
> > index 0000000..32a7fca
> > --- /dev/null
> > +++ b/drivers/pci/controller/pcie-rcar-ep.c
>
> <snip>
>
> > +static int rcar_pcie_ep_set_bar(struct pci_epc *epc, u8 func_no,
> > + struct pci_epf_bar *epf_bar)
> > +{
> > + struct rcar_pcie *ep = epc_get_drvdata(epc);
> > + dma_addr_t cpu_addr = epf_bar->phys_addr;
> > + int flags = epf_bar->flags | LAR_ENABLE | LAM_64BIT;
> > + enum pci_barno bar = epf_bar->barno;
> > + u64 size = 1ULL << fls64(epf_bar->size - 1);
> > + u32 mask;
> > + int idx;
> > + int err;
> > +
> > + idx = find_first_zero_bit(ep->ib_window_map, ep->num_ib_windows);
> > + if (idx >= ep->num_ib_windows) {
> > + dev_err(ep->dev, "no free inbound window\n");
> > + return -EINVAL;
> > + }
> > +
> > + if ((flags & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_IO)
> > + flags |= IO_SPACE;
> > +
> > + ep->bar_to_atu[bar] = idx;
> > + /* use 64 bit bars */
> > + set_bit(idx, ep->ib_window_map);
> > + set_bit(idx + 1, ep->ib_window_map);
> > +
> > + if (cpu_addr > 0) {
> > + unsigned long nr_zeros = __ffs64(cpu_addr);
> > + u64 alignment = 1ULL << nr_zeros;
> > +
> > + size = min(size, alignment);
> > + } else {
> > + size = size;
> > + }
>
> We received a report from the 0day bot that clang warns that this is
> unnecessary. Would you mind removing it if you have to spin up a new
> version?
>
Sure ill fix that.
Cheers,
--Prabhakar Lad
> You can view the full report here:
>
> https://groups.google.com/d/msg/clang-built-linux/KHUKw5L8yxw/Mb7KRMG7BQAJ
>
> Cheers,
> Nathan
next prev parent reply other threads:[~2020-02-12 7:39 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-08 18:36 [PATCH v4 0/6] Add support for PCIe controller to work in endpoint mode on R-Car SoCs Lad Prabhakar
2020-02-08 18:36 ` [PATCH v4 1/6] PCI: rcar: Preparation for adding endpoint support Lad Prabhakar
2020-02-12 14:01 ` Bjorn Helgaas
2020-02-19 9:06 ` Lad, Prabhakar
2020-02-08 18:36 ` [PATCH v4 2/6] PCI: rcar: Fix calculating mask for PCIEPAMR register Lad Prabhakar
2020-02-08 19:07 ` Sergei Shtylyov
2020-02-08 19:16 ` Lad, Prabhakar
2020-02-12 14:04 ` Bjorn Helgaas
2020-02-19 8:47 ` Lad, Prabhakar
2020-02-08 18:36 ` [PATCH v4 3/6] PCI: endpoint: Add support to handle multiple base for mapping outbound memory Lad Prabhakar
2020-02-19 9:14 ` Lad, Prabhakar
2020-02-21 11:40 ` Kishon Vijay Abraham I
2020-02-22 13:32 ` Lad, Prabhakar
2020-02-08 18:36 ` [PATCH v4 4/6] dt-bindings: PCI: rcar: Add bindings for R-Car PCIe endpoint controller Lad Prabhakar
2020-02-18 21:13 ` Rob Herring
2020-02-08 18:36 ` [PATCH v4 5/6] PCI: rcar: Add support for rcar PCIe controller in endpoint mode Lad Prabhakar
2020-02-12 3:42 ` Nathan Chancellor
2020-02-12 7:38 ` Lad, Prabhakar [this message]
2020-02-08 18:36 ` [PATCH v4 6/6] misc: pci_endpoint_test: Add Device ID for RZ/G2E PCIe controller Lad Prabhakar
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=CA+V-a8vMcRvsh7+pcgD4jk50X0DtZ9uXFegZVXM5M1k-R6jOVA@mail.gmail.com \
--to=prabhakar.csengg@gmail.com \
--cc=andrew.murray@arm.com \
--cc=arnd@arndb.de \
--cc=bhelgaas@google.com \
--cc=catalin.marinas@arm.com \
--cc=clang-built-linux@googlegroups.com \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=gustavo.pimentel@synopsys.com \
--cc=heiko@sntech.de \
--cc=jingoohan1@gmail.com \
--cc=kishon@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=marek.vasut+renesas@gmail.com \
--cc=mark.rutland@arm.com \
--cc=natechancellor@gmail.com \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=robh+dt@kernel.org \
--cc=shawn.lin@rock-chips.com \
--cc=will@kernel.org \
--cc=yoshihiro.shimoda.uh@renesas.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).