diff options
author | Krzysztof Wilczyński <kw@linux.com> | 2021-08-15 15:08:24 +0000 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2021-08-20 16:20:30 -0500 |
commit | a153e5e117ff562546ad3914045f2b5e1c302f88 (patch) | |
tree | 1a62919c1bda297744ca8fd72b965c8209a821d4 /drivers/pci/proc.c | |
parent | 1901f8c9ca802a80f31729f5cc21bfb55150c6f1 (diff) |
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 2ce02a864ac1 ("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: Krzysztof Wilczyński <kw@linux.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/proc.c')
-rw-r--r-- | drivers/pci/proc.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c index 9bab07302bbf..535076eff5f6 100644 --- a/drivers/pci/proc.c +++ b/drivers/pci/proc.c @@ -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) { |