lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Tue, 11 Feb 2020 20:42:39 -0700 From: Nathan Chancellor <natechancellor@...il.com> To: Lad Prabhakar <prabhakar.csengg@...il.com> Cc: Bjorn Helgaas <bhelgaas@...gle.com>, Rob Herring <robh+dt@...nel.org>, Mark Rutland <mark.rutland@....com>, Catalin Marinas <catalin.marinas@....com>, Will Deacon <will@...nel.org>, Kishon Vijay Abraham I <kishon@...com>, Lorenzo Pieralisi <lorenzo.pieralisi@....com>, Arnd Bergmann <arnd@...db.de>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Jingoo Han <jingoohan1@...il.com>, Gustavo Pimentel <gustavo.pimentel@...opsys.com>, Marek Vasut <marek.vasut+renesas@...il.com>, Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>, Shawn Lin <shawn.lin@...k-chips.com>, Heiko Stuebner <heiko@...ech.de>, Andrew Murray <andrew.murray@....com>, linux-pci@...r.kernel.org, linux-arm-kernel@...ts.infradead.org, linux-renesas-soc@...r.kernel.org, linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org, devicetree@...r.kernel.org, Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>, clang-built-linux@...glegroups.com Subject: Re: [PATCH v4 5/6] PCI: rcar: Add support for rcar PCIe controller in endpoint mode 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@...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
Powered by blists - more mailing lists