lkml.org 
[lkml]   [2022]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[RFC PATCH 2/3] PCI: Skip reassigning bridge resources if reducing BAR size
From
Date
More work is probably necessary here, pci_reassign_bridge_resources()
has heavy weight requirements that the aperture windows are unused,
without even testing if the requested resize is possible in the
existing aperture. One case we can clearly skip is when reducing the
size of a BAR.

Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
drivers/pci/setup-res.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index 439ac5f5907a..7a8e1e4f4d33 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -450,7 +450,7 @@ int pci_resize_resource(struct pci_dev *dev, int resno, int size)
res->end = res->start + pci_rebar_size_to_bytes(size) - 1;

/* Check if the new config works by trying to assign everything. */
- if (dev->bus->self) {
+ if (size > old && dev->bus->self) {
ret = pci_reassign_bridge_resources(dev->bus->self, res->flags);
if (ret)
goto error_resize;

\
 
 \ /
  Last update: 2022-08-16 21:41    [W:0.159 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site