Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp3191634rwo; Mon, 24 Jul 2023 07:34:02 -0700 (PDT) X-Google-Smtp-Source: APBJJlH1zNNTFz53qGElfC3k87uJQNBaR6siAsCSgnIr+psK3NVrMiagxQPfgPxQCRpzeWTfX5i2 X-Received: by 2002:a05:6402:1a3c:b0:51e:2282:e1fc with SMTP id be28-20020a0564021a3c00b0051e2282e1fcmr7501453edb.6.1690209242569; Mon, 24 Jul 2023 07:34:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690209242; cv=none; d=google.com; s=arc-20160816; b=iFQgzGsS/90V8NSX7Mg/gsuwxv92LcdT+7RK0cfK4XJ33nS1aOu08h/OtydEvFUUoC a7p3Zcnv9Yvdxwns/K/MCppk4jyRjhJFB4zWIca1bS2qdGChqsV3zMks+zyq6N/FJfE9 2cr2/BZ0HbDZYglNsUs0/EyedP8ZB7img9cQ2UAVZ2Rqrl0CBEC1dS+VIIEVGfIGbH8q x3bOzCwOmJR/D3dIK4LfARqMn3S+h3gnes1ftjchSb9erueg8FS4BZCvjZplP0p6bdhS kZ3FmL0I3DBvUqpys5RWx4NZjZKkjdXsf+3qlUespJvNvCpCOcVHkoM5wjaTKawnFPOU fRgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=P2aZVU7pPnDc/RmZQW4iakWRtXamS7FJFx+fSy45nyM=; fh=6UACpRHD6QFMV/0syzGn/KwmShp17wz/EEbpiVeMjnM=; b=Rs6aarU/Ly3Bl75EAtNhETN2VbIXgClmOrr9nINxjvtHJkstNvsFHp0JwQKqw9N7Pg TTZcpjXqYpVfoTh7B5CeYtEc6YG8VPynIFqJxGC/IV/gX8SMWaUsZ5duj0FtboA0WpKA EI688trtwqu49ZppgRZs8PjfgSSGgGA3L0q68FlVxwVhpf1N/r8fmWjS4DzzA3ec4htI D7ljoxq/4EDODNYjNyIHC0LWMzijHMwdkMx585yOCqhWQDUeV8hkeH+jklvrfdN5THrE IHvSpuBJPXDoz5GKByP9p7iID2d1VT1cmwVi2f1lekXXclH+rB+9PLaloPKlktKF0XKo Q0sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QymtMmsT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z19-20020aa7d413000000b00521b592c80dsi6610215edq.511.2023.07.24.07.33.38; Mon, 24 Jul 2023 07:34:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QymtMmsT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229697AbjGXN77 (ORCPT + 99 others); Mon, 24 Jul 2023 09:59:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230094AbjGXN75 (ORCPT ); Mon, 24 Jul 2023 09:59:57 -0400 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 0B8D8133 for ; Mon, 24 Jul 2023 06:59:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690207149; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P2aZVU7pPnDc/RmZQW4iakWRtXamS7FJFx+fSy45nyM=; b=QymtMmsTSY3Ev2cIqp6Ix7MseEEcWqIwRWNx3PhIqH2fSbt3fa+2F/JBee0l6rYM1grPHV 3EWyDEDk0QvVdHs/p01w/F0Xg5T67hU5WBkgPKmU5DM38YssvZLUS2tnoNGEjsnyKUjQW/ DcGQRxYVNKyb88niZ/CjiXBEupfsMgM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-122-NK6o2GkLNmuwifLXGGNa6Q-1; Mon, 24 Jul 2023 09:59:05 -0400 X-MC-Unique: NK6o2GkLNmuwifLXGGNa6Q-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 51785800159; Mon, 24 Jul 2023 13:59:05 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 67ED040C2063; Mon, 24 Jul 2023 13:59:04 +0000 (UTC) From: Igor Mammedov To: linux-kernel@vger.kernel.org Cc: terraluna977@gmail.com, bhelgaas@google.com, linux-pci@vger.kernel.org, imammedo@redhat.com, mst@redhat.com Subject: [PATCH] hack to debug acpiphp crash Date: Mon, 24 Jul 2023 15:59:02 +0200 Message-Id: <20230724135902.2217991-1-imammedo@redhat.com> In-Reply-To: <11fc981c-af49-ce64-6b43-3e282728bd1a@gmail.com> References: <11fc981c-af49-ce64-6b43-3e282728bd1a@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Woody thanks for testing, can you try following patch which will try to workaround NULL bus->self if it's a really cuplrit and print an extra debug information. Add following to kernel command line(make sure that CONFIG_DYNAMIC_DEBUG is enabled): dyndbg="file drivers/pci/access.c +p; file drivers/pci/hotplug/acpiphp_glue.c +p; file drivers/pci/bus.c +p; file drivers/pci/pci.c +p; file drivers/pci/setup-bus.c +p" ignore_loglevel What I find odd in you logs is that enable_slot() is called while native PCIe should be used. Additional info might help to understand what's going on: 1: 'lspci' output 2: DSDT and all SSDT ACPI tables (you can use 'acpidump -b' to get them). Signed-off-by: Igor Mammedov --- drivers/pci/hotplug/acpiphp_glue.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index 328d1e416014..9ce3fd9d72a9 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c @@ -485,7 +485,10 @@ static void enable_slot(struct acpiphp_slot *slot, bool bridge) struct pci_bus *bus = slot->bus; struct acpiphp_func *func; +WARN(1, "enable_slot"); +pci_info(bus, "enable_slot bus\n"); if (bridge && bus->self && hotplug_is_native(bus->self)) { +pr_err("enable_slot: bridge branch\n"); /* * If native hotplug is used, it will take care of hotplug * slot management and resource allocation for hotplug @@ -498,8 +501,10 @@ static void enable_slot(struct acpiphp_slot *slot, bool bridge) acpiphp_native_scan_bridge(dev); } } else { + LIST_HEAD(add_list); int max, pass; +pr_err("enable_slot: acpiphp_rescan_slot branch\n"); acpiphp_rescan_slot(slot); max = acpiphp_max_busnr(bus); for (pass = 0; pass < 2; pass++) { @@ -508,13 +513,23 @@ static void enable_slot(struct acpiphp_slot *slot, bool bridge) continue; max = pci_scan_bridge(bus, dev, max, pass); +pci_info(dev, "enable_slot: pci_scan_bridge: max: %d\n", max); if (pass && dev->subordinate) { check_hotplug_bridge(slot, dev); pcibios_resource_survey_bus(dev->subordinate); + if (bus->self) + __pci_bus_size_bridges(dev->subordinate, + &add_list); } } } - pci_assign_unassigned_bridge_resources(bus->self); + if (bus->self) { +pci_info(bus->self, "enable_slot: pci_assign_unassigned_bridge_resources:\n"); + pci_assign_unassigned_bridge_resources(bus->self); + } else { +pci_info(bus, "enable_slot: __pci_bus_assign_resources:\n"); + __pci_bus_assign_resources(bus, &add_list, NULL); + } } acpiphp_sanitize_bus(bus); @@ -541,6 +556,7 @@ static void enable_slot(struct acpiphp_slot *slot, bool bridge) } pci_dev_put(dev); } +pr_err("enable_slot: end\n"); } /** -- 2.39.3