From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ig0-f174.google.com ([209.85.213.174]:34434 "EHLO mail-ig0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760772AbbIDXxt (ORCPT ); Fri, 4 Sep 2015 19:53:49 -0400 Received: by igcpb10 with SMTP id pb10so27452905igc.1 for ; Fri, 04 Sep 2015 16:53:49 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20150904164412.GD22997@red-moon> References: <20150902174716.GA6305@red-moon> <20150902203250.GB829@google.com> <20150903100115.GA15308@red-moon> <20150903162140.GG829@google.com> <20150904141903.GA22997@red-moon> <20150904164412.GD22997@red-moon> Date: Fri, 4 Sep 2015 16:53:48 -0700 Message-ID: Subject: Re: trouble with PCI: Call pci_read_bridge_bases() from core instead of arch code From: Yinghai Lu To: Lorenzo Pieralisi Cc: Bjorn Helgaas , "oe5hpm@gmail.com" , Ralf Baechle , "James E.J. Bottomley" , Michael Ellerman , Richard Henderson , Benjamin Herrenschmidt , David Howells , Russell King , Tony Luck , "David S. Miller" , Ingo Molnar , Guenter Roeck , Michal Simek , Chris Zankel , "linux-pci@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-pci-owner@vger.kernel.org List-ID: On Fri, Sep 4, 2015 at 9:44 AM, Lorenzo Pieralisi wrote: > On Fri, Sep 04, 2015 at 05:00:35PM +0100, Yinghai Lu wrote: > > The problem here is not the last retry, it is the first bridge scan. > > By moving pci_read_bridge_bases() to core PCI code, if we do not > vet the bridge apertures (ie claim them and reset them if the claiming > fails) we end up calling (on ARM) __pci_bus_size_bridges() with apertures > that can have sizes != 0, which does not make any sense since we are calling > __pci_bus_size_bridges() to *discover* what the aperture size should > be on first bridge scan, correct ? for x86, in pcibios_allocate_bridge_resources(), we do validate the bridge resources, and reset size to 1 (strange ?!). and they are called before pci_asssign_unassigned_resources() so arch ARM would support pcibios_allocate_bridge_resources or other call to do the same thing? wonder some arches even claim fails, they still does not want you to reset it. Thanks Yinghai