Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755306AbcDNNNf (ORCPT ); Thu, 14 Apr 2016 09:13:35 -0400 Received: from lhrrgout.huawei.com ([194.213.3.17]:2070 "EHLO lhrrgout.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755079AbcDNNN0 (ORCPT ); Thu, 14 Apr 2016 09:13:26 -0400 From: Gabriele Paoloni To: Pratyush Anand , Jingoo Han CC: Bjorn Helgaas , Jisheng Zhang , Bjorn Helgaas , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: RE: [PATCH v2] PCI: designware: move remaining rc setup code to dw_pcie_setup_rc() Thread-Topic: [PATCH v2] PCI: designware: move remaining rc setup code to dw_pcie_setup_rc() Thread-Index: AQHRf3lGVLGDTqXebkC5RA6YylAqxZ981kjQgAEG4wCAAG7IQP//9QGAgAAqAHCAADKGAIABki0QgAAgiICABeh3MIABVhoAgAAmJRCAAdMSIIAABbSAgAARzQA= Date: Thu, 14 Apr 2016 13:13:08 +0000 Message-ID: References: <1458128433-3020-1-git-send-email-jszhang@marvell.com> <20160407103734.55e72da7@xhacker> <20160407163443.291fbd49@xhacker> <20160407140551.GA2648@localhost> <20160408160145.GA10565@localhost> <00a901d19548$90bffc20$b23ff460$@com> <000001d19644$356355a0$a02a00e0$@com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.203.181.155] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.570F976A.01D9,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: c8c52022f55fc318e1635d1364311b83 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u3EDDuX7026965 Content-Length: 2010 Lines: 63 Hi Pratyush thanks for you reply > -----Original Message----- > From: Pratyush Anand [mailto:pratyush.anand@gmail.com] > Sent: 14 April 2016 14:08 > To: Jingoo Han; Gabriele Paoloni > Cc: Bjorn Helgaas; Jisheng Zhang; Bjorn Helgaas; linux- > pci@vger.kernel.org; linux-kernel@vger.kernel.org; linux-arm- > kernel@lists.infradead.org > Subject: Re: [PATCH v2] PCI: designware: move remaining rc setup code > to dw_pcie_setup_rc() > > Hi Gabriele, > > On Thu, Apr 14, 2016 at 5:22 PM, Jingoo Han > wrote: > > On Wednesday, April 13, 2016 4:58 PM, Gabriele Paoloni wrote: > >> > >> Hi Jingoo > >> > >> On 13 April 2016 06:52, Jingoo Han wrote: > >> > On Tuesday, April 12, 2016 6:44 PM, Gabriele Paoloni wrote: > > [...] > > >> > > So I will update the driver to call dw_pcie_setup_rc() from > >> > > .host_init and ask the BIOS team to update the firmware for next > >> > > releases (the driver will be backward compatible anyway). > >> > > > >> > > Also during my investigation I have noticed that in > >> > dw_pcie_setup_rc() > >> > > http://lxr.free-electrons.com/source/drivers/pci/host/pcie- > >> > designware.c#L762 > >> > > > >> > > we use pp->mem_base rather than pp->mem_bus_addr to setup > >> > > memory base and memory limit in the Type1 header...I think this > >> > > is wrong right? > > Yes. RC's "memory base" and "memory limit" should be governed by PCI > addresses and not CPU addresses. So, it should use pp->mem_bus_addr. > > >> > > Also I do not see why this code is needed at all since we > overwrite > >> > > this register when we call pci_bus_assign_resources(bus) that > >> > > will end up in calling pci_setup_bridge() and then > >> > > pci_setup_bridge_mmio()...? > >> > >> Do you have any comment on this issue above? > > Probably thats why things are working. > Thanks for finding it. I think, /* setup memory base, memory limit */ > hunk can be removed from dw_pcie_setup_rc. Great, I'll send out a patch to remove this Thanks Gab > > ~Pratyush