From patchwork Fri Oct 21 05:12:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Chiu X-Patchwork-Id: 1692839 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=IKR84/Dw; 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 4Mtt014bClz23jk 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 1olkKt-0005uG-TP; Fri, 21 Oct 2022 05:12:47 +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 1olkKs-0005u8-Dc for kernel-team@lists.ubuntu.com; Fri, 21 Oct 2022 05:12:46 +0000 Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) (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 2E1DD412E5 for ; Fri, 21 Oct 2022 05:12:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1666329166; bh=2hqjK9gL7IEqkWPajpvFN+Y6coNECDe5I4tUyUZdHEQ=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=IKR84/DwaPC8YsggAbLTDpAAqJByVaogu+XcxLT7i0pu78nKnAh9ujKeeEd4kEiQI qOnaOQQBra/sjfgcbWysIe5ekEWOBefXAxBccqD88NgCquu9aCMOyZzVb0N6cjPOrg NHhfxXGqtggEPGfVaI6gudYWP6W5MohAdD9ErlOul6Scja7EjnajwDI+u89rYqlTAD s92sDrskT+4og5lrxe17gLaAZRaYvDs1enrMo+aYnO+aamJBMDe1uYBxf7pCcnAnQX RkKnCXFlk0HrTFjzSAwS8BmaCOei/el9KAQWKvauOtWLah1Sh9wXXYY4d9+6Fj/ues 31LK2Ne/FB0zg== Received: by mail-pj1-f69.google.com with SMTP id om10-20020a17090b3a8a00b002108b078ab1so3348695pjb.9 for ; Thu, 20 Oct 2022 22:12:46 -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:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2hqjK9gL7IEqkWPajpvFN+Y6coNECDe5I4tUyUZdHEQ=; b=aw83nmZ5so69K/cguvi0sBjXl6AooWc14afYKmnB5vEG6kOTESGSXWR1xNY6XhyTHn nu/xG7YWJpI89/SoQ0DCmJBv3uHNxQKsm7Y6MLFTXdX3x9baXk0T4KBXRkJqmb/36Fyf GuZx8R7nhtsV5tzpOlIboz+12UoH8oke0TKtzYxmpKjJOfxwnriJ5iPFR/SJydHxwfhv F8NbST3Z5MTVsHl1Sag4tuisnTpAuLmxWeoUZjx9yRjxO0NsGWFt/kFFSpzPbVLY0+BG m703UvIsy9qC15mkgBYbyB1FFsZ0z/GKQnDiGzaG5OUxvQum++fPqX16ido2kUvbkFh7 95IQ== X-Gm-Message-State: ACrzQf1nFF3H9N5gs9otKb70S/zfCmbIKmHDGaVkaAJ6VOiWU14xFMFB 5IRRxBftFV8jXQD5oRGLsqtHp6gilG1gEoNfjikr+OAGQUi70IFKBLjh7nfnkuSlRwApu+bPl+F USkWe2OlJj/UoKhIqKOWl6sFxZzeN/yqRpAND/hUiAA== X-Received: by 2002:a17:902:e742:b0:17f:6a44:ee4a with SMTP id p2-20020a170902e74200b0017f6a44ee4amr17785927plf.103.1666329163912; Thu, 20 Oct 2022 22:12:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4UvMoQf5Ke08CgZ9GyKpKq+si9dfoegj3SlGIEzBnrgIDM95FHVtB96Cl0ivI/v90CznkhCQ== X-Received: by 2002:a17:902:e742:b0:17f:6a44:ee4a with SMTP id p2-20020a170902e74200b0017f6a44ee4amr17785892plf.103.1666329163371; Thu, 20 Oct 2022 22:12:43 -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.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 22:12:43 -0700 (PDT) From: Chris Chiu To: kernel-team@lists.ubuntu.com Subject: [PATCH 0/6][SRU][Jammy] Fix Thunderbolt device hotplug fail when connect via thunderbolt dock Date: Fri, 21 Oct 2022 13:12:33 +0800 Message-Id: <20221021051239.1097561-1-chris.chiu@canonical.com> X-Mailer: git-send-email 2.25.1 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" BugLink: https://bugs.launchpad.net/bugs/1991366 [Impact] Some Dell laptops where booting with Thunderbolt/USB4 devices connected the BIOS leaves some of the PCIe devices unconfigured. The kernel message shows "No bus number available for hot-added bridge". The connected devices can't be found. [Fix] Current linux PCI distribute the "spare" resources between hotplug ports on hot-add but have not done that upon the initial scan. The patches make the initial root bus scan path to do the same. The additional patches are just a small cleanups that can be applied separately too. [Test] 1. Power on the machine with Thunderbolt/USB4 devices connected. 2. Check the kernel message to see if "No bus number available for hot-added bridge" shows up or not. 3. Check if the Thunderbolt/USB4 devices works or not. [Where problems could occur] The patches only apply the same procedures on initial root bus scan which was not done. If the BIOS configures the PCI correctly, everything is OK. It only takes effect on the BIOS w/ unconfigured PCIe devices. Mika Westerberg (6): PCI: Fix used_buses calculation in pci_scan_child_bus_extend() PCI: Pass available buses even if the bridge is already configured PCI: Move pci_assign_unassigned_root_bus_resources() PCI: Distribute available resources for root buses, too PCI: Fix whitespace and indentation PCI: Fix typo in pci_scan_child_bus_extend() drivers/pci/probe.c | 13 +- drivers/pci/setup-bus.c | 290 ++++++++++++++++++++++++---------------- 2 files changed, 181 insertions(+), 122 deletions(-) Acked-by: Tim Gardner Acked-by: Aaron Ma