From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com ([134.134.136.65]:22360 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751774AbeBEUGz (ORCPT ); Mon, 5 Feb 2018 15:06:55 -0500 Date: Mon, 5 Feb 2018 22:06:48 +0200 From: Mika Westerberg To: Lorenzo Pieralisi Cc: Koen Vandeputte , linux-pci@vger.kernel.org, Binghui Wang , Bjorn Helgaas , Jesper Nilsson , Jianguo Sun , Jingoo Han , Kishon Vijay Abraham I , Lucas Stach , Minghuan Lian , Mingkai Hu , Murali Karicheri , Pratyush Anand , Richard Zhu , Roy Zang , Shawn Guo , Stanimir Varbanov , Thomas Petazzoni , Xiaowei Song , Zhou Wang Subject: Re: [PATCH v2] PCI: dwc: fix enumeration end when reaching root subordinate Message-ID: <20180205200648.GM27654@lahna.fi.intel.com> References: <1516008968-26285-1-git-send-email-koen.vandeputte@ncentric.com> <20180205191420.GA12397@red-moon> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20180205191420.GA12397@red-moon> Sender: linux-pci-owner@vger.kernel.org List-ID: On Mon, Feb 05, 2018 at 07:14:21PM +0000, Lorenzo Pieralisi wrote: > On Mon, Jan 15, 2018 at 10:36:08AM +0100, Koen Vandeputte wrote: > > The subordinate value indicates the highest bus number which can be > > reached downstream though a certain device. > > > > Commit a20c7f36bd3d ("PCI: Do not allocate more buses than available in > > parent") > > ensures that downstream devices cannot assign busnumbers higher than the > > upstream device subordinate number, which was indeed illogical. > > > > By default, dw_pcie_setup_rc() inits the Root Complex subordinate to a > > value of 0x01. > > > > Due to this combined with above commit, enumeration stops digging deeper > > downstream as soon as bus num 0x01 has been assigned, which is always > > the case for a bridge device. > > > > This results in all devices behind a bridge bus to remain undetected, as > > these would be connected to bus 0x02 or higher. > > > > Fix this by initializing the RC to a subordinate value of 0xff, which is > > not altering hardware behaviour in any way, but informs probing > > function pci_scan_bridge() later on which reads this value back from > > register. > > > > Following nasty errors during boot are also fixed by this: > > > > [ 0.459145] pci_bus 0000:02: busn_res: can not insert [bus 02-ff] > > under [bus 01] (conflicts with (null) [bus 01]) > > ... > > [ 0.464515] pci_bus 0000:03: [bus 03] partially hidden behind bridge > > 0000:01 [bus 01] > > ... > > [ 0.464892] pci_bus 0000:04: [bus 04] partially hidden behind bridge > > 0000:01 [bus 01] > > ... > > [ 0.466488] pci_bus 0000:05: [bus 05] partially hidden behind bridge > > 0000:01 [bus 01] > > [ 0.466506] pci_bus 0000:02: busn_res: [bus 02-ff] end is updated to > > 05 > > [ 0.466517] pci_bus 0000:02: busn_res: can not insert [bus 02-05] > > under [bus 01] (conflicts with (null) [bus 01]) > > [ 0.466534] pci_bus 0000:02: [bus 02-05] partially hidden behind > > bridge 0000:01 [bus 01] > > > > Fixes: a20c7f36bd3d ("PCI: Do not allocate more buses than available in > > parent") > > Signed-off-by: Koen Vandeputte > > Tested-by: Niklas Cassel > > Cc: Binghui Wang > > Cc: Bjorn Helgaas > > Cc: Jesper Nilsson > > Cc: Jianguo Sun > > Cc: Jingoo Han > > Cc: Kishon Vijay Abraham I > > Cc: Lorenzo Pieralisi > > Cc: Lucas Stach > > Cc: Mika Westerberg > > Cc: Minghuan Lian > > Cc: Mingkai Hu > > Cc: Murali Karicheri > > Cc: Pratyush Anand > > Cc: Richard Zhu > > Cc: Roy Zang > > Cc: Shawn Guo > > Cc: Stanimir Varbanov > > Cc: Thomas Petazzoni > > Cc: Xiaowei Song > > Cc: Zhou Wang > > --- > > drivers/pci/dwc/pcie-designware-host.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > I would appreciate some testing from dwc host maintainers so that > we can merge this patch, it is a bug fix that should be merged as > soon as possible, please help Koen test it and provide feedback > on the list. BTW, this should have a stable tag so that it gets backported to stable kernels. I guess whoever is applying the patch can add it so no need for another revision.