lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140912103429.GA1994@e106497-lin.cambridge.arm.com>
Date:	Fri, 12 Sep 2014 11:34:29 +0100
From:	Liviu Dudau <Liviu.Dudau@....com>
To:	Suravee Suthikulpanit <suravee.suthikulpanit@....com>
Cc:	Bjorn Helgaas <bhelgaas@...gle.com>, Arnd Bergmann <arnd@...db.de>,
	Rob Herring <robh+dt@...nel.org>,
	Jason Gunthorpe <jgunthorpe@...idianresearch.com>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Catalin Marinas <Catalin.Marinas@....com>,
	Will Deacon <Will.Deacon@....com>,
	Russell King <linux@....linux.org.uk>,
	linux-pci <linux-pci@...r.kernel.org>,
	Linus Walleij <linus.walleij@...aro.org>,
	Tanmay Inamdar <tinamdar@....com>,
	Grant Likely <grant.likely@...retlab.ca>,
	Sinan Kaya <okaya@...eaurora.org>,
	Jingoo Han <jg1.han@...sung.com>,
	Kukjin Kim <kgene.kim@...sung.com>,
	linux-arch <linux-arch@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Device Tree ML <devicetree@...r.kernel.org>,
	LAKML <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH v10 09/10] PCI: Assign unassigned bus resources in
 pci_scan_root_bus()

On Fri, Sep 12, 2014 at 11:13:51AM +0100, Suravee Suthikulpanit wrote:
> On 9/8/2014 8:54 AM, Liviu Dudau wrote:
> > If the firmware has not assigned all the bus resources and
> > we are not just probing the PCIe busses, it makes sense to
> > assign the unassigned resources in pci_scan_root_bus().
> >
> > Cc: Bjorn Helgaas <bhelgaas@...gle.com>
> > Cc: Arnd Bergmann <arnd@...db.de>
> > Cc: Jason Gunthorpe <jgunthorpe@...idianresearch.com>
> > Cc: Rob Herring <robh+dt@...nel.org>
> > Signed-off-by: Liviu Dudau <Liviu.Dudau@....com>
> > ---
> >   drivers/pci/probe.c | 3 +++
> >   1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> > index ef891d2..508cf61 100644
> > --- a/drivers/pci/probe.c
> > +++ b/drivers/pci/probe.c
> > @@ -1953,6 +1953,9 @@ struct pci_bus *pci_scan_root_bus(struct device *parent, int bus,
> >   	if (!found)
> >   		pci_bus_update_busn_res_end(b, max);
> >
> > +	if (!pci_has_flag(PCI_PROBE_ONLY))
> > +		pci_assign_unassigned_bus_resources(b);
> > +
> >   	pci_bus_add_devices(b);
> >   	return b;
> >   }
> >
> 
> Liviu,
> 
> Besides the check for PCI_PROBE_ONLY here, I think we also need to avoid calling
> "pci_enable_resources()" in the "driver/pci/pci.c: pcibios_enable_device()" for
> PCI_PROBE_ONLY mode since the resource is not assigned by Linux. Otherwise, the
> "drivers/pci/setup-res.c: pci_enable_resource()" would fail w/ error:
> 
>      can't enable device: BAR ..... not assigned

Hmm, are you sure that is not because the host bridge resources have not been
requested? pci-host-generic.c uses PCI_PROBE_ONLY and yet it works with the series as
is. But it does request_resource() for the host bridge resources inside the driver.

Best regards,
Liviu

> 
> Actually, in "arch/arm/kernel/bios32.c:", the weak "pcibios_enable_device()" function
> also has the check for PCI_PROBE_ONLY mode before calling pci_enable_resources().
> 
> Thanks,
> 
> Suravee
> 
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ