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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55BFB06A.3040904@ti.com>
Date:	Mon, 3 Aug 2015 14:18:18 -0400
From:	Murali Karicheri <m-karicheri2@...com>
To:	Bjorn Helgaas <bhelgaas@...gle.com>
CC:	<linux-pci@...r.kernel.org>, <linux@....linux.org.uk>,
	<linux-kernel@...r.kernel.org>,
	<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH] ARM/PCI: set MPS before pci_bus_add_devices()

On 07/23/2015 10:59 AM, Bjorn Helgaas wrote:
> On Tue, Jul 21, 2015 at 05:35:19PM -0400, Murali Karicheri wrote:
>> The MPS configuration should be done *before* pci_bus_add_devices().
>> After pci_bus_add_devices(), drivers may be bound to devices, and
>> the PCI core shouldn't touch device configuration while a driver
>> owns the device.
>>
>> Signed-off-by: Murali Karicheri <m-karicheri2@...com>
>> Reported-by: Bjorn Helgaas <bhelgaas@...gle.com>
>
> Applied to pci/enumeration for v4.3, thanks!  I removed the "bus" test; let
> me know if you think that's incorrect.
Ok. Will do. Thanks.

Murali

>
>> ---
>>   arch/arm/kernel/bios32.c | 19 +++++--------------
>>   1 file changed, 5 insertions(+), 14 deletions(-)
>>
>> diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
>> index fcbbbb1..17efde7 100644
>> --- a/arch/arm/kernel/bios32.c
>> +++ b/arch/arm/kernel/bios32.c
>> @@ -520,7 +520,8 @@ void pci_common_init_dev(struct device *parent, struct hw_pci *hw)
>>   	list_for_each_entry(sys, &head, node) {
>>   		struct pci_bus *bus = sys->bus;
>>
>> -		if (!pci_has_flag(PCI_PROBE_ONLY)) {
>> +		if (bus && !pci_has_flag(PCI_PROBE_ONLY)) {
>
> I think the test for "bus" being non-NULL is superfluous here.  If "bus"
> were NULL, we would already oops in pci_bus_add_devices().
>
>> +			struct pci_bus *child;
>>   			/*
>>   			 * Size the bridge windows.
>>   			 */
>> @@ -530,25 +531,15 @@ void pci_common_init_dev(struct device *parent, struct hw_pci *hw)
>>   			 * Assign resources.
>>   			 */
>>   			pci_bus_assign_resources(bus);
>> -		}
>>
>> +			list_for_each_entry(child, &bus->children, node)
>> +				pcie_bus_configure_settings(child);
>> +		}
>>   		/*
>>   		 * Tell drivers about devices found.
>>   		 */
>>   		pci_bus_add_devices(bus);
>>   	}
>> -
>> -	list_for_each_entry(sys, &head, node) {
>> -		struct pci_bus *bus = sys->bus;
>> -
>> -		/* Configure PCI Express settings */
>> -		if (bus && !pci_has_flag(PCI_PROBE_ONLY)) {
>> -			struct pci_bus *child;
>> -
>> -			list_for_each_entry(child, &bus->children, node)
>> -				pcie_bus_configure_settings(child);
>> -		}
>> -	}
>>   }
>>
>>   #ifndef CONFIG_PCI_HOST_ITE8152
>> --
>> 1.9.1
>>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>


-- 
Murali Karicheri
Linux Kernel, Keystone
--
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