From patchwork Mon Feb 19 09:46:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Koen Vandeputte X-Patchwork-Id: 875053 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gWyhVi6x"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ncentric.com header.i=@ncentric.com header.b="LWKB57eH"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zlJp40YCKz9s0r for ; Mon, 19 Feb 2018 20:47:56 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:Message-Id: Date:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=0uiPx7i9X2YDa13kD9aw3lImG7L2SlhpbsuqiVPg0Go=; b=gWyhVi6xwxwe06 wG04nCMZL2AMOOEWPDFtkSH/4vFZ5v374MeUhuMN3nmdEOFeU04XRnIExi9rLoy1yl1WKUJIBKPbg vOjK91ByXA1EdLgRZtMKQB6IDThFei2KhjuDALnjoFai/M5ivP3kZnVtevrKSk7TkA2rewZpwtJQ7 AR1F0Lwo+edlr0M6xYhHbQ593a1BQF6pubrz31Eg7oz7LSTzFaAVflesqy3kmmGd5BHEf6zBsuuui qUSHJ65jV2E9Buu2MKiObX87lbfz8pIownIRcpTC+TwHJV9Zwi0jBlCHPo9l+mEXWQHv2lg2IFyzW X2FkPf8rcj9p0n4LWMBQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eni2x-00011T-2N; Mon, 19 Feb 2018 09:47:43 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eni2t-0000zj-1k for lede-dev@lists.infradead.org; Mon, 19 Feb 2018 09:47:40 +0000 Received: by mail-wm0-x241.google.com with SMTP id v71so13830788wmv.2 for ; Mon, 19 Feb 2018 01:47:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ncentric.com; s=google; h=from:to:cc:subject:date:message-id; bh=T+4ULruXSCC855IH0ef7AdUzGEZ3pfPgmiti31OUkCc=; b=LWKB57eHA5zZDTXG09x2g7PdbSApcLCdYkABCUR9E6N0FxAy9cEhH0EGX19GercPwJ GeyAODEBFB5FwnO18w22+CDSIY+/bNs9gsIwVEF/ukUwkTjb3zZv4cPnKWY+MvRCeT5s SHBaavoNQVOGm7T9BfJ4dLHenUGQ8MZ6nmzbk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=T+4ULruXSCC855IH0ef7AdUzGEZ3pfPgmiti31OUkCc=; b=qIl7+luY40cR4QXDaOj9u9hgYjVp6PzRHUmtJgjQKP2rqvHZc8A/woJxjr+sIymjII go1XeQUosPY8ml0vl6Nr2WqFemwznzVPzy5aCa/Qublgts5AgeRJPoSaEIPWPfdLiQ6T KEoFtWi2/CtwlgBpxo/vDiBhhaedxVd14eN0Bk+g2+AAt+LCNIQQXo1PLk3XlZKA/bPl 8tithModSpO6EIlxQhp5J1HFaWhT2n+KtKq2VBCMW2xv8334voRKPeUcACZrt0ltdaAi c7pPnTpVI9u0k65rLXnFK2dujSWZ1MHOu4mkaWYTHSnehNnVGhZUyx60uY1/j826MfaU fgwg== X-Gm-Message-State: APf1xPAheDfEFf7dCtLuxjmupIJ1GpDO/zDaF196MFnhnAX/m51bRAm0 HCUwzCJtAIWd5GUvdXzPfa6K+p6MAEw= X-Google-Smtp-Source: AH8x225O+DxemIFIDW5FHldhCEn9yNe/gKMbPZFYorz6Ses/rGfOSnWj60xBjj2FRd5BIKOv7nc3tA== X-Received: by 10.80.192.138 with SMTP id k10mr10037091edf.128.1519033643950; Mon, 19 Feb 2018 01:47:23 -0800 (PST) Received: from kvdp-BRIX.cmb.citymesh.com (d515300d8.static.telenet.be. [81.83.0.216]) by smtp.googlemail.com with ESMTPSA id l60sm3921959edl.56.2018.02.19.01.47.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Feb 2018 01:47:23 -0800 (PST) From: Koen Vandeputte To: lede-dev@lists.infradead.org Date: Mon, 19 Feb 2018 10:46:14 +0100 Message-Id: <1519033574-336-1-git-send-email-koen.vandeputte@ncentric.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180219_014739_248400_FDCC5A11 X-CRM114-Status: GOOD ( 14.45 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:400c:c09:0:0:0:241 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain Subject: [LEDE-DEV] [PATCH] kernel: backport pcie enumeration fix to kernel 4.9 X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Koen Vandeputte , john@phrozen.org MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This issue is also present in kernel 4.9 starting from 4.9.71 Adapted the patch, as the fixed function is in another location here. Signed-off-by: Koen Vandeputte --- .../pending-4.9/812-pci-dwc-fix-enumeration.patch | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 target/linux/generic/pending-4.9/812-pci-dwc-fix-enumeration.patch diff --git a/target/linux/generic/pending-4.9/812-pci-dwc-fix-enumeration.patch b/target/linux/generic/pending-4.9/812-pci-dwc-fix-enumeration.patch new file mode 100644 index 000000000000..5092aba53fc1 --- /dev/null +++ b/target/linux/generic/pending-4.9/812-pci-dwc-fix-enumeration.patch @@ -0,0 +1,62 @@ +From patchwork Tue Jan 9 14:42:21 2018 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: PCI: dwc: fix enumeration end when reaching root subordinate +From: Koen Vandeputte +X-Patchwork-Id: 10152443 +Message-Id: <1515508941-20055-1-git-send-email-koen.vandeputte@ncentric.com> +To: linux-pci@vger.kernel.org +Cc: bhelgaas@google.com, lorenzo.pieralisi@arm.com, + Joao.Pinto@synopsys.com, jingoohan1@gmail.com, niklas.cassel@axis.com, + Koen Vandeputte , + Mika Westerberg +Date: Tue, 9 Jan 2018 15:42:21 +0100 + +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, meaning +that all busses [0x00-0xff] are reachable through this RC. + +Fixes: a20c7f36bd3d ("PCI: Do not allocate more buses than available in +parent") +Signed-off-by: Koen Vandeputte +Tested-by: Niklas Cassel +Cc: Mika Westerberg +--- + +Will send separate patches to stable as this file got moved/renamed + + + drivers/pci/host/pcie-designware.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c +index bf558df5b7b3..2b5470173196 100644 +--- a/drivers/pci/host/pcie-designware.c ++++ b/drivers/pci/host/pcie-designware.c +@@ -861,7 +861,7 @@ void dw_pcie_setup_rc(struct pcie_port * + /* setup bus numbers */ + val = dw_pcie_readl_rc(pp, PCI_PRIMARY_BUS); + val &= 0xff000000; +- val |= 0x00010100; ++ val |= 0x00ff0100; + dw_pcie_writel_rc(pp, PCI_PRIMARY_BUS, val); + + /* setup command register */