From: Bjorn Helgaas <bhelgaas@google.com>
To: Wei Yang <weiyang@linux.vnet.ibm.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH] PCI: break when finding the first smaller resource
Date: Wed, 27 May 2015 11:58:38 -0500 [thread overview]
Message-ID: <20150527165838.GW32152@google.com> (raw)
In-Reply-To: <1432016657-16816-1-git-send-email-weiyang@linux.vnet.ibm.com>
On Tue, May 19, 2015 at 02:24:17PM +0800, Wei Yang wrote:
> In commit d74b9027a4da(PCI: Consider additional PF's IOV BAR alignment in
> sizing and assigning), it stores additional alignment in realloc_head and
> take this into consideration for assignment.
>
> After getting the additional alignment, it will re-order the head list to
> make sure resources with bigger alignment is ahead of the resources with
> smaller assignment in the head list. To make it happen, it iterate on the
> head list and find a smaller alignment resource and insert ahead of it.
> This should be done for the first occurrence, while the code now will
> iterate on the whole list.
>
> This patch fixes this behavior by break when finding the first smaller
> resource in the head list.
>
> Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
Applied to for-linus for v4.1, thanks.
> ---
> drivers/pci/setup-bus.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
> index 4fd0cac..aa281d9 100644
> --- a/drivers/pci/setup-bus.c
> +++ b/drivers/pci/setup-bus.c
> @@ -435,9 +435,11 @@ static void __assign_resources_sorted(struct list_head *head,
> list_for_each_entry(dev_res2, head, list) {
> align = pci_resource_alignment(dev_res2->dev,
> dev_res2->res);
> - if (add_align > align)
> + if (add_align > align) {
> list_move_tail(&dev_res->list,
> &dev_res2->list);
> + break;
> + }
> }
> }
>
> --
> 1.7.9.5
>
next prev parent reply other threads:[~2015-05-27 16:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-19 6:24 [PATCH] PCI: break when finding the first smaller resource Wei Yang
2015-05-27 16:58 ` Bjorn Helgaas [this message]
2015-06-05 19:36 ` Bjorn Helgaas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150527165838.GW32152@google.com \
--to=bhelgaas@google.com \
--cc=linux-pci@vger.kernel.org \
--cc=weiyang@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.