Re: [PATCH v4 5/6] PCI: rcar: Add support for rcar PCIe controller in endpoint mode

4 views
Skip to first unread message

kbuild test robot

unread,
Feb 11, 2020, 3:10:20 PM2/11/20
to kbu...@lists.01.org, Nick Desaulniers, clang-bu...@googlegroups.com
CC: kbuil...@lists.01.org
In-Reply-To: <20200208183641.6674-6-p...@bp.renesas.com>
References: <20200208183641.6674-6-p...@bp.renesas.com>
TO: Lad Prabhakar <prabhaka...@gmail.com>
CC: Bjorn Helgaas <bhel...@google.com>, Rob Herring <rob...@kernel.org>, Mark Rutland <mark.r...@arm.com>, Catalin Marinas <catalin...@arm.com>, Will Deacon <wi...@kernel.org>, Kishon Vijay Abraham I <kis...@ti.com>, Lorenzo Pieralisi <lorenzo....@arm.com>, Arnd Bergmann <ar...@arndb.de>, Greg Kroah-Hartman <gre...@linuxfoundation.org>, Jingoo Han <jingo...@gmail.com>, Gustavo Pimentel <gustavo....@synopsys.com>, Marek Vasut <marek.vas...@gmail.com>, Yoshihiro Shimoda <yoshihiro....@renesas.com>, Shawn Lin <shaw...@rock-chips.com>, Heiko Stuebner <he...@sntech.de>
CC: Andrew Murray <andrew...@arm.com>, linu...@vger.kernel.org, linux-ar...@lists.infradead.org, linux-re...@vger.kernel.org, linux-r...@lists.infradead.org, linux-...@vger.kernel.org, devic...@vger.kernel.org, Lad Prabhakar <prabhakar.ma...@bp.renesas.com>

Hi Lad,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on pci/next]
[also build test WARNING on robh/for-next arm64/for-next/core char-misc/char-misc-testing v5.6-rc1 next-20200211]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url: https://github.com/0day-ci/linux/commits/Lad-Prabhakar/Add-support-for-PCIe-controller-to-work-in-endpoint-mode-on-R-Car-SoCs/20200211-191403
base: https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (git://gitmirror/llvm_project 4dcc029edbe4bd5e30d4f0cdcf123ea4ed2b6418)
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <l...@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/pci/controller/pcie-rcar-ep.c:226:8: warning: explicitly assigning value of variable of type 'u64' (aka 'unsigned long long') to itself [-Wself-assign]
size = size;
~~~~ ^ ~~~~
1 warning generated.

vim +226 drivers/pci/controller/pcie-rcar-ep.c

193
194 static int rcar_pcie_ep_set_bar(struct pci_epc *epc, u8 func_no,
195 struct pci_epf_bar *epf_bar)
196 {
197 struct rcar_pcie *ep = epc_get_drvdata(epc);
198 dma_addr_t cpu_addr = epf_bar->phys_addr;
199 int flags = epf_bar->flags | LAR_ENABLE | LAM_64BIT;
200 enum pci_barno bar = epf_bar->barno;
201 u64 size = 1ULL << fls64(epf_bar->size - 1);
202 u32 mask;
203 int idx;
204 int err;
205
206 idx = find_first_zero_bit(ep->ib_window_map, ep->num_ib_windows);
207 if (idx >= ep->num_ib_windows) {
208 dev_err(ep->dev, "no free inbound window\n");
209 return -EINVAL;
210 }
211
212 if ((flags & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_IO)
213 flags |= IO_SPACE;
214
215 ep->bar_to_atu[bar] = idx;
216 /* use 64 bit bars */
217 set_bit(idx, ep->ib_window_map);
218 set_bit(idx + 1, ep->ib_window_map);
219
220 if (cpu_addr > 0) {
221 unsigned long nr_zeros = __ffs64(cpu_addr);
222 u64 alignment = 1ULL << nr_zeros;
223
224 size = min(size, alignment);
225 } else {
> 226 size = size;
227 }
228
229 size = min(size, 1ULL << 32);
230
231 mask = roundup_pow_of_two(size) - 1;
232 mask &= ~0xf;
233
234 rcar_pcie_set_inbound(ep->base, cpu_addr,
235 0x0, mask | flags, idx, false);
236
237 err = rcar_pcie_wait_for_phyrdy(ep->base);
238 if (err) {
239 dev_err(ep->dev, "phy not ready\n");
240 return -EINVAL;
241 }
242
243 return 0;
244 }
245

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuil...@lists.01.org
.config.gz

Nathan Chancellor

unread,
Feb 11, 2020, 10:42:43 PM2/11/20
to Lad Prabhakar, Bjorn Helgaas, Rob Herring, Mark Rutland, Catalin Marinas, Will Deacon, Kishon Vijay Abraham I, Lorenzo Pieralisi, Arnd Bergmann, Greg Kroah-Hartman, Jingoo Han, Gustavo Pimentel, Marek Vasut, Yoshihiro Shimoda, Shawn Lin, Heiko Stuebner, Andrew Murray, linu...@vger.kernel.org, linux-ar...@lists.infradead.org, linux-re...@vger.kernel.org, linux-r...@lists.infradead.org, linux-...@vger.kernel.org, devic...@vger.kernel.org, Lad Prabhakar, clang-bu...@googlegroups.com
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.ma...@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?

You can view the full report here:

https://groups.google.com/d/msg/clang-built-linux/KHUKw5L8yxw/Mb7KRMG7BQAJ

Cheers,
Nathan

Nathan Chancellor

unread,
Feb 11, 2020, 10:43:29 PM2/11/20
to kbuild test robot, kbu...@lists.01.org, Nick Desaulniers, clang-bu...@googlegroups.com

Lad, Prabhakar

unread,
Feb 12, 2020, 2:38:59 AM2/12/20
to Nathan Chancellor, Bjorn Helgaas, Rob Herring, Mark Rutland, Catalin Marinas, Will Deacon, Kishon Vijay Abraham I, Lorenzo Pieralisi, Arnd Bergmann, Greg Kroah-Hartman, Jingoo Han, Gustavo Pimentel, Marek Vasut, Yoshihiro Shimoda, Shawn Lin, Heiko Stuebner, Andrew Murray, linux-pci, LAK, Linux-Renesas, open list:ARM/Rockchip SoC..., LKML, open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS, Lad Prabhakar, clang-bu...@googlegroups.com
Hi Nathan,
Sure ill fix that.

Cheers,
--Prabhakar Lad
Reply all
Reply to author
Forward
0 new messages