Subject: Re: [REGRESSION 00/04] Crash during resume of pcie bridge

From: Bert Karwatzki <[email-masked]>
Date: Mon, 13 Oct 2025 18:29:46 +0200

Am Dienstag, dem 07.10.2025 um 16:33 -0500 schrieb Mario Limonciello:
> 
> Can you still reproduce with amd_iommu=off?

Reproducing this is at all is very difficult, so I'll try to find the exact spot
where things break (i.e. when the pci bus breaks and no more message are transmitted
via netconsole) first. The current state of this search is that the crash occurs in
pci_pm_runtime_resume(), before pci_fixup_device() is called:

static int pci_pm_runtime_resume(struct device *dev)
{
	struct pci_dev *pci_dev = to_pci_dev(dev);
	const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
	pci_power_t prev_state = pci_dev->current_state;
	int error = 0;
	// dev_info(dev, "%s = %px\n", __func__, (void *) pci_pm_runtime_resume); // remove this so we don't get too much delay
										  // This was still printed in the case of a crash
										  // so the crash must happen below

	/*
	 * Restoring config space is necessary even if the device is not bound
	 * to a driver because although we left it in D0, it may have gone to
	 * D3cold when the bridge above it runtime suspended.
	 */
	pci_pm_default_resume_early(pci_dev);
	if (!strcmp(dev_name(dev), "0000:00:01.1")) // This is the current test.
		dev_info(dev, "%s %d\n", __func__, __LINE__);
	pci_resume_ptm(pci_dev);

	if (!pci_dev->driver)
		return 0;

	//if (!strcmp(dev_name(dev), "0000:00:01.1"))         // This was not printed when 6.17.0-rc6-next-20250917-gpudebug-00036-g4f7b4067c9ce
	//	dev_info(dev, "%s %d\n", __func__, __LINE__); // crashed, so the crash must happen above
	pci_fixup_device(pci_fixup_resume_early, pci_dev);
	pci_pm_default_resume(pci_dev);

	if (prev_state == PCI_D3cold)
		pci_pm_bridge_power_up_actions(pci_dev);

	if (pm && pm->runtime_resume)
		error = pm->runtime_resume(dev);

	return error;
}

Bert Karwatzki