Re: [PATCH 2/4] PCI: add functionality for resizing resources v3

2017-05-04 Thread Andy Shevchenko
On Thu, May 4, 2017 at 1:15 PM, Andy Shevchenko wrote: > On Thu, May 4, 2017 at 12:23 PM, Christian König > wrote: >> Am 26.04.2017 um 19:00 schrieb Andy Shevchenko: > static int ...xxx...(...) > { > unsigned int i; > int ret; > > if (res->parent) > release_resource(res)

Re: [PATCH 2/4] PCI: add functionality for resizing resources v3

2017-05-04 Thread Andy Shevchenko
On Thu, May 4, 2017 at 12:23 PM, Christian König wrote: > Am 26.04.2017 um 19:00 schrieb Andy Shevchenko: >>> + while (1) { >> >> This raises red flag. Care to refactor? >> Also do {} while () syntax allows faster to get that the loop body >> goes at least once. > > > I've tried to refactor

Re: [PATCH 2/4] PCI: add functionality for resizing resources v3

2017-05-04 Thread Christian König
Am 26.04.2017 um 19:00 schrieb Andy Shevchenko: [SNIP] + while (1) { This raises red flag. Care to refactor? Also do {} while () syntax allows faster to get that the loop body goes at least once. I've tried to refactor this, but couldn't come up with something which works and is readab

Re: [PATCH 2/4] PCI: add functionality for resizing resources v3

2017-05-02 Thread Andy Shevchenko
On Tue, May 2, 2017 at 6:51 PM, Christian König wrote: > Am 26.04.2017 um 19:00 schrieb Andy Shevchenko: >> On Tue, Apr 25, 2017 at 4:19 PM, Christian König >> wrote: >>> +int pci_reassign_bridge_resources(struct pci_dev *bridge, unsigned long >>> type) >>> +{ >>> + const unsigned long typ

Re: [PATCH 2/4] PCI: add functionality for resizing resources v3

2017-05-02 Thread Christian König
Am 26.04.2017 um 19:00 schrieb Andy Shevchenko: On Tue, Apr 25, 2017 at 4:19 PM, Christian König wrote: From: Christian König This allows device drivers to request resizing their BARs. The function only tries to reprogram the windows of the bridge directly above the requesting device and onl

Re: [PATCH 2/4] PCI: add functionality for resizing resources v3

2017-04-26 Thread Andy Shevchenko
On Tue, Apr 25, 2017 at 4:19 PM, Christian König wrote: > From: Christian König > > This allows device drivers to request resizing their BARs. > > The function only tries to reprogram the windows of the bridge directly above > the requesting device and only the BAR of the same type (usually mem,

[PATCH 2/4] PCI: add functionality for resizing resources v3

2017-04-25 Thread Christian König
From: Christian König This allows device drivers to request resizing their BARs. The function only tries to reprogram the windows of the bridge directly above the requesting device and only the BAR of the same type (usually mem, 64bit, prefetchable). This is done to make sure not to disturb othe