From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFF06C10F11 for ; Sat, 13 Apr 2019 14:30:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C0C562077C for ; Sat, 13 Apr 2019 14:30:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GyECpO4x"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="bklrcgo2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C0C562077C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hVtVjTNx0TzxxpmN/gWjmdpIYju+jOJItbriOKZKkus=; b=GyECpO4xNogYHS PI0bqZWvMKD1PHjVURt0A4rI+sBnB5WPUVKPq202buw8oxF4dNgvXuTk941V7nRMBSl/E7OFui4LS vmE0yz1ZQtvWT41X+9ga2JVzJptfTTUqEB9sKi63YCPIYXTrupbX6nyiK7XmYLBLj3MNfIudruhw4 /w3hZWcRtb0KJGYmVe7MPEbndbkVq9FIRCwXYpzREy4Jm2bQKf2xx4rOgNAlNO/Iot2oKLkFohnT5 ZABluxZ4sPHkVJj64hHt5YwUPYUXmjQmXTBkf5Es51ENI79SQq3loKaq1Cn7fSNcpv1S/7hB6oz7q Eu5npr6dhBqtN7zA7ReA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hFJfU-0004WV-Of; Sat, 13 Apr 2019 14:30:08 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hFJfR-0003wI-0n for linux-arm-kernel@lists.infradead.org; Sat, 13 Apr 2019 14:30:06 +0000 Received: from localhost (unknown [69.71.4.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7B6AD2077C; Sat, 13 Apr 2019 14:30:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555165803; bh=TX+7DG1vbXdb5EhlxAQmPXddgCAEBxPibp6kcITTDjI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bklrcgo2lt8Wa3R+Ul/LqqbP40+832Y9Wq//QE7Z+tUF/kj69CP4LCraTCwtal+CQ M/ykqHGjiOa7eN7kmZhXbmmJRa7L9aEmYY6THLUkAHqLWHABUMOWYpmFGx+QaW8m5s ME2tutXIQ5ka0TuvdoLCGZcO/AEYvXNTGuuyj4AM= Date: Sat, 13 Apr 2019 09:30:01 -0500 From: Bjorn Helgaas To: Kishon Vijay Abraham I Subject: Re: [PATCH v2 06/26] PCI: keystone: Move initializations to appropriate places Message-ID: <20190413143001.GE126710@google.com> References: <20190325083501.8088-1-kishon@ti.com> <20190325083501.8088-7-kishon@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190325083501.8088-7-kishon@ti.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190413_073005_110137_F69BBA80 X-CRM114-Status: GOOD ( 19.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Lorenzo Pieralisi , Arnd Bergmann , Greg Kroah-Hartman , Gustavo Pimentel , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , Murali Karicheri , linux-arm-kernel@axis.com, Jingoo Han , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Mar 25, 2019 at 02:04:41PM +0530, Kishon Vijay Abraham I wrote: > No functional change. Move host specific platform_get_resource to > ks_add_pcie_port and the common platform_get_resource (applicable > to both host and endpoint) to probe. This is in preparation for > adding endpoint support to pci-keystone driver. This seems to move platform_get_resource() *from* (not *to*) ks_add_pcie_port(). You seem to be making a distinction in the commit log between (1) a resource that's only used for host mode, and (2) a common resource that's used for both host and endpoint mode.=A0 But I don't see that distinction in the patch, so it's a little confusing to mention it in the commit log. It must make endpoint support easier, but I can't quite connect the dots yet. Maybe endpoint will also use ks_pcie_add_pcie_port(), but will have a separate .probe() function that doesn't look up the resource that's specific to host mode? > Signed-off-by: Kishon Vijay Abraham I > --- > drivers/pci/controller/dwc/pci-keystone.c | 27 +++++++++++++---------- > 1 file changed, 15 insertions(+), 12 deletions(-) > = > diff --git a/drivers/pci/controller/dwc/pci-keystone.c b/drivers/pci/cont= roller/dwc/pci-keystone.c > index 5eebef9b9ada..95997885a05c 100644 > --- a/drivers/pci/controller/dwc/pci-keystone.c > +++ b/drivers/pci/controller/dwc/pci-keystone.c > @@ -806,11 +806,6 @@ static int __init ks_pcie_add_pcie_port(struct keyst= one_pcie *ks_pcie, > struct resource *res; > int ret; > = > - res =3D platform_get_resource_byname(pdev, IORESOURCE_MEM, "dbics"); > - pci->dbi_base =3D devm_pci_remap_cfg_resource(dev, res); > - if (IS_ERR(pci->dbi_base)) > - return PTR_ERR(pci->dbi_base); > - > res =3D platform_get_resource_byname(pdev, IORESOURCE_MEM, "config"); > pp->va_cfg0_base =3D devm_pci_remap_cfg_resource(dev, res); > if (IS_ERR(pp->va_cfg0_base)) > @@ -818,13 +813,6 @@ static int __init ks_pcie_add_pcie_port(struct keyst= one_pcie *ks_pcie, > = > pp->va_cfg1_base =3D pp->va_cfg0_base; > = > - res =3D platform_get_resource_byname(pdev, IORESOURCE_MEM, "app"); > - ks_pcie->va_app_base =3D devm_ioremap_resource(dev, res); > - if (IS_ERR(ks_pcie->va_app_base)) > - return PTR_ERR(ks_pcie->va_app_base); > - > - ks_pcie->app =3D *res; > - > pp->ops =3D &ks_pcie_host_ops; > ret =3D dw_pcie_host_init(pp); > if (ret) { > @@ -895,6 +883,8 @@ static int __init ks_pcie_probe(struct platform_devic= e *pdev) > struct dw_pcie *pci; > struct keystone_pcie *ks_pcie; > struct device_link **link; > + struct resource *res; > + void __iomem *base; > u32 num_viewport; > struct phy **phy; > u32 num_lanes; > @@ -911,6 +901,19 @@ static int __init ks_pcie_probe(struct platform_devi= ce *pdev) > if (!pci) > return -ENOMEM; > = > + res =3D platform_get_resource_byname(pdev, IORESOURCE_MEM, "app"); > + ks_pcie->va_app_base =3D devm_ioremap_resource(dev, res); > + if (IS_ERR(ks_pcie->va_app_base)) > + return PTR_ERR(ks_pcie->va_app_base); > + > + ks_pcie->app =3D *res; > + > + res =3D platform_get_resource_byname(pdev, IORESOURCE_MEM, "dbics"); > + base =3D devm_pci_remap_cfg_resource(dev, res); > + if (IS_ERR(base)) > + return PTR_ERR(base); > + > + pci->dbi_base =3D base; > pci->dev =3D dev; > pci->ops =3D &ks_pcie_dw_pcie_ops; > = > -- = > 2.17.1 > = _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel