Commit a153e5e1 authored by Krzysztof Wilczyński's avatar Krzysztof Wilczyński Committed by Bjorn Helgaas
Browse files

PCI: Add schedule point in proc_bus_pci_read()

PCI configuration space reads from /proc/bus/pci can often take several
milliseconds to complete.

Add a schedule point in proc_bus_pci_read() to reduce the maximum latency.

A similar change was made for sysfs by 2ce02a86 ("PCI: Add schedule
point in pci_read_config()").

Link: https://lore.kernel.org/r/20200824052025.48362-1-benbjiang@tencent.com
Link: https://lore.kernel.org/r/20210815150824.96773-1-kw@linux.com


Signed-off-by: default avatarKrzysztof Wilczyński <kw@linux.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 1901f8c9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@ static ssize_t proc_bus_pci_read(struct file *file, char __user *buf,
		buf += 4;
		pos += 4;
		cnt -= 4;
		cond_resched();
	}

	if (cnt >= 2) {