Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5604556ybv; Tue, 11 Feb 2020 19:43:07 -0800 (PST) X-Google-Smtp-Source: APXvYqxDfS97WVJSSZjrsp2o3UJ6yOSo1WOzpa3jSYdpP+6yTm13sjgQguS1Ph0FunS2IWX/TRYP X-Received: by 2002:aca:eccd:: with SMTP id k196mr4730061oih.95.1581478987079; Tue, 11 Feb 2020 19:43:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581478987; cv=none; d=google.com; s=arc-20160816; b=jTbi22yBbaZqcAbtcHbEeiDM2J0CD3x7c3N5J7LL1K4RaLkohNAgDwnoEOcCxcmOlT 8hlT5YtV0qp+7HU2lSvfgHCnYtOae2EN8Pn2xyCMC2q1G3ncbYO0vOLAVdjJSLBRIl5w TKkEHlK4XZpIE/tq/z5/1E8Z2klcRjNl593/cvqm8/vN0NvULP98rERXB/teNXcEVSsZ RI1V2rBBt643uIOmDI0hpCmHOsPYm7aPOIiM1YwITpUN3sjL+qWlftkQQMAnTRIOTZcW WX90kisUPC9VO5NzsAqKPgHqak7VJZPImYRph37hdHj79EH4wfO59rBZsvy2c2jPKLyY RNlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=tPe7sTayWWBZzGlUQCbzCqIvW36rOIyLLoO5hc2eptg=; b=joSbJNFuB2eW9DD39hpF40cIlyeO85nwpZsOi0sLDoXOTgbFZIv5k7ptNEb0MbtW4N Wrr2XDFMD3nDAmFNpLxbVoSe+gfK1guuMvwAl+KZTKGS6QDVOH9yGbcyZ42EXdelKEaS NM3LRHK53CEwKpCaOWHkqG41wV9lw0bwp2Dk5yTZ05IcEzWOwRMdU0pmOQOfVHCvvqnl etD5dDPLz0IEqodgxBc+ShgJrFuoMJ5CuUDVnz0zGScYKtwIC5tLk0eQYQ7yrsZTzE3/ +wK22GYb+XAYYpYmEH4JixJ2d6zuuhBNn1Zi4HijTaAiPInsAGrWcsv6MSL4Y4xGGyKh uwJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gJKKvum6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h18si2879790otj.114.2020.02.11.19.42.55; Tue, 11 Feb 2020 19:43:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gJKKvum6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727912AbgBLDmp (ORCPT + 99 others); Tue, 11 Feb 2020 22:42:45 -0500 Received: from mail-oi1-f195.google.com ([209.85.167.195]:35391 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727710AbgBLDmp (ORCPT ); Tue, 11 Feb 2020 22:42:45 -0500 Received: by mail-oi1-f195.google.com with SMTP id b18so727159oie.2; Tue, 11 Feb 2020 19:42:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=tPe7sTayWWBZzGlUQCbzCqIvW36rOIyLLoO5hc2eptg=; b=gJKKvum6+KIMyQN1PT+4Un6tw/8+QshaMNQ8mn5RqgeKGhTRxgwgelkAr6wxrbRV9t uHLre/owowED3HIc7UcGZkOZjePv6fbvWHkiIvUqIW5JXBHyBaKgags/NjJkjwmFMhRd i3AOcnHgZpPcA7Q9Ouet1OkI4YVgxBj2qV15/U/YX6iQoOjlwFKFz3i+J7P1nYfkduv4 DEdv37YzbBI96VoFqKaZ6xBlIR3hgDAPYH3NIcWUcpuEKegMfinMe82NouApPsq0rMmn CQ0/4lm8nPQv+um2HdtxV+gXbrkhVbV+3qHEfty5jMWfj3swql9iAYxmJRiW5VSJPmlS EHDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=tPe7sTayWWBZzGlUQCbzCqIvW36rOIyLLoO5hc2eptg=; b=ny4H10wZ7kod1Dydrkk+bS09NZn3B9Ulwi1uQBZkc5q2yV92+Hx6FjNXZjBHa57nww XYQmojnGSQlhPFU8xzOBcr+mcdI+S48EEQTOwRmtHGLIDJ5jh3SAXR9Z0Hl4O0Okz1Ny V4FMMz8mjfoEYvYaHVdoHe6tJ31G7SyWzMKVN0Y3OWLkZNOUXRwYXwkbocKbZE49vJWy C69jVXL8HJBS4molHzGAPuQRvwsaTEKjF7hkPrwd136qAqx5nJd8LdfNC+YGbQGH33+B We8IvKYyztBRlYrsufQRKSG3uqYXmG7IgtqYe1SL8jEL73FqS95G7C6KXmlC8GCV7IXt kihQ== X-Gm-Message-State: APjAAAWomU0O3DEWD0p/y5sQVgKEwr/rLe5riwwllt4tvgQsZ12wRtF4 tDwq6jp3NpVW/a18hUv+0tI= X-Received: by 2002:aca:1c09:: with SMTP id c9mr5137811oic.85.1581478962535; Tue, 11 Feb 2020 19:42:42 -0800 (PST) Received: from ubuntu-m2-xlarge-x86 ([2604:1380:4111:8b00::1]) by smtp.gmail.com with ESMTPSA id m69sm1928958otc.78.2020.02.11.19.42.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Feb 2020 19:42:41 -0800 (PST) Date: Tue, 11 Feb 2020 20:42:39 -0700 From: Nathan Chancellor To: Lad Prabhakar Cc: 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@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Lad Prabhakar , clang-built-linux@googlegroups.com Subject: Re: [PATCH v4 5/6] PCI: rcar: Add support for rcar PCIe controller in endpoint mode Message-ID: <20200212034239.GA38314@ubuntu-m2-xlarge-x86> References: <20200208183641.6674-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20200208183641.6674-6-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200208183641.6674-6-prabhakar.mahadev-lad.rj@bp.renesas.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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 > > 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 > +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