mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Woody Suwalski <terraluna977@gmail.com>
To: Igor Mammedov <imammedo@redhat.com>, linux-kernel@vger.kernel.org
Cc: bhelgaas@google.com, linux-pci@vger.kernel.org, mst@redhat.com
Subject: Re: [PATCH] hack to debug acpiphp crash
Date: Mon, 24 Jul 2023 21:52:34 -0400	[thread overview]
Message-ID: <92150d8d-8a3a-d600-a996-f60a8e4c876c@gmail.com> (raw)
In-Reply-To: <20230724135902.2217991-1-imammedo@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 3317 bytes --]

Igor Mammedov wrote:
> 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 <imammedo@redhat.com>
> ---
>   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");
>   }
>   
>   /**
Unfortunately the patch above does not seem to prevent the kernel crash.
Here comes the requested diagnostic info: dmesg's before and after, 
choice of lspci's and acpi tables. Hope that will help :-)

Thanks, Woody



[-- Attachment #2: pcidebug.tar.xz --]
[-- Type: application/x-xz, Size: 61636 bytes --]

  reply	other threads:[~2023-07-25  1:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-20  3:36 Kernel 6.5-rc2: system crash on suspend bisected Woody Suwalski
2023-07-20 20:21 ` Bjorn Helgaas
2023-07-24  9:27   ` Igor Mammedov
2023-07-27  6:09   ` Michael S. Tsirkin
2023-07-27 12:07     ` Woody Suwalski
2023-07-23  9:24 ` Linux regression tracking #adding (Thorsten Leemhuis)
2023-07-24 13:59 ` [PATCH] hack to debug acpiphp crash Igor Mammedov
2023-07-25  1:52   ` Woody Suwalski [this message]
2023-07-25  8:06     ` Igor Mammedov
2023-07-25  8:42       ` Igor Mammedov
2023-07-25 11:45         ` Woody Suwalski
2023-07-25 11:58           ` Igor Mammedov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=92150d8d-8a3a-d600-a996-f60a8e4c876c@gmail.com \
    --to=terraluna977@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=imammedo@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mst@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®