Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755394AbbHCWe7 (ORCPT ); Mon, 3 Aug 2015 18:34:59 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:37796 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751882AbbHCWe5 (ORCPT ); Mon, 3 Aug 2015 18:34:57 -0400 MIME-Version: 1.0 In-Reply-To: <20150803191340.GM7557@n2100.arm.linux.org.uk> References: <1437514519-18545-1-git-send-email-m-karicheri2@ti.com> <20150803191340.GM7557@n2100.arm.linux.org.uk> From: Bjorn Helgaas Date: Mon, 3 Aug 2015 17:34:36 -0500 Message-ID: Subject: Re: [PATCH] ARM/PCI: set MPS before pci_bus_add_devices() To: Russell King - ARM Linux Cc: Murali Karicheri , "linux-pci@vger.kernel.org" , linux-arm , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2005 Lines: 47 On Mon, Aug 3, 2015 at 2:13 PM, Russell King - ARM Linux 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 >> Reported-by: Bjorn Helgaas >> --- >> 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)) { > > Let's get rid of that useless check. bus can't be NULL here. > > In the original code (below) if bus was NULL, then we would've already > oopsed before we got here. As we don't oops here, no one is ever > seeing it being NULL, so the test is redundant. > >> - 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)) { > Sorry, I had forgotten to push this branch, but I did already get rid of the check for bus being NULL: http://git.kernel.org/cgit/linux/kernel/git/helgaas/pci.git/commit/?id=808b27a5ae05 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/