From patchwork Fri Sep 30 08:24:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Chiu X-Patchwork-Id: 1684758 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=KPJCYbk/; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mf3Dv44FMz20Zh for ; Fri, 30 Sep 2022 18:24:47 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1oeBK2-0003uH-C6; Fri, 30 Sep 2022 08:24:38 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1oeBK0-0003t9-G0 for kernel-team@lists.ubuntu.com; Fri, 30 Sep 2022 08:24:36 +0000 Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id B07363FFE0 for ; Fri, 30 Sep 2022 08:24:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1664526275; bh=S7OysODRyK5LC/BVJp0/3YhYJKzAWWWEShpyB3TT08o=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KPJCYbk/zzYSDDCFM6OPd8Kbk4DwZdKFBQnGizIorWTxjhV75QcwApJKTPAr7/9kL yHPHkUW77gRjnLKPg2GhtJtiI1C0tCBfdvtOcUj4Bhl+L2qmzx8Uwh6dPlOexPCKza +/9HkO+C7Eyw17PsxuRgs4akyylMhlgB/nkw6FevIilwJA9lke+9ChwOCG1UI3MAiX 6xD4twFR0c/fA6OO8EfniO4wl4Z7050sN4My7Lk/mnATVIyvpB0E0C7FYP2f/R+F3N 3V6A8BhEsN86cKDhrVymFenYMJPsCjz8vQmphF7Hytix0DzP3ucf1RJjLxdpUOJvXN OZAo7r80PLVZw== Received: by mail-pg1-f197.google.com with SMTP id q8-20020a632a08000000b0043cab9c7de9so2477195pgq.3 for ; Fri, 30 Sep 2022 01:24:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=S7OysODRyK5LC/BVJp0/3YhYJKzAWWWEShpyB3TT08o=; b=FXY8ihhs8TivXFYzszXJvGxGf95zhJi6NE2ntpHhQ0IaWdxrdNKz0tGIo5ZEUD/rB9 g5wjKp28m9CE5smfnJgzmWayiFqh3IvRqBD1JIE4axmobL5UzcKd+g4S9dqLa8l1tk7b yiLZ2k1IkeXyiTYncwG+JZ5lM/JToNvh9y/4nP3euW5x7yweFVC0SecK64moDAFM6f/u w0gpcOfZDBwTDjnUv70IU7n+7lY5hQS3cTIuaTFlq5SU+CSGBkAeRUzK87FqBcAENakr sZY0RfzSnSLhT74QEOUtsCTSeiT9OCw5r6v9JtSLwRNdoJpkGxL6FELWah1o3qY+7NJR VdVA== X-Gm-Message-State: ACrzQf2JPypzj6Qa6YRxXOtfshchI1eMYt5O7EoBRlaeLqIV2ymUSZVo CH90xMMuYjoWeT5UPUv8RnTxlmv2h5JRMGG9L5ZudIUePegSwdo78/KCOg5a9V5C0APNuDhakm3 5ObyHkZfaD9jp0/OPm3Z2g5wQ5If/4B5AgF1JCHbnYg== X-Received: by 2002:a17:90a:72ca:b0:20a:37a7:70fb with SMTP id l10-20020a17090a72ca00b0020a37a770fbmr1109063pjk.35.1664526273818; Fri, 30 Sep 2022 01:24:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6d31A+dO6+os9cv6uKsjw2c9Rs1zrYdjUbwCE9X5fz+PhZYiFssOhSpNhxDoOFG6LvFIw50g== X-Received: by 2002:a17:90a:72ca:b0:20a:37a7:70fb with SMTP id l10-20020a17090a72ca00b0020a37a770fbmr1109029pjk.35.1664526273379; Fri, 30 Sep 2022 01:24:33 -0700 (PDT) Received: from localhost.localdomain (2001-b400-e280-1894-87db-41a8-13c0-2b41.emome-ip6.hinet.net. [2001:b400:e280:1894:87db:41a8:13c0:2b41]) by smtp.gmail.com with ESMTPSA id g8-20020aa79f08000000b00537daf64e8esm1115560pfr.188.2022.09.30.01.24.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Sep 2022 01:24:33 -0700 (PDT) From: Chris Chiu To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/6][SRU][OEM-5.17/OEM-6.0] PCI: Fix used_buses calculation in pci_scan_child_bus_extend() Date: Fri, 30 Sep 2022 16:24:23 +0800 Message-Id: <20220930082428.142684-2-chris.chiu@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220930082428.142684-1-chris.chiu@canonical.com> References: <20220930082428.142684-1-chris.chiu@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Mika Westerberg BugLink: https://bugs.launchpad.net/bugs/1991366 pci_scan_bridge_extend() returns the subordinate bus number needed to cover all the buses below a bridge. pci_scan_child_bus_extend() computes the number of buses to reserve by comparing that with the current max bus number. Previously it did the subtraction in the wrong order, so 'used_buses' was nonsense. Subtract 'max' from 'cmax' as is done for the similar pci_scan_bridge_extend() call in the following block. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216000 Fixes: 3374c545c27c ("PCI: Account for all bridges on bus when distributing bus numbers") Link: https://lore.kernel.org/r/20220905080232.36087-2-mika.westerberg@linux.intel.com Reported-by: Chris Chiu Tested-by: Chris Chiu Signed-off-by: Mika Westerberg Signed-off-by: Bjorn Helgaas Reviewed-by: Andy Shevchenko (cherry picked from commit 8066cc86b7aaaf6b4b38a81932459c6450440daa linux-next) Signed-off-by: Chris Chiu --- drivers/pci/probe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 414f659dc873..d9b42cbaf22a 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -2925,8 +2925,8 @@ static unsigned int pci_scan_child_bus_extend(struct pci_bus *bus, * hotplug bridges too much during the second scan below. */ used_buses++; - if (cmax - max > 1) - used_buses += cmax - max - 1; + if (max - cmax > 1) + used_buses += max - cmax - 1; } /* Scan bridges that need to be reconfigured */ From patchwork Fri Sep 30 08:24:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Chiu X-Patchwork-Id: 1684759 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=ZH+5lgzY; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mf3Dy2dskz1yqc for ; Fri, 30 Sep 2022 18:24:50 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1oeBK3-0003v5-Le; Fri, 30 Sep 2022 08:24:39 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1oeBK0-0003tp-Uu for kernel-team@lists.ubuntu.com; Fri, 30 Sep 2022 08:24:36 +0000 Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 9EEBA3F367 for ; Fri, 30 Sep 2022 08:24:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1664526276; bh=IeSXTxmOWQRtyOGHkA1Uj1U/w+lWLfJYd3lVW0J/J0c=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZH+5lgzY4yU/iXAJdF5+ShU2qvcX2ZuWeYZkfeXVFMAErQpIIb/xzuCe2fFeVhqej Rl6ny5w6Byk4SrIEZlq9n6u7+jp/DyhZQsRbdBqmaD/yt8qV6sRP4idwNHCbEOmGX3 G5RKS76KzB4Y2x1ik9H/vcw23uUrYVDS7/cb9TqSMqLR2QItsyGHpLwl4ItRO5eYuZ 3Q8nN8RSXcclnwaCkTxQZ6bYs1OYu4qpokt26PeFu+lIC3BL5m8uhe0gteOGbPoDte 3oGUifgUCCQrQkTxUNaiS4IJlk2mNbuMUP6PkD3W8bb88u4QxrIIeVoP51FQu+g19R E1Otes1XvrEhA== Received: by mail-pf1-f200.google.com with SMTP id u131-20020a627989000000b0054d3cf50780so2427864pfc.22 for ; Fri, 30 Sep 2022 01:24:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=IeSXTxmOWQRtyOGHkA1Uj1U/w+lWLfJYd3lVW0J/J0c=; b=n4hxnDNaxdNH02eEIN630Qv/4VGFY2gbyc1x7qNucK/SdClZ/cR43ACMSKmVt0yFjc AAGyUTi+XSsQwQzpu0+HTT+PbAyME16HcVOo1YLZP6RI3/Oc8nD7A+RvyrlXq9X8Ht0N 6Uxefm7vbtUKUqlNzjL9My+k2Y4vi65DeNLR8ccRXcIfK5Q47Xo5GoFRyK6w+bw8n+Ym Azkzu9k2KddKnSUklmCndYLYW2FXKGSOKGod117PQtlQSz26og6XGdZtO6kgfpfKLaVK LfHvYi9JN6pRKhmfwSVXCl+OsOGS2VeK7dWSnMFTel2JgcP0OTBmDSUmhfk6Wh9PipH/ bbSg== X-Gm-Message-State: ACrzQf3Xf5/hpAG6KJgDJ83FjpBBVnmtqyf+vHOrQ8YZXWmQvSCtFvmU WkGokdM7qdnujNy83btlWTmmpd4JVLCzHZt5sNuJqEPZOlxFuPy242H0nnaBbh6RBgubvTvmKCX uxri4O7fnkrNeN40AfsPn8gHSNVEf45GiCtfnZMlEbw== X-Received: by 2002:a63:5a61:0:b0:41b:b021:f916 with SMTP id k33-20020a635a61000000b0041bb021f916mr6440570pgm.387.1664526275046; Fri, 30 Sep 2022 01:24:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7ib/eKvxv+aHONXWDRTAhg73uR/UvuCZDnlmdSrqpG9adQ1cHPpFOiCg/BTTn37ZziWYNQAQ== X-Received: by 2002:a63:5a61:0:b0:41b:b021:f916 with SMTP id k33-20020a635a61000000b0041bb021f916mr6440547pgm.387.1664526274614; Fri, 30 Sep 2022 01:24:34 -0700 (PDT) Received: from localhost.localdomain (2001-b400-e280-1894-87db-41a8-13c0-2b41.emome-ip6.hinet.net. [2001:b400:e280:1894:87db:41a8:13c0:2b41]) by smtp.gmail.com with ESMTPSA id g8-20020aa79f08000000b00537daf64e8esm1115560pfr.188.2022.09.30.01.24.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Sep 2022 01:24:34 -0700 (PDT) From: Chris Chiu To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/6][SRU][OEM-5.17/OEM-6.0] PCI: Pass available buses even if the bridge is already configured Date: Fri, 30 Sep 2022 16:24:24 +0800 Message-Id: <20220930082428.142684-3-chris.chiu@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220930082428.142684-1-chris.chiu@canonical.com> References: <20220930082428.142684-1-chris.chiu@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Mika Westerberg BugLink: https://bugs.launchpad.net/bugs/1991366 If some part of the PCI topology is already configured (by the boot firmware) but not all, and it includes hotplug bridges, we may need to extend the bus resources of those bridges to accommodate any future hotplugs, in the same way we already do with the normal hotplug case. Pass the available buses to pci_scan_child_bus_extend() even when the bridge in question is already configured so the bus allocation code can use these available buses to extend the possible hotplug bridges below. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216000 Link: https://lore.kernel.org/r/20220905080232.36087-3-mika.westerberg@linux.intel.com Reported-by: Chris Chiu Tested-by: Chris Chiu Signed-off-by: Mika Westerberg Signed-off-by: Bjorn Helgaas Reviewed-by: Andy Shevchenko (cherry picked from commit 49ad31e9d78527045614c534df057cadee487773 linux-next) Signed-off-by: Chris Chiu --- drivers/pci/probe.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index d9b42cbaf22a..15ab8cf3d238 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1297,7 +1297,7 @@ static int pci_scan_bridge_extend(struct pci_bus *bus, struct pci_dev *dev, if ((secondary || subordinate) && !pcibios_assign_all_busses() && !is_cardbus && !broken) { - unsigned int cmax; + unsigned int cmax, buses; /* * Bus already configured by firmware, process it in the @@ -1322,7 +1322,8 @@ static int pci_scan_bridge_extend(struct pci_bus *bus, struct pci_dev *dev, child->bridge_ctl = bctl; } - cmax = pci_scan_child_bus(child); + buses = subordinate - secondary; + cmax = pci_scan_child_bus_extend(child, buses); if (cmax > subordinate) pci_warn(dev, "bridge has subordinate %02x but max busn %02x\n", subordinate, cmax); From patchwork Fri Sep 30 08:24:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Chiu X-Patchwork-Id: 1684760 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=D7TbRXzN; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mf3Dz3DrWz1yqc for ; Fri, 30 Sep 2022 18:24:51 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1oeBK5-0003wY-0J; Fri, 30 Sep 2022 08:24:41 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1oeBK2-0003uG-Cn for kernel-team@lists.ubuntu.com; Fri, 30 Sep 2022 08:24:38 +0000 Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 21EA53F367 for ; Fri, 30 Sep 2022 08:24:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1664526278; bh=7KMx/LkTun1GIvydTqodfVDv3kvZqScD5HwMDSgzAVM=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=D7TbRXzN7kj2ABHeLOKAaskYLPp2rrB0r7VJvM0r8YXdllfGllIW4pv61hIEBt6E1 YNVkF/bP5djWGd7kPwkx4dtRlAOU0ZSLEBQVI8C3kOVYgrz0nc52Keq8w3QgNTqfjG MJNQshttQE4Wws538AMQ7cA4WyeRbK+OOi+Wqsw5GMIyY2XzBlRQukySOI1noEYaf9 lHUEb0hJT+MbSbfWCUlZfXEF/xeGqCp9gCFamQ3iCMO9hPjyDv5Enu44FtWBlwHPRT X2CubLYJ4BZg0dUYEDMRzD6V0cSlk2/nidu4xvBtTa7P+NH1LPvbbI9ilFLtmDenDn oZZISdG9mPbug== Received: by mail-pj1-f72.google.com with SMTP id f34-20020a17090a28a500b00205ee236c9cso1930468pjd.9 for ; Fri, 30 Sep 2022 01:24:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=7KMx/LkTun1GIvydTqodfVDv3kvZqScD5HwMDSgzAVM=; b=f063Yu0rs8dsQ3AiHl85lwv1UeAUAWSSL7Sd+owfj8LyrJORYFZhmw99BkwNdBYRvS UPTgN+w/iIVqzV5dYtMNqczJ5+0JxDZCpXYWXa+8KVBDT+VpDC6DgkEjjeq+vHL+KCTA cunkUr4p/9l6ZkMTDl6jTnymj/wjVkEEQU4GmCvn/DYE20HyB9BQvy9IQRYNkwtYuNGh q1hfFwMI+y4aGRCDxiZyKnXMMEYVpZkLmHwD0Y1e45GxFhAlUKbLd/JFAsKOXkb44tS1 ax7x8SW+SkpwbXyUpD1QrvvAoMVo02V0uVMocVA6J/23UF6QcHRrAy5fCsA5pRTttBKl O32Q== X-Gm-Message-State: ACrzQf0DLhfEkhNuR/FweE5xTUp7TQxFMZJQAT7Q6buTe56IV2t+OGTy RQVN3xNYN/5Vd/bz5789702cx4vGv1WYV7P2Wfa5BrfVjaN6ZAuV2XuCARvETS8CvEjDaOJci2P qRa/D27+XQ7Xk3EeUO+bKQP4zxaSWCloxjGuumDKi8w== X-Received: by 2002:a63:db07:0:b0:439:2e24:df01 with SMTP id e7-20020a63db07000000b004392e24df01mr6603765pgg.221.1664526276395; Fri, 30 Sep 2022 01:24:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7SQODYIkXrrdvcZ3FTtaMtCEFkm9ymNBS26tyq5lvHdWedXtVoUmVkiM/0YViuubKoutodRg== X-Received: by 2002:a63:db07:0:b0:439:2e24:df01 with SMTP id e7-20020a63db07000000b004392e24df01mr6603738pgg.221.1664526275808; Fri, 30 Sep 2022 01:24:35 -0700 (PDT) Received: from localhost.localdomain (2001-b400-e280-1894-87db-41a8-13c0-2b41.emome-ip6.hinet.net. [2001:b400:e280:1894:87db:41a8:13c0:2b41]) by smtp.gmail.com with ESMTPSA id g8-20020aa79f08000000b00537daf64e8esm1115560pfr.188.2022.09.30.01.24.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Sep 2022 01:24:35 -0700 (PDT) From: Chris Chiu To: kernel-team@lists.ubuntu.com Subject: [PATCH 3/6][SRU][OEM-5.17/OEM-6.0] PCI: Move pci_assign_unassigned_root_bus_resources() Date: Fri, 30 Sep 2022 16:24:25 +0800 Message-Id: <20220930082428.142684-4-chris.chiu@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220930082428.142684-1-chris.chiu@canonical.com> References: <20220930082428.142684-1-chris.chiu@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Mika Westerberg BugLink: https://bugs.launchpad.net/bugs/1991366 We need to be able to call pci_bridge_distribute_available_resources() from this function so move it accordingly to avoid need for forward declaration. No functional impact. Link: https://lore.kernel.org/r/20220905080232.36087-4-mika.westerberg@linux.intel.com Signed-off-by: Mika Westerberg Signed-off-by: Bjorn Helgaas Reviewed-by: Andy Shevchenko (cherry picked from commit d1caf229c7587b5c514910fff8dc382e69fdcdf5 linux-next) Signed-off-by: Chris Chiu --- drivers/pci/setup-bus.c | 226 ++++++++++++++++++++-------------------- 1 file changed, 113 insertions(+), 113 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 547396ec50b5..366b43ed7826 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -1745,119 +1745,6 @@ static enum enable_type pci_realloc_detect(struct pci_bus *bus, } #endif -/* - * First try will not touch PCI bridge res. - * Second and later try will clear small leaf bridge res. - * Will stop till to the max depth if can not find good one. - */ -void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus) -{ - LIST_HEAD(realloc_head); - /* List of resources that want additional resources */ - struct list_head *add_list = NULL; - int tried_times = 0; - enum release_type rel_type = leaf_only; - LIST_HEAD(fail_head); - struct pci_dev_resource *fail_res; - int pci_try_num = 1; - enum enable_type enable_local; - - /* Don't realloc if asked to do so */ - enable_local = pci_realloc_detect(bus, pci_realloc_enable); - if (pci_realloc_enabled(enable_local)) { - int max_depth = pci_bus_get_depth(bus); - - pci_try_num = max_depth + 1; - dev_info(&bus->dev, "max bus depth: %d pci_try_num: %d\n", - max_depth, pci_try_num); - } - -again: - /* - * Last try will use add_list, otherwise will try good to have as must - * have, so can realloc parent bridge resource - */ - if (tried_times + 1 == pci_try_num) - add_list = &realloc_head; - /* - * Depth first, calculate sizes and alignments of all subordinate buses. - */ - __pci_bus_size_bridges(bus, add_list); - - /* Depth last, allocate resources and update the hardware. */ - __pci_bus_assign_resources(bus, add_list, &fail_head); - if (add_list) - BUG_ON(!list_empty(add_list)); - tried_times++; - - /* Any device complain? */ - if (list_empty(&fail_head)) - goto dump; - - if (tried_times >= pci_try_num) { - if (enable_local == undefined) - dev_info(&bus->dev, "Some PCI device resources are unassigned, try booting with pci=realloc\n"); - else if (enable_local == auto_enabled) - dev_info(&bus->dev, "Automatically enabled pci realloc, if you have problem, try booting with pci=realloc=off\n"); - - free_list(&fail_head); - goto dump; - } - - dev_info(&bus->dev, "No. %d try to assign unassigned res\n", - tried_times + 1); - - /* Third times and later will not check if it is leaf */ - if ((tried_times + 1) > 2) - rel_type = whole_subtree; - - /* - * Try to release leaf bridge's resources that doesn't fit resource of - * child device under that bridge. - */ - list_for_each_entry(fail_res, &fail_head, list) - pci_bus_release_bridge_resources(fail_res->dev->bus, - fail_res->flags & PCI_RES_TYPE_MASK, - rel_type); - - /* Restore size and flags */ - list_for_each_entry(fail_res, &fail_head, list) { - struct resource *res = fail_res->res; - int idx; - - res->start = fail_res->start; - res->end = fail_res->end; - res->flags = fail_res->flags; - - if (pci_is_bridge(fail_res->dev)) { - idx = res - &fail_res->dev->resource[0]; - if (idx >= PCI_BRIDGE_RESOURCES && - idx <= PCI_BRIDGE_RESOURCE_END) - res->flags = 0; - } - } - free_list(&fail_head); - - goto again; - -dump: - /* Dump the resource on buses */ - pci_bus_dump_resources(bus); -} - -void __init pci_assign_unassigned_resources(void) -{ - struct pci_bus *root_bus; - - list_for_each_entry(root_bus, &pci_root_buses, node) { - pci_assign_unassigned_root_bus_resources(root_bus); - - /* Make sure the root bridge has a companion ACPI device */ - if (ACPI_HANDLE(root_bus->bridge)) - acpi_ioapic_add(ACPI_HANDLE(root_bus->bridge)); - } -} - static void adjust_bridge_window(struct pci_dev *bridge, struct resource *res, struct list_head *add_list, resource_size_t new_size) @@ -2047,6 +1934,119 @@ static void pci_bridge_distribute_available_resources(struct pci_dev *bridge, available_mmio_pref); } +/* + * First try will not touch PCI bridge res. + * Second and later try will clear small leaf bridge res. + * Will stop till to the max depth if can not find good one. + */ +void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus) +{ + LIST_HEAD(realloc_head); + /* List of resources that want additional resources */ + struct list_head *add_list = NULL; + int tried_times = 0; + enum release_type rel_type = leaf_only; + LIST_HEAD(fail_head); + struct pci_dev_resource *fail_res; + int pci_try_num = 1; + enum enable_type enable_local; + + /* Don't realloc if asked to do so */ + enable_local = pci_realloc_detect(bus, pci_realloc_enable); + if (pci_realloc_enabled(enable_local)) { + int max_depth = pci_bus_get_depth(bus); + + pci_try_num = max_depth + 1; + dev_info(&bus->dev, "max bus depth: %d pci_try_num: %d\n", + max_depth, pci_try_num); + } + +again: + /* + * Last try will use add_list, otherwise will try good to have as must + * have, so can realloc parent bridge resource + */ + if (tried_times + 1 == pci_try_num) + add_list = &realloc_head; + /* + * Depth first, calculate sizes and alignments of all subordinate buses. + */ + __pci_bus_size_bridges(bus, add_list); + + /* Depth last, allocate resources and update the hardware. */ + __pci_bus_assign_resources(bus, add_list, &fail_head); + if (add_list) + BUG_ON(!list_empty(add_list)); + tried_times++; + + /* Any device complain? */ + if (list_empty(&fail_head)) + goto dump; + + if (tried_times >= pci_try_num) { + if (enable_local == undefined) + dev_info(&bus->dev, "Some PCI device resources are unassigned, try booting with pci=realloc\n"); + else if (enable_local == auto_enabled) + dev_info(&bus->dev, "Automatically enabled pci realloc, if you have problem, try booting with pci=realloc=off\n"); + + free_list(&fail_head); + goto dump; + } + + dev_info(&bus->dev, "No. %d try to assign unassigned res\n", + tried_times + 1); + + /* Third times and later will not check if it is leaf */ + if ((tried_times + 1) > 2) + rel_type = whole_subtree; + + /* + * Try to release leaf bridge's resources that doesn't fit resource of + * child device under that bridge. + */ + list_for_each_entry(fail_res, &fail_head, list) + pci_bus_release_bridge_resources(fail_res->dev->bus, + fail_res->flags & PCI_RES_TYPE_MASK, + rel_type); + + /* Restore size and flags */ + list_for_each_entry(fail_res, &fail_head, list) { + struct resource *res = fail_res->res; + int idx; + + res->start = fail_res->start; + res->end = fail_res->end; + res->flags = fail_res->flags; + + if (pci_is_bridge(fail_res->dev)) { + idx = res - &fail_res->dev->resource[0]; + if (idx >= PCI_BRIDGE_RESOURCES && + idx <= PCI_BRIDGE_RESOURCE_END) + res->flags = 0; + } + } + free_list(&fail_head); + + goto again; + +dump: + /* Dump the resource on buses */ + pci_bus_dump_resources(bus); +} + +void __init pci_assign_unassigned_resources(void) +{ + struct pci_bus *root_bus; + + list_for_each_entry(root_bus, &pci_root_buses, node) { + pci_assign_unassigned_root_bus_resources(root_bus); + + /* Make sure the root bridge has a companion ACPI device */ + if (ACPI_HANDLE(root_bus->bridge)) + acpi_ioapic_add(ACPI_HANDLE(root_bus->bridge)); + } +} + void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge) { struct pci_bus *parent = bridge->subordinate; From patchwork Fri Sep 30 08:24:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Chiu X-Patchwork-Id: 1684761 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=hIfzcTtA; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mf3Dz6RvPz20Zh for ; Fri, 30 Sep 2022 18:24:51 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1oeBK6-0003yP-AI; Fri, 30 Sep 2022 08:24:42 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1oeBK3-0003up-72 for kernel-team@lists.ubuntu.com; Fri, 30 Sep 2022 08:24:39 +0000 Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id E9A013FFE0 for ; Fri, 30 Sep 2022 08:24:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1664526278; bh=5LDKGfnf0tCKgMG1NgcLb5hfgOZMgnKZEDAl/z0xQsM=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hIfzcTtA4VVc50j2RyoESHX3LJO/0uLdZQ293R64oj8ucx1KfAdnBxhV8j43WCv3D M75sNCaymQdfabden391SHq1XuUR6Q0wvVW2DvucSupNBHc1iI6li6kylLTprXNktH nFg9DNWq1SWOCoUTjJiLMhRKieHgGLT0zyrN4Qp0RRfpppr889r15vItwDpT90pYXv 9ZEtOtAB/+V6IHJhMEQydsKO5+bMClCsQ3Yl2iyrWyQxCIdJOvukNt4yxYJ/ee9dLy /s2GZaz/I+h4kzidfYN5nVfRrHSTe3ehUJSxkBgFgEgkQso4jEcRd00YwVgHIZu1Wx oJ4Mqwgap8Jdg== Received: by mail-pf1-f198.google.com with SMTP id z24-20020a056a001d9800b0054667d493bdso2449221pfw.0 for ; Fri, 30 Sep 2022 01:24:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=5LDKGfnf0tCKgMG1NgcLb5hfgOZMgnKZEDAl/z0xQsM=; b=1UxsD4tGLG0HgamhWByMDvUg46+QY7x82IS0LAowBJjWCSA/oYOdXtppqp7sT4kUr6 pLSZ9W3Gve/jEchwkjxkBrddnoG+N5vzSPHuV0J8R6hLyLAiklSZpZVCQQFFVr7rUu69 /V4O/BPLjUcDDzAEjM3kwBVRsw/dbpeDVi1UrLS6mJnTe/8dqwNPo10DaoEQLY1IlSZ0 IXdCbpJRtk03jrhFkjtGdyih/+BImB5xkuljVaAyXGjVHKSvcYk8+h+7P6tT44nwoyZd cXMxN1svAJa+O45Mlewer9Ln7qKnzGHV2+CiCTFmGULp+ig4Mm13mqW0pGf4dzPKlK52 wY9g== X-Gm-Message-State: ACrzQf0iDhpH5svpAEUdjbYwRPHBqc0m2pdQTaK90flbnL60786vAfEJ Sdn8tEAPGyiNXjvOMh6/EG68W7z2W398ftSQr82G1ARSfsCWJu+SzLkqcb9dAgSwtOo9Ot7weIO N6CHhW7VWAJQ+f79g+5Cc/RON21eLoupHNbQk+8EMlw== X-Received: by 2002:a65:68c8:0:b0:438:744d:b340 with SMTP id k8-20020a6568c8000000b00438744db340mr6421119pgt.142.1664526277367; Fri, 30 Sep 2022 01:24:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6G9HvLR/K5D8qDx4iQf7YWvRoRfiliUfa70sbPut/BvxtsnGOVxn/okhcQNRqRxTZx+y+eUw== X-Received: by 2002:a65:68c8:0:b0:438:744d:b340 with SMTP id k8-20020a6568c8000000b00438744db340mr6421097pgt.142.1664526276887; Fri, 30 Sep 2022 01:24:36 -0700 (PDT) Received: from localhost.localdomain (2001-b400-e280-1894-87db-41a8-13c0-2b41.emome-ip6.hinet.net. [2001:b400:e280:1894:87db:41a8:13c0:2b41]) by smtp.gmail.com with ESMTPSA id g8-20020aa79f08000000b00537daf64e8esm1115560pfr.188.2022.09.30.01.24.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Sep 2022 01:24:36 -0700 (PDT) From: Chris Chiu To: kernel-team@lists.ubuntu.com Subject: [PATCH 4/6][SRU][OEM-5.17/OEM-6.0] PCI: Distribute available resources for root buses, too Date: Fri, 30 Sep 2022 16:24:26 +0800 Message-Id: <20220930082428.142684-5-chris.chiu@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220930082428.142684-1-chris.chiu@canonical.com> References: <20220930082428.142684-1-chris.chiu@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Mika Westerberg BugLink: https://bugs.launchpad.net/bugs/1991366 Previously we distributed spare resources only upon hot-add, so if the initial root bus scan found devices that had not been fully configured by the BIOS, we allocated only enough resources to cover what was then present. If some of those devices were hotplug bridges, we did not leave any additional resource space for future expansion. Distribute the available resources for root buses, too, to make this work the same way as the normal hotplug case. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216000 Link: https://lore.kernel.org/r/20220905080232.36087-5-mika.westerberg@linux.intel.com Reported-by: Chris Chiu Tested-by: Chris Chiu Signed-off-by: Mika Westerberg Signed-off-by: Bjorn Helgaas Reviewed-by: Andy Shevchenko (cherry picked from commit e96e27fc6f7971380283768e9a734af16b1716ee linux-next) Signed-off-by: Chris Chiu --- drivers/pci/setup-bus.c | 62 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 366b43ed7826..c96168dd7d93 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -1768,7 +1768,10 @@ static void adjust_bridge_window(struct pci_dev *bridge, struct resource *res, } res->end = res->start + new_size - 1; - remove_from_list(add_list, res); + + /* If the resource is part of the add_list remove it now */ + if (add_list) + remove_from_list(add_list, res); } static void pci_bus_distribute_available_resources(struct pci_bus *bus, @@ -1923,6 +1926,8 @@ static void pci_bridge_distribute_available_resources(struct pci_dev *bridge, if (!bridge->is_hotplug_bridge) return; + pci_dbg(bridge, "distributing available resources\n"); + /* Take the initial extra resources from the hotplug port */ available_io = bridge->resource[PCI_BRIDGE_IO_WINDOW]; available_mmio = bridge->resource[PCI_BRIDGE_MEM_WINDOW]; @@ -1934,6 +1939,59 @@ static void pci_bridge_distribute_available_resources(struct pci_dev *bridge, available_mmio_pref); } +static bool pci_bridge_resources_not_assigned(struct pci_dev *dev) +{ + const struct resource *r; + + /* + * Check the child device's resources and if they are not yet + * assigned it means we are configuring them (not the boot + * firmware) so we should be able to extend the upstream + * bridge's (that's the hotplug downstream PCIe port) resources + * in the same way we do with the normal hotplug case. + */ + r = &dev->resource[PCI_BRIDGE_IO_WINDOW]; + if (!r->flags || !(r->flags & IORESOURCE_STARTALIGN)) + return false; + r = &dev->resource[PCI_BRIDGE_MEM_WINDOW]; + if (!r->flags || !(r->flags & IORESOURCE_STARTALIGN)) + return false; + r = &dev->resource[PCI_BRIDGE_PREF_MEM_WINDOW]; + if (!r->flags || !(r->flags & IORESOURCE_STARTALIGN)) + return false; + + return true; +} + +static void pci_root_bus_distribute_available_resources(struct pci_bus *bus, + struct list_head *add_list) +{ + struct pci_dev *dev, *bridge = bus->self; + + for_each_pci_bridge(dev, bus) { + struct pci_bus *b; + + b = dev->subordinate; + if (!b) + continue; + + /* + * Need to check "bridge" here too because it is NULL + * in case of root bus. + */ + if (bridge && pci_bridge_resources_not_assigned(dev)) { + pci_bridge_distribute_available_resources(bridge, add_list); + /* + * There is only PCIe upstream port on the bus + * so we don't need to go futher. + */ + return; + } + + pci_root_bus_distribute_available_resources(b, add_list); + } +} + /* * First try will not touch PCI bridge res. * Second and later try will clear small leaf bridge res. @@ -1973,6 +2031,8 @@ void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus) */ __pci_bus_size_bridges(bus, add_list); + pci_root_bus_distribute_available_resources(bus, add_list); + /* Depth last, allocate resources and update the hardware. */ __pci_bus_assign_resources(bus, add_list, &fail_head); if (add_list) From patchwork Fri Sep 30 08:24:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Chiu X-Patchwork-Id: 1684762 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=iYq2I347; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mf3F13kj2z1yqc for ; Fri, 30 Sep 2022 18:24:53 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1oeBK7-00040b-Rw; Fri, 30 Sep 2022 08:24:43 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1oeBK4-0003wI-Qc for kernel-team@lists.ubuntu.com; Fri, 30 Sep 2022 08:24:40 +0000 Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 855AC3F367 for ; Fri, 30 Sep 2022 08:24:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1664526280; bh=Z6T7D2rrp4XQupIy5EBBwm7fWADPfwkxChAWiAUuUoY=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=iYq2I347Z3gnuoa3+rHqkGG7zYW4MYViQwAKUxoDrhX1/rs8jO00oF6ag0tvmL0yo 1Nd8uV2OFxaTc3RPsa/g8OfPredl1wp1fsfzoibdS2K8QgfoCyZO5tLUToQbng8X9R hTxSRTeeNIgrOCMIZiKxNLPTv0/JFTJNT7Yy4FkYmytrNoefypCet7C+OwBgRX3UtS xmf1zPCKIsrvvVN53Nr2QGDdfmg1iWG4TYEg7oYY7j4aykp7fTxyAx/T/ZNlbL54co vrCILBfTq3X7dDv0dxGqHunr0bm8/mTH1hlGzvsEYC9buNPrgzeAY46c8/7QChOyvb XPdjKAgokMV1A== Received: by mail-pl1-f198.google.com with SMTP id n10-20020a170902e54a00b001782663dcaeso2789000plf.18 for ; Fri, 30 Sep 2022 01:24:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=Z6T7D2rrp4XQupIy5EBBwm7fWADPfwkxChAWiAUuUoY=; b=dBS5VqDV212m1/QUmP+LuR/iNiMccdMg5jjlUjZ+TP6KkjJczK+MJeYESk/mWEhHt6 N3+i4hxYGuXkKw4DEMFKAASuKll5W8G4Orwi5u4H5rnvVhhfDAqqUdMrATxcPclUtpBH tiWNKKJW8Zhyt6OL66N+TJBAnfFC1XUm82492zLnVUuYrfVIwdm2rGpT+3xDe296CaQA pE+uxusjIPj8Xii3BzjgeH/tTTe1LnyQpf9fsZFIntYBaXAE5PtKwWKoGeZ7oUwkB+TR verEpXZUzl1UdwN0mT4xg8wuIITeCRP+/lgATx9XDnT9DnPfSTcH9eZWM2gXhGUvEqYl p94w== X-Gm-Message-State: ACrzQf1kWSNuj3CYw0HEI7gqPqwL0KRg9YrOMUEmmGKmE8EIkb2RLv+s ehbT+mdFwukPeFXHnXxL3Hc/vnC+Jmv8S+fS4UeB2ONXFoBmw9iD0m57F+DNrD5y8hpZuh/RQGv 83uggkX9wQMNEsOevXf/CWv8ypNClDhqjLchGL3DhHA== X-Received: by 2002:a05:6a00:1c98:b0:540:d461:f9d8 with SMTP id y24-20020a056a001c9800b00540d461f9d8mr7891369pfw.29.1664526278908; Fri, 30 Sep 2022 01:24:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5aCTY4dHUR6bZf/NOxAo8n6KcM++qjDK6J8UKT2RtV0faF8CMOEoXGgSMv5rzspJYvKFvhaQ== X-Received: by 2002:a05:6a00:1c98:b0:540:d461:f9d8 with SMTP id y24-20020a056a001c9800b00540d461f9d8mr7891340pfw.29.1664526278454; Fri, 30 Sep 2022 01:24:38 -0700 (PDT) Received: from localhost.localdomain (2001-b400-e280-1894-87db-41a8-13c0-2b41.emome-ip6.hinet.net. [2001:b400:e280:1894:87db:41a8:13c0:2b41]) by smtp.gmail.com with ESMTPSA id g8-20020aa79f08000000b00537daf64e8esm1115560pfr.188.2022.09.30.01.24.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Sep 2022 01:24:37 -0700 (PDT) From: Chris Chiu To: kernel-team@lists.ubuntu.com Subject: [PATCH 5/6][SRU][OEM-5.17/OEM-6.0] PCI: Fix whitespace and indentation Date: Fri, 30 Sep 2022 16:24:27 +0800 Message-Id: <20220930082428.142684-6-chris.chiu@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220930082428.142684-1-chris.chiu@canonical.com> References: <20220930082428.142684-1-chris.chiu@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Mika Westerberg BugLink: https://bugs.launchpad.net/bugs/1991366 Drop two empty lines from pci_scan_child_bus_extend() and correct indentation in pci_bridge_distribute_available_resources() to better follow the kernel coding style. No functional impact. Link: https://lore.kernel.org/r/20220905080232.36087-6-mika.westerberg@linux.intel.com Signed-off-by: Mika Westerberg Signed-off-by: Bjorn Helgaas Reviewed-by: Andy Shevchenko (cherry picked from commit 17d2d67d76e41c7fd00608fdad350e1790c5c24a linux-next) Signed-off-by: Chris Chiu --- drivers/pci/probe.c | 2 -- drivers/pci/setup-bus.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 15ab8cf3d238..25a2fa2a5303 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -2935,7 +2935,6 @@ static unsigned int pci_scan_child_bus_extend(struct pci_bus *bus, unsigned int buses = 0; if (!hotplug_bridges && normal_bridges == 1) { - /* * There is only one bridge on the bus (upstream * port) so it gets all available buses which it @@ -2944,7 +2943,6 @@ static unsigned int pci_scan_child_bus_extend(struct pci_bus *bus, */ buses = available_buses; } else if (dev->is_hotplug_bridge) { - /* * Distribute the extra buses between hotplug * bridges if any. diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index c96168dd7d93..d96fdfd1de27 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -1919,7 +1919,7 @@ static void pci_bus_distribute_available_resources(struct pci_bus *bus, } static void pci_bridge_distribute_available_resources(struct pci_dev *bridge, - struct list_head *add_list) + struct list_head *add_list) { struct resource available_io, available_mmio, available_mmio_pref; From patchwork Fri Sep 30 08:24:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Chiu X-Patchwork-Id: 1684763 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=a/rgqgWV; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mf3F20Jv9z20Zh for ; Fri, 30 Sep 2022 18:24:53 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1oeBK8-000416-2U; Fri, 30 Sep 2022 08:24:44 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1oeBK6-0003yJ-4h for kernel-team@lists.ubuntu.com; Fri, 30 Sep 2022 08:24:42 +0000 Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id CDA453F367 for ; Fri, 30 Sep 2022 08:24:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1664526281; bh=YSa1n0WkU22QXSR4cBQ3Sgpdxdh61v2VwCmWLL2q7j0=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=a/rgqgWVeesXyz2A9SH5QI7Uvjj/yLW5EU2Sv6DlCwV2YSPhDfBeui+pdygI8V/oE vhez6p4oaZqITDFVxo0W7XNrq/eDjxT0FaecJi/qAIb1JHAe8+cHSt6P6j0LFaRnAw 9t3iy2kpmkgSx2gbBRGEnNw8AaxI6myeBNXYaQYuvK9LO/hGjAmAVFrYbJCP72Wqgs uH3d9mb/rVNkcEwcDaEVwJYNEran1E9Z3MZFORoevBk6Oo7SjhguL9U8nYDI4Ial4E BrAtX1RbXnsrHikHU/uaRYPWOYeGuuz1QoTTJvX3Let274pIiSEcxAqpzYys5b5VQ9 HHOOSs7AIHdOw== Received: by mail-pl1-f197.google.com with SMTP id h11-20020a170902f54b00b001780f0f7ea7so2789532plf.9 for ; Fri, 30 Sep 2022 01:24:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=YSa1n0WkU22QXSR4cBQ3Sgpdxdh61v2VwCmWLL2q7j0=; b=FjMHMW/9DwL4nghe6f16mzn1V4+1CZbaQkE0kBM+ZCIW7obreSYPT2OT74+aQMJDjO 0KZ1KVD22bFzjivcDxvZCe5a2vGQM4NJoccHna77hFC19DB4XnhBvyY7CfrIE4HvT1Rf YUAG9Hlds4b93Li/vVOx/LBQNdpiP145Q+RNgmo89cVlsD56LTyqz6aPa4Ct+4FjdFzL GXb54IjFaajkaEc87VuZrM4ml3rBwcvSKGb6eCbGWnbk7yt7FAWP1YadnnS8p05G04On LPZ2qepOMFMF7adTsuTHiSQAmXOwmfhwPKuf7X7SgoVYHP8R0JR3c/nj08C96it+tAvI jplw== X-Gm-Message-State: ACrzQf1/2CdyCn8KuujFYWtJzFhAt94SIzVwPtkjifY0PYpmnJQEA06Y ntMs1j0R7BWfwe8omCxKEv/D1I9YPkx5ptm8E8L1xcULRk89u8eQYiC06FC3pzlyK+amf/tdtoe GlsG829Nn5JEDyu6cnHwjdtkpDJox+ppHUmzo8g51EQ== X-Received: by 2002:a17:90a:2b0c:b0:203:b7b1:2ba2 with SMTP id x12-20020a17090a2b0c00b00203b7b12ba2mr8394625pjc.34.1664526280231; Fri, 30 Sep 2022 01:24:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7JMx6OvmqdH1ZuMwmC4Qehr8fp2JdByIiIUbjMDRO6lr/A0qdgBLY2fMJfF6Wy/7/ydpWT3w== X-Received: by 2002:a17:90a:2b0c:b0:203:b7b1:2ba2 with SMTP id x12-20020a17090a2b0c00b00203b7b12ba2mr8394593pjc.34.1664526279781; Fri, 30 Sep 2022 01:24:39 -0700 (PDT) Received: from localhost.localdomain (2001-b400-e280-1894-87db-41a8-13c0-2b41.emome-ip6.hinet.net. [2001:b400:e280:1894:87db:41a8:13c0:2b41]) by smtp.gmail.com with ESMTPSA id g8-20020aa79f08000000b00537daf64e8esm1115560pfr.188.2022.09.30.01.24.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Sep 2022 01:24:39 -0700 (PDT) From: Chris Chiu To: kernel-team@lists.ubuntu.com Subject: [PATCH 6/6][SRU][OEM-5.17/OEM-6.0] PCI: Fix typo in pci_scan_child_bus_extend() Date: Fri, 30 Sep 2022 16:24:28 +0800 Message-Id: <20220930082428.142684-7-chris.chiu@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220930082428.142684-1-chris.chiu@canonical.com> References: <20220930082428.142684-1-chris.chiu@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Mika Westerberg BugLink: https://bugs.launchpad.net/bugs/1991366 Should be 'if' not 'of'. Fix this. Link: https://lore.kernel.org/r/20220905080232.36087-7-mika.westerberg@linux.intel.com Signed-off-by: Mika Westerberg Signed-off-by: Bjorn Helgaas Reviewed-by: Andy Shevchenko (cherry picked from commit 58e011609c4305fc50674c4610cbe8a8c26261f6 linux-next) Signed-off-by: Chris Chiu --- drivers/pci/probe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 25a2fa2a5303..30acd613454f 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -2961,7 +2961,7 @@ static unsigned int pci_scan_child_bus_extend(struct pci_bus *bus, /* * Make sure a hotplug bridge has at least the minimum requested * number of buses but allow it to grow up to the maximum available - * bus number of there is room. + * bus number if there is room. */ if (bus->self && bus->self->is_hotplug_bridge) { used_buses = max_t(unsigned int, available_buses,