From patchwork Tue Dec 26 06:26:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengen Du X-Patchwork-Id: 1880197 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=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (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 4SzlDY2KgRz20RL for ; Tue, 26 Dec 2023 17:27:09 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1rI0ty-000854-N6; Tue, 26 Dec 2023 06:26:55 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1rI0tS-00082S-9v for kernel-team@lists.ubuntu.com; Tue, 26 Dec 2023 06:26:23 +0000 Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.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 34F473F2C1 for ; Tue, 26 Dec 2023 06:26:20 +0000 (UTC) Received: by mail-pg1-f198.google.com with SMTP id 41be03b00d2f7-5cdbf9fd702so4468228a12.0 for ; Mon, 25 Dec 2023 22:26:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703571977; x=1704176777; 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=n7mvMorce8uHx7ptIMkRv5kvzMMjJPlIIeXyTmdfoRE=; b=lH5j2bkMelofwQc70mTpu6UUPwBe8T0AHL0zXvTHm1kWoYBEQ6jhf63JqduHgodnxz /YXUhmON2mvuVuhDpUuwYvSG2AtOYGE5WwXYgakj54yRylcXDz5P1bDgDRMKug1odDpH 6uqxMSYt0TRIms8pA3MgP9qD49T6EjedBLj2EaYXK0Sp6mdYMWOEF6FC6sRrjGd9FXIJ QNWG/YPClWlsiPUqIjwjZMxbE2mHW76KsPXPgBAuwBAxxh2uv7UCldoiKIXl2G7xe5Dz Sm7ktnzCJexF0OGWqCMc0L+tpy2aVKW4JKdLjYbO2tVrZP1Yak7Bf64bXy9EbQLm+ouT qk0g== X-Gm-Message-State: AOJu0YwSw+EN0LtpKm3QBIs5s7558P+CXGxfXbAEOZgtnCJFb0nxbptx AckNq+t8iFOGq9RCpAduBytsgI3Yiy1S9mzNdyMJ9TyplEVBRQGtuyzlX1BbDPLueCNjDjUpZLX TpNGnKOeyP5dyWk0ANEOFYNLQeaKhl8wk+YjCEcXSmTHQPRHTZXsdqcZSMHI= X-Received: by 2002:a05:6a20:a99b:b0:194:b6a6:9f1 with SMTP id cc27-20020a056a20a99b00b00194b6a609f1mr6982541pzb.1.1703571977635; Mon, 25 Dec 2023 22:26:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IFC1c/j4F2fmr98fBMXR/mYr/jBIXZJt8ntd9Hj6yGRX1Zm0lQqVxEZyUl4J4rI5ek0S0IAZA== X-Received: by 2002:a05:6a20:a99b:b0:194:b6a6:9f1 with SMTP id cc27-20020a056a20a99b00b00194b6a609f1mr6982535pzb.1.1703571977166; Mon, 25 Dec 2023 22:26:17 -0800 (PST) Received: from chengendu.. (111-248-128-201.dynamic-ip.hinet.net. [111.248.128.201]) by smtp.gmail.com with ESMTPSA id gf8-20020a17090ac7c800b0028c09c052e4sm7486814pjb.16.2023.12.25.22.26.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Dec 2023 22:26:16 -0800 (PST) From: Chengen Du To: kernel-team@lists.ubuntu.com Subject: [SRU][F, J, L, M, N][PATCH 1/1] Revert "PCI: acpiphp: Reassign resources on bridge if necessary" Date: Tue, 26 Dec 2023 14:26:12 +0800 Message-Id: <20231226062612.97313-2-chengen.du@canonical.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231226062612.97313-1-chengen.du@canonical.com> References: <20231226062612.97313-1-chengen.du@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: Bjorn Helgaas BugLink: https://bugs.launchpad.net/bugs/2047382 This reverts commit 40613da52b13fb21c5566f10b287e0ca8c12c4e9 and the subsequent fix to it: cc22522fd55e ("PCI: acpiphp: Use pci_assign_unassigned_bridge_resources() only for non-root bus") 40613da52b13 fixed a problem where hot-adding a device with large BARs failed if the bridge windows programmed by firmware were not large enough. cc22522fd55e ("PCI: acpiphp: Use pci_assign_unassigned_bridge_resources() only for non-root bus") fixed a problem with 40613da52b13: an ACPI hot-add of a device on a PCI root bus (common in the virt world) or firmware sending ACPI Bus Check to non-existent Root Ports (e.g., on Dell Inspiron 7352/0W6WV0) caused a NULL pointer dereference and suspend/resume hangs. Unfortunately the combination of 40613da52b13 and cc22522fd55e caused other problems: - Fiona reported that hot-add of SCSI disks in QEMU virtual machine fails sometimes. - Dongli reported a similar problem with hot-add of SCSI disks. - Jonathan reported a console freeze during boot on bare metal due to an error in radeon GPU initialization. Revert both patches to avoid adding these problems. This means we will again see the problems with hot-adding devices with large BARs and the NULL pointer dereferences and suspend/resume issues that 40613da52b13 and cc22522fd55e were intended to fix. Fixes: 40613da52b13 ("PCI: acpiphp: Reassign resources on bridge if necessary") Fixes: cc22522fd55e ("PCI: acpiphp: Use pci_assign_unassigned_bridge_resources() only for non-root bus") Reported-by: Fiona Ebner Closes: https://lore.kernel.org/r/9eb669c0-d8f2-431d-a700-6da13053ae54@proxmox.com Reported-by: Dongli Zhang Closes: https://lore.kernel.org/r/3c4a446a-b167-11b8-f36f-d3c1b49b42e9@oracle.com Reported-by: Jonathan Woithe Closes: https://lore.kernel.org/r/ZXpaNCLiDM+Kv38H@marvin.atrad.com.au Signed-off-by: Bjorn Helgaas Acked-by: Michael S. Tsirkin Acked-by: Igor Mammedov Cc: (cherry picked from commit 5df12742b7e3aae2594a30a9d14d5d6e9e7699f4) Signed-off-by: Chengen Du --- drivers/pci/hotplug/acpiphp_glue.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index f304bdefa8f5..98be06ac2af2 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c @@ -510,15 +510,12 @@ static void enable_slot(struct acpiphp_slot *slot, bool bridge) if (pass && dev->subordinate) { check_hotplug_bridge(slot, dev); pcibios_resource_survey_bus(dev->subordinate); - if (pci_is_root_bus(bus)) - __pci_bus_size_bridges(dev->subordinate, &add_list); + __pci_bus_size_bridges(dev->subordinate, + &add_list); } } } - if (pci_is_root_bus(bus)) - __pci_bus_assign_resources(bus, &add_list, NULL); - else - pci_assign_unassigned_bridge_resources(bus->self); + __pci_bus_assign_resources(bus, &add_list, NULL); } acpiphp_sanitize_bus(bus);