From patchwork Thu Mar 19 07:14:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 6047091 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 01983BF90F for ; Thu, 19 Mar 2015 07:14:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D386520523 for ; Thu, 19 Mar 2015 07:14:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BFFC420328 for ; Thu, 19 Mar 2015 07:14:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751451AbbCSHOf (ORCPT ); Thu, 19 Mar 2015 03:14:35 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:14243 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751257AbbCSHOd (ORCPT ); Thu, 19 Mar 2015 03:14:33 -0400 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NLG001XB6S6DBD0@mailout4.samsung.com> for linux-pci@vger.kernel.org; Thu, 19 Mar 2015 16:14:30 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.115]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id EE.AF.19034.6577A055; Thu, 19 Mar 2015 16:14:30 +0900 (KST) X-AuditID: cbfee691-f79b86d000004a5a-e9-550a7756c62f Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id C3.D8.09430.6577A055; Thu, 19 Mar 2015 16:14:30 +0900 (KST) Content-transfer-encoding: 8BIT Received: from [10.252.81.186] by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NLG007BZ6S54620@mmp2.samsung.com>; Thu, 19 Mar 2015 16:14:30 +0900 (KST) Message-id: <550A7755.7020603@samsung.com> Date: Thu, 19 Mar 2015 16:14:29 +0900 From: Jaehoon Chung User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 To: Liviu Dudau Cc: Bjorn Helgaas , "linux-pci@vger.kernel.org" , cpGS , Jingoo Han , Mohit Kumar , robh@kernel.org Subject: Re: [RFC] Build with arm64 configuration References: <54FD8F94.20305@samsung.com> <54FE4A9D.5010001@samsung.com> <54FFF60B.4090300@samsung.com> <20150318151645.GA16158@e106497-lin.cambridge.arm.com> In-reply-to: <20150318151645.GA16158@e106497-lin.cambridge.arm.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCIsWRmVeSWpSXmKPExsWyRsSkWDesnCvU4PcNVYslTRkWLw9pWlxe eInV4uy842wWB5a2s1hsnPqL0eL/nh3sDuwea+atYfRYsKnUY9OqTjaPvi2rGD2e/tjL7PF5 k1wAWxSXTUpqTmZZapG+XQJXxv5v/SwFdzQqOs7sZ2tgXK3QxcjJISFgIvHxymImCFtM4sK9 9WxdjFwcQgJLGSV+HTzHBFN0cncTI0RiOiOQc5AdJMErICjxY/I9li5GDg5mAXmJI5eyIUx1 iSlTciHKXzNK/HiyhRmiXEti5cPbYK0sAqoSGx6tArPZBHQktn87DrZLVCBMYuLNx6wgtghQ zfOerWAHMQtcYZRoujIRbJCwgKHEnV1dTBAbNjJJHJ3xHKyDU8BZ4uSbtywgCQmBc+wST1Yc ZYJYJyDxbfIhsEslBGQlNh1ghvhM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cR5lezbQoQE0hNLUrNTUwtSi2D6mDg4pRoYs5byPfRSWxJ8 isXK6t5Ept8t+UaC6R7us6LFX/AyMOvFivQes9+XuPHRwublLYz1f6+dmXnA+oTHkQmxfbvT z29OMT+QYHRnU9Md+4yTzT9XlqqKrQudvVv3rbKb0L5dbLOUjya86MrL+Bh3Ue3Gd6X2N6lK /eyqZ7dql+xJPSliyxnZ4GmuxFKckWioxVxUnAgAG+ennwEDAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Dear, Liviu. On 03/19/2015 12:16 AM, Liviu Dudau wrote: > On Wed, Mar 11, 2015 at 08:00:11AM +0000, Jaehoon Chung wrote: >> Dear, Bjorn. >> >> On 03/10/2015 11:17 AM, Bjorn Helgaas wrote: >>> [+cc Jingoo, Mohit] >>> >>> On Mon, Mar 9, 2015 at 8:36 PM, Jaehoon Chung wrote: >>>> Dear, Bjorn. >>>> >>>> Thanks for reply. >>>> >>>> On 03/10/2015 08:35 AM, Bjorn Helgaas wrote: >>>>> On Mon, Mar 9, 2015 at 7:18 AM, Jaehoon Chung wrote: >>>>>> Hi, >>>>>> >>>>>> I have a question for building arm64. >>>>>> (Actually, i didn't have many knowledges for PCIe.) >>>>>> When i built with arm64 configuration, then i always found the compiler errors. >>>>> >>>>> The kernel does build for arm64, so you'll have to be more specific >>>>> about the problem you're seeing. >>>> >>>> I built the pcie-designware.c and pci-exynos.c. >>>> >>>> When pcie-designware.c is built, i found the below error message. >>>> drivers/pci/host/pcie-designware.c:74:52: warning: Ë?struct pci_sys_dataâ?¢ declared inside parameter list >>>> static inline struct pcie_port *sys_to_pcie(struct pci_sys_data *sys) >>>> ^ >>>> drivers/pci/host/pcie-designware.c:74:52: warning: its scope is only this definition or declaration, which is probably not what you want >>>> In file included from include/uapi/linux/stddef.h:1:0, >>>> from include/linux/stddef.h:4, >>>> from ./include/uapi/linux/posix_types.h:4, >>>> from include/uapi/linux/types.h:13, >>>> from include/linux/types.h:5, >>>> from include/linux/smp.h:10, >>>> from include/linux/irq.h:12, >>>> from drivers/pci/host/pcie-designware.c:14: >>>> drivers/pci/host/pcie-designware.c: In function Ë?sys_to_pcie": >>>> drivers/pci/host/pcie-designware.c:76:13: error: dereferencing pointer to incomplete type >>>> BUG_ON(!sys->private_data); >>>> >>>> I found it's located at arch/arm/include/asm/mach/pci.h. >>>> It can't refer when do build for arm64. >>>> So I think that i missed something..I have also searched the patches relevant to this at patchwork. >>>> Some patch have copied header files relevant to "pci" to "arch/arm64/include/". >>>> (This is not solution.) >>>> >>>> And i don't want to add #ifdef CONFIG_ARM64 into pcie-designware.c >>>> I think mailing should know the graceful solution. >>>> >>>> If i can solve this problem, i will contribute for pci-exynos.c. >>> >>> Oh, I think pcie-designware.c and pci-exynos.c currently only work on >>> arm, not on arm64. I don't know enough about them to know whether >>> they could be made to work on arm64. But Jingoo and Mohit probably >>> do. > > Jaehoon, > > pci-exynos and pcie-designware need to be converted to the generic PCIe framework and then > they will work on both arm and arm64. For an example of a driver that successfully works > in both worlds look at pci-versatile.c. Thanks a lot! I'm looking at pci-versatile.c and comparing with pcie-designware and pci-exynos. One question.. At pci-versatile.c, i found the resource_list_for_each_entry() into versatile_pci_parse_request_of_pci_ranges(). resource_list_for_each_entry needs two arguments, but it's passed three arguments. It seems to want using "resource_list_for_each_entry_safe()", doesn't it? (+CC'd Rob Herring) Best Regards, Jaehoon Chung > > Currently, PCI host bridges that work on arch/arm depend on pci_sys_data, like you have > discovered. There is no reason to do that nowadays, and Lorenzo Pieralisi, Yijing Wang > and others are trying to get rid of that structure from arch/arm. > > Best regards, > Liviu > >> >> I'm checking the code.. >> If my understanding is right, pci_sys_data is just used to take data relevant to pice_port. >> So I think it can get from device-tree or other. >> I don't exactly know why needs "pci_sys_data". >> >> It seems to discuss about pcie (struct pci_sys_data and hw_pci) on arm64 at mailing..right? >> ([RFC 2/4] PCI: generic: Add support for ARM64 and MSI(x)) >> >> If need to work, i have interesting for contributing pcie on arm64.(pcie-designware.c and pci-exynos.c) >> But i need to gain the knowledge of pcie.. >> >> Best Regards, >> Jaehoon Chung >> >>> >>> Bjorn >>> >> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-pci" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >> > --- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/host/pci-versatile.c b/drivers/pci/host/pci-versatile.c index 1ec694a..8eb3b80 100644 --- a/drivers/pci/host/pci-versatile.c +++ b/drivers/pci/host/pci-versatile.c @@ -80,7 +80,7 @@ static int versatile_pci_parse_request_of_pci_ranges(struct device *dev, if (err) return err; - resource_list_for_each_entry(win, res, list) { + resource_list_for_each_entry_safe(win, res, list) { struct resource *parent, *res = win->res; switch (resource_type(res)) {