Re: [PATCH] pci: Don't call resume callback for nearly bound devices
From: Bjorn Helgaas <helgaas@kernel.org>
Date: 2021-11-10 17:59:36
Also in:
linux-i2c, linux-pci, lkml
On Wed, Nov 10, 2021 at 05:48:52PM +0100, Rafael J. Wysocki wrote:
On Wed, Nov 10, 2021 at 5:33 PM Robert Święcki [off-list ref] wrote:quoted
śr., 10 lis 2021 o 15:14 Bjorn Helgaas [off-list ref] napisał(a):quoted
On Tue, Nov 09, 2021 at 02:05:18PM -0600, Bjorn Helgaas wrote:quoted
On Tue, Nov 09, 2021 at 07:58:47PM +0100, Rafael J. Wysocki wrote:quoted
On Tue, Nov 9, 2021 at 7:52 PM Rafael J. Wysocki [off-list ref] wrote:quoted
...quoted
quoted
quoted
So instead, we can drop the pm_runtime_get_sync() and pm_runtime_put_sync() from local_pci_probe() and pci_device_remove(), respectively, and add pm_runtine_get_noresume() to pci_pm_init(), which will prevent PM-runtime from touching the device until it has a driver that supports PM-runtime. We'll lose the theoretical ability to put unbound devices into D3 this way, but we learned some time ago that this isn't safe in all cases anyway.IOW, something like this (untested and most likely white-space-damaged).Thanks! I applied this manually to for-linus in hopes of making the the next linux-next build. Please send any testing reports and corrections to the patch and commit log!Robert, I hate to ask even more of you, but if you have a chance, it would be very helpful if you could test the patch below. I'm pretty sure it should fix the problem you saw, and I hope to ask Linus to merge it today.I think the most recent patch creates some timeouts and other problems in pci-related code? Things I haven't seen before.So I honestly think that commit 2a4d9408c9e8 needs to be reverted, because it clearly does more than it is supposed to and we need to go back to the drawing board and do this again, but correctly.
Yep, I agree, I'll work on that today. Bjorn