From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qg0-f45.google.com ([209.85.192.45]:57937 "EHLO mail-qg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753898AbaI2SRu (ORCPT ); Mon, 29 Sep 2014 14:17:50 -0400 Received: by mail-qg0-f45.google.com with SMTP id e89so637588qgf.32 for ; Mon, 29 Sep 2014 11:17:49 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1411937610-22125-4-git-send-email-suravee.suthikulpanit@amd.com> References: <1411937610-22125-1-git-send-email-suravee.suthikulpanit@amd.com> <1411937610-22125-4-git-send-email-suravee.suthikulpanit@amd.com> From: Bjorn Helgaas Date: Mon, 29 Sep 2014 12:17:29 -0600 Message-ID: Subject: Re: [RFC 3/4] arm64: Do not call enable PCI resources when specify PCI_PROBE_ONLY To: Suravee Suthikulpanit Cc: Will Deacon , Liviu Dudau , Marc Zyngier , Mark Rutland , Catalin Marinas , Jason Cooper , Thomas Gleixner , Rob Herring , linux-arm , "linux-kernel@vger.kernel.org" , "linux-pci@vger.kernel.org" , "linux-doc@vger.kernel.org" , "devicetree@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-pci-owner@vger.kernel.org List-ID: On Sun, Sep 28, 2014 at 2:53 PM, wrote: > From: Suravee Suthikulpanit > > When specify PCI_PROBE_ONLY, the resource parent does not get assigned. > Therefore, pci_enable_resources() return error saying that > "BAR x not claimed". > > Note: This same logic is also used in the arch/arm/kernel/bios32.c > > Cc: Liviu Dudau > Cc: Bjorn Helgaas > Cc: Will Deacon > Cc: Catalin Marinas > Signed-off-by: Suravee Suthikulpanit > --- > arch/arm64/kernel/pci.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c > index ce5836c..7fd4d2b 100644 > --- a/arch/arm64/kernel/pci.c > +++ b/arch/arm64/kernel/pci.c > @@ -68,3 +68,11 @@ void pci_bus_assign_domain_nr(struct pci_bus *bus, struct device *parent) > bus->domain_nr = domain; > } > #endif > + > +int pcibios_enable_device(struct pci_dev *dev, int mask) > +{ > + if (pci_has_flag(PCI_PROBE_ONLY)) > + return 0; > + > + return pci_enable_resources(dev, mask); I had thought of "PCI_PROBE_ONLY" as the "look but don't touch" flag, i.e., never change any BAR or bridge window assignments. But I guess the current usage is more general than that: we also use it to - avoid pci_enable_resources(), which only turns on IO/MEM bits in the command register - avoid pcie_bus_configure_settings(), which programs MPS and MRRS - avoid pci_read_bridge_bases(), which really just *reads* bridge windows - avoid pcibios_reserve_legacy_regions(), which doesn't touch any PCI registers - enables pci_claim_resource() This seems like more than necessary, but I don't know all the history. In particular, I don't know why PCI_PROBE_ONLY should make a difference to things like claiming resources. > +} > -- > 1.9.3 >b