Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751680AbcDOSlA (ORCPT ); Fri, 15 Apr 2016 14:41:00 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:58783 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750976AbcDOSk6 (ORCPT ); Fri, 15 Apr 2016 14:40:58 -0400 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: Tomasz Nowicki , helgaas@kernel.org, will.deacon@arm.com, catalin.marinas@arm.com, rafael@kernel.org, hanjun.guo@linaro.org, Lorenzo.Pieralisi@arm.com, okaya@codeaurora.org, jiang.liu@linux.intel.com, jchandra@broadcom.com, jcm@redhat.com, linaro-acpi@lists.linaro.org, linux-pci@vger.kernel.org, Liviu.Dudau@arm.com, ddaney@caviumnetworks.com, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, robert.richter@caviumnetworks.com, Suravee.Suthikulpanit@amd.com, msalter@redhat.com, wangyijing@huawei.com, mw@semihalf.com Subject: Re: [PATCH V6 08/13] PCI: generic, thunder: update to use generic ECAM API Date: Fri, 15 Apr 2016 20:39:27 +0200 Message-ID: <5110401.mGEq6IVFz2@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1460740008-19489-9-git-send-email-tn@semihalf.com> References: <1460740008-19489-1-git-send-email-tn@semihalf.com> <1460740008-19489-9-git-send-email-tn@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:jUlDABNX+UjBXmKGkhAsxrJKSElwTRhJWIche9CiLSwuG6GsdDV pFfjBWCfL64cOTfC4Fabqou2VX8p5M78GqW0hFJ+w++SUj/MyWnpYabQqiEN23pNMVSFsEc 5PReVq8isdQ+Vi2TlpB8duqDDLFFkXXckTr4ZXunLWN2+gCACxIC6gLGjZepie4lAOmLxy7 J0giuzmAs7pZ6p6ITOmrQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:zPZYyJglEGc=:fkcdjnV1M7oa90/SNtG8AE XpaEajIwBNun8e8rxzE0Q4aBSw9pNII+xBFGYns8CoW2Xgojvw0MFF3dFxHaYuqI4E28xCiIQ Rg+hz3Tw/8TiDivjltleB5UcOfN1FJojjLvE+HFPgaJswpRy0ffCpC6uwBqOwt0XyLYZLD6GZ DyUtp/fcQ2YpSoYC8gHfqAKeCHwED2O1RsAaiBuWzxr09k39uI/+LgvpamyZe/Nx+uaLboO3t KOuQkmWVfT7DSbmTW+wlcOwShfTZhIn+94ssZ9sLfXNbN9psD0g6L4AE7FIXtue/nh4RIhj68 Mqi9QrstGGDImlomqBANZNFVA43Sb7/nW8vCO7vHcQUFDXN8woZAX2N4VfccEOb0yqd318nB7 vXz1G4rcb2TQ0rkU1mYlyLOUb9VbDbBbWMw7Jej2AbNpBMGWAMBHFguOuE6skSmpOA470rcZU HeScnQsd1qn/kDDLOORqSUTVWEufNVap7830ePDjOiKBpbo3cxDRbM4/2dqr3ebZpRheFkLph c2b70ibYBPlczcyx6xnRBmYvLIgHc7ImlWUVnlqBotOsgavUOqm6O8hz7UmyTacC0b/FCn1y9 ogQ5XKvp5+D35vpyXLXMBdz+JT9F5RpKbpRVkI0FrRtaAPy8Lx7kEgL+MVBpozDYudi8fiEgL gM9KyPUw23cEesbKvb9H0LNww8IhWsPQBWBilagd14LurLxE1c5TTAxqJfi2LW+jqj8NpJoa/ JQOUsQ/3qyqjH1AT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1649 Lines: 42 On Friday 15 April 2016 19:06:43 Tomasz Nowicki wrote: > -MODULE_DEVICE_TABLE(of, thunder_pem_of_match); > - > -static int thunder_pem_probe(struct platform_device *pdev) > +static int thunder_pem_init(struct device *dev, struct pci_config_window *cfg) > { > - struct device *dev = &pdev->dev; > - const struct of_device_id *of_id; > resource_size_t bar4_start; > struct resource *res_pem; > struct thunder_pem_pci *pem_pci; > + struct platform_device *pdev; > > pem_pci = devm_kzalloc(dev, sizeof(*pem_pci), GFP_KERNEL); > if (!pem_pci) > return -ENOMEM; > > - of_id = of_match_node(thunder_pem_of_match, dev->of_node); > - pem_pci->gen_pci.cfg.ops = (struct gen_pci_cfg_bus_ops *)of_id->data; > + pdev = to_platform_device(dev); > > /* > * The second register range is the PEM bridge to the PCIe > @@ -330,7 +298,29 @@ static int thunder_pem_probe(struct platform_device *pdev) > pem_pci->ea_entry[1] = (u32)(res_pem->end - bar4_start) & ~3u; > pem_pci->ea_entry[2] = (u32)(bar4_start >> 32); > > - return pci_host_common_probe(pdev, &pem_pci->gen_pci); > + cfg->priv = pem_pci; > + return 0; > +} > + > I still think it would be better to keep the loadable PCI host drivers separate from the ACPI PCI infrastructure. There are a number of simplifications that we want to do to the DT based drivers in the long run, so it's better if that code is not shared at this level. Abstracting out the ECAM code is fine, but at that point you should be able to just call it from the ACPI layer. Arnd