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,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,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 302DCC10F12 for ; Mon, 15 Apr 2019 12:25:24 +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 D7EEE2064A for ; Mon, 15 Apr 2019 12:25:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="V6Nyln1m" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D7EEE2064A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com 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=JKcb0mlGTYhjwfBPg6HjxCfKvhP68U14qoqdq5VfprY=; b=V6Nyln1mUPMBM7 EU3GyvjPMhH3Rf6740viBrhe1xpjmMudUcdHEb2Dud1HiWwEPyIxVOwsk4R6e8L+rA3i1hO1CAhNJ W/emiOgj8Jg+0p34vSsg68JWPEEbpYGezQX7PEEqaMeyuE6OEYijBlUfpBgW2YPQVzf1ZQleNj2oH wdQrZhXYrEMmZfrim4kyDWcP5fCVqfG7R7Zm3EepptRDB/NqpBbLYdcEvHyDoiSLZRPR+f2jI/Nsq JycIP5Shn+fG8DUpVb6QGMROudMfow7ufdZuRAQZY5CLzJBB5CuBVg3RPqbFEgKbewptqp0CZkcZI CbQDRW9n9TIRXLdainQw==; 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 1hG0fm-0000UD-RZ; Mon, 15 Apr 2019 12:25:18 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hG0fj-0000T5-Lm for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2019 12:25:17 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4569680D; Mon, 15 Apr 2019 05:25:15 -0700 (PDT) Received: from red-moon (red-moon.cambridge.arm.com [10.1.197.39]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DE2CC3F706; Mon, 15 Apr 2019 05:25:12 -0700 (PDT) Date: Mon, 15 Apr 2019 13:25:13 +0100 From: Lorenzo Pieralisi To: Kishon Vijay Abraham I Subject: Re: [PATCH v2 06/26] PCI: keystone: Move initializations to appropriate places Message-ID: <20190415122513.GB12127@red-moon> References: <20190325083501.8088-1-kishon@ti.com> <20190325083501.8088-7-kishon@ti.com> <20190413143001.GE126710@google.com> <9ab596e8-b012-7f4e-aa93-c5661827af95@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9ab596e8-b012-7f4e-aa93-c5661827af95@ti.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190415_052515_721498_32C51292 X-CRM114-Status: GOOD ( 27.66 ) 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, Arnd Bergmann , Greg Kroah-Hartman , Gustavo Pimentel , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@axis.com, Rob Herring , Bjorn Helgaas , Murali Karicheri , 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, Apr 15, 2019 at 11:04:10AM +0530, Kishon Vijay Abraham I wrote: > Hi Bjorn, > = > On 13/04/19 8:00 PM, Bjorn Helgaas wrote: > > 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(). > = > Maybe I should have mentioned "Keep host specific platform_get_resource()= in > ks_add_pcie_port() and move the common platform_get_resource() (applicable > to both host and endpoint) to probe()" Commit log updated, pushed out pci/keystone again. Thanks, Lorenzo > > 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? > = > No ks_pcie_add_pcie_port() is specific to host mode, so "config" resource= is > kept there whereas "dbics" and "app" resources are common to both host mo= de and > device mode, so they are moved to probe(). > = > Thanks > Kishon > = > > = > >> 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/c= ontroller/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 ke= ystone_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 ke= ystone_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_de= vice *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_d= evice *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