Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6123084rdb; Thu, 14 Dec 2023 08:54:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IE7rhoAxA9HkLSuGlHdfs24myBpvhnJm1aO8f7NyIXBm2XIYO0J64clZnHydZn6hq2T2MMV X-Received: by 2002:a17:90b:3556:b0:28a:f0b9:c447 with SMTP id lt22-20020a17090b355600b0028af0b9c447mr1254912pjb.99.1702572860092; Thu, 14 Dec 2023 08:54:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702572860; cv=none; d=google.com; s=arc-20160816; b=yHLfEAXDwLXs0xLtnKujWSpd9EQeWE8E4RXpQbxhI7Fno6sXr+7oR7GrBlDfU25xJs AgsmB0zIcZ6ZkoftJXnx9Oe2Ths+k8it35Gji5PO3X3qvKgmnKE4feBtfFiHCcIsIxqN 6R4U1/KSPFK8yl9Fwm39L3F4DFApiF2q8n6WieOrfbHVBm5R2IC9JcYEXXmAWG+3ExzQ NXvfIvMdNsKaCO4iqMZeyni+WZBwGVxZp9qmv1T+GdP7LVRHq9oZTdjl4mrQDFZiFm9j zQfwyJKeCU09U+tj29cVTWEnThgRDQIylVmW/z0s+urAH6c9CEPYWdI8C30mhIMV5yur j6uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qMqA7655Z3p8MOMWi6x4CyiogFMNXMtt8stH7qzpZwU=; fh=ygrteKbZd4OU90ZAnjaWXQi9VQrnkrJ4ZSCxItyHzuQ=; b=OxVTdAVZHr+B0F81uAkTL/fx4H2lWgtjvZXo9UtB1civcOOxuQPwshHMM467HcqlPY rxH3Comd8SrNaOeY9AJ3r+6oCsudIHbLBumiqKm0GyWeL5L49Am0nWEpbAl4IFAVAp5x zZ/TNW9lu1riz/TdUrR7nmJHCaF6v4+IQlIbQYn8S4bFlBcZAdA8Ml5JU/bHuvj+oSum Etfdbei0uvFVro53IFYZtAXvna7XwyVhrtKzQy82qpJZ1O/S9Dkx0lb2twBjwgj+T5WK MQk1FrDJ3ysLPcj/KFxpKcLFVYLOoFVZTyIvlb2SGElZswrYVQADXRoqQkDGB8vxnTC4 hRUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FYu5gmAg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id e7-20020a17090ac20700b0028658eed319si11463911pjt.180.2023.12.14.08.54.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 08:54:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FYu5gmAg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 4A5A482A176B; Thu, 14 Dec 2023 08:54:17 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230226AbjLNQyD (ORCPT + 99 others); Thu, 14 Dec 2023 11:54:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230312AbjLNQyB (ORCPT ); Thu, 14 Dec 2023 11:54:01 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28CD9128 for ; Thu, 14 Dec 2023 08:54:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702572846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=qMqA7655Z3p8MOMWi6x4CyiogFMNXMtt8stH7qzpZwU=; b=FYu5gmAgVyadl9THwJlKeO+Zr1sNuNT5mXpuj90RoLG/2mtZAZHoCgPVoiMDFeN8hOlw0N 0SDAJoqw9F5msgM0/39Rak4r7+xzXUCKTONYxW5MD1eDInOvDZih1Z/JAKh74IaIlC99Sk sdglY6lF28jmZlXhir+EzsMeuxYBuZA= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-138-p3Np9I8VMEKyluQtsQFSkA-1; Thu, 14 Dec 2023 11:54:02 -0500 X-MC-Unique: p3Np9I8VMEKyluQtsQFSkA-1 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a1eb3f3dc2eso236343466b.2 for ; Thu, 14 Dec 2023 08:54:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702572841; x=1703177641; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=qMqA7655Z3p8MOMWi6x4CyiogFMNXMtt8stH7qzpZwU=; b=a4l8a5VN97i6XpLaFrnIRwDirvn7p9y5GCrrNl4GxWEmNqrhkeDavJ1Iq8ECot9qwh Mn5lIeBpbT/4pt4Hq8V5G2I+maeBKN74qgvbhfdmV20Kz6xViUxO43Kq+LEiDb/Tuj6V G1ACofOGZJlRsoSm/CysAjsUJsYb5qZHrWdznTHaxFoF+9aB8MYIbpZfRzt+SmSdtENm sYSmUJ2BHrr8OMvgfj04rNcSQl2RBpVc7s02Xif+8GrlkGcNOLZ3EpFXsUnLQko0cnlB c1GQhOeByQveJY0VW+osF8IVC5PaTez5Qb/6IbPqjgvBT6Lscfxa4bRNvfGFxiWQqRi2 V+8Q== X-Gm-Message-State: AOJu0Yzso6vb2epYQOu40JG53O3HobsSVViHmVmdEZdBU46CDC42/gX8 p431Hn8CZJZtYc17tclLXyGCH5G7nINmddgr1Sk6Fpu+nplyAtcfw8MHjFIO8U3yBuuHLi2eMFd IWdU6h9LDy7+UIqnkMDHxv5EK X-Received: by 2002:a17:907:72d6:b0:a1b:68e6:9d4c with SMTP id du22-20020a17090772d600b00a1b68e69d4cmr5493501ejc.71.1702572841655; Thu, 14 Dec 2023 08:54:01 -0800 (PST) X-Received: by 2002:a17:907:72d6:b0:a1b:68e6:9d4c with SMTP id du22-20020a17090772d600b00a1b68e69d4cmr5493495ejc.71.1702572841330; Thu, 14 Dec 2023 08:54:01 -0800 (PST) Received: from redhat.com ([2.52.132.243]) by smtp.gmail.com with ESMTPSA id ld4-20020a1709079c0400b00a1df88cc7c0sm9514218ejc.182.2023.12.14.08.53.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 08:54:00 -0800 (PST) Date: Thu, 14 Dec 2023 11:53:55 -0500 From: "Michael S. Tsirkin" To: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Igor Mammedov , Fiona Ebner , Dongli Zhang , Jonathan Woithe , "Rafael J . Wysocki" , Bjorn Helgaas , stable@vger.kernel.org Subject: Re: [PATCH] Revert "PCI: acpiphp: Reassign resources on bridge if necessary" Message-ID: <20231214115156-mutt-send-email-mst@kernel.org> References: <20231214165102.1093961-1-helgaas@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231214165102.1093961-1-helgaas@kernel.org> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 14 Dec 2023 08:54:17 -0800 (PST) On Thu, Dec 14, 2023 at 10:51:02AM -0600, Bjorn Helgaas wrote: > From: Bjorn Helgaas > > 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 > Cc: > Cc: Igor Mammedov It's up to you whether to apply the revert - hopefully a fix can be developed soon. The revert itself looks like it's done correctly so from that POV: Acked-by: Michael S. Tsirkin > --- > 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 601129772b2d..5b1f271c6034 100644 > --- a/drivers/pci/hotplug/acpiphp_glue.c > +++ b/drivers/pci/hotplug/acpiphp_glue.c > @@ -512,15 +512,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); > -- > 2.34.1