From patchwork Fri Oct 21 05:12:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Chiu X-Patchwork-Id: 1692838 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=YP4hfqqv; 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 4Mtt01569Cz23kk for ; Fri, 21 Oct 2022 16:13:04 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1olkKx-0005v4-AJ; Fri, 21 Oct 2022 05:12:51 +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 1olkKv-0005ua-L4 for kernel-team@lists.ubuntu.com; Fri, 21 Oct 2022 05:12:49 +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-0.canonical.com (Postfix) with ESMTPS id 187054240F for ; Fri, 21 Oct 2022 05:12:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1666329169; bh=/jI0WOSaGD27RVTm+34kopnO0HJDEOMRIPyTzhOqlac=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YP4hfqqvogU4tkwXKpl68IDbhTTeUaHpCS6lapunRXAhqi4bJBmM3dUtG/kJoegkA 9rfFL700ceA5pUybz4er67ofzpSbyfX4tk6EpboWIolsND50Iz4LROESB4GkAUCgi5 lGhvBq/Em/jcAIolmjJS5YxmRImvemhmpq1ZNpLpCpjh5fhd655zIvQrNJIawrtnNg OHVdJYHRk7E9zOkl4GJxr9I78kjlxE+5NJSlUZYv8Q1IvzCwqgKUAxTG/9+hiV51gQ SGwD7FfXizPsLl70IT7LFZAI1ruptnnx2y/11iOE/o/waoSp8giEq8dxqMeNURfO/V TwJYIK/xOBcqA== Received: by mail-pf1-f200.google.com with SMTP id y15-20020aa78f2f000000b00562674456afso829182pfr.9 for ; Thu, 20 Oct 2022 22:12:49 -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:message-id:reply-to; bh=/jI0WOSaGD27RVTm+34kopnO0HJDEOMRIPyTzhOqlac=; b=vNtcNMz7tmn/DsyyjF6VL4MZh0+poIWnkp/tOguQthEU4pUfLoVRrZauAIlHpKLr9h d4x3ZPHu0aH5hKs+xfHl/PQYFiBNsKAe/wn9CcXwHGsiHqpv8RgBNuRjSd/zMR/FBILs lay4Y/zJtzaViqpPpIOdhBEb8Kfp1P6/ginnGnqhnfFpLHPNvmpSw3UOOXDkfpYxBXOG Ubrj06Ior55BGJZ1gyksxIYQnIw86AwK6HQz2WqJ+s39fgU0OxoffqxxfK26AANziYRO d1RJcI9PVDPTakrfvWNrHOrx86jYqOMMH1JV16p+VTxxCI7ya1dRetsxEndDmLhaUDS3 4Hmw== X-Gm-Message-State: ACrzQf1tnhwMfwVaJtLbVFXtSbb3eTbveUfPIDBDzfpRhu3Q4yhSzGwL nwqFNcnDiMCED/wGAPElLtZ0GyNbCmOqQuh/Ai6DmtQ9ChfotpiQ227JJoZdrY7xSydOMegP1Cv p7ShfGXKCglYriQzx+y/YbIfoWDpGxCgmqDKU/88VCw== X-Received: by 2002:a65:6e0d:0:b0:42d:707c:94ee with SMTP id bd13-20020a656e0d000000b0042d707c94eemr14324664pgb.260.1666329167099; Thu, 20 Oct 2022 22:12:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7YAAqPmDy0ezLkPl1kzh1rFB+ZQgV7gWLK6FhzipuHeUwOzZZy1SqT5/xDYnmB1KRgzjLg0A== X-Received: by 2002:a65:6e0d:0:b0:42d:707c:94ee with SMTP id bd13-20020a656e0d000000b0042d707c94eemr14324644pgb.260.1666329166704; Thu, 20 Oct 2022 22:12:46 -0700 (PDT) Received: from localhost.localdomain (2001-b400-e357-130d-3a9d-713c-d2d2-7bfe.emome-ip6.hinet.net. [2001:b400:e357:130d:3a9d:713c:d2d2:7bfe]) by smtp.gmail.com with ESMTPSA id w12-20020a17090aaf8c00b0020adab4ab37sm711883pjq.31.2022.10.20.22.12.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 22:12:46 -0700 (PDT) From: Chris Chiu To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/6][SRU][Jammy] PCI: Pass available buses even if the bridge is already configured Date: Fri, 21 Oct 2022 13:12:35 +0800 Message-Id: <20221021051239.1097561-3-chris.chiu@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221021051239.1097561-1-chris.chiu@canonical.com> References: <20221021051239.1097561-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) 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 65a420e8bc03..d189e0cf1ea8 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1316,7 +1316,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 @@ -1341,7 +1341,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);