From: Yinghai Lu <yhlu.kernel@gmail.com>
To: Linus Torvalds <torvalds@linux-foundation.org>, jbarnes@virtuousgeek.org
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] resources: when allocate_resource() fails, leave resource untouched
Date: Wed, 4 Nov 2009 10:49:13 -0800 [thread overview]
Message-ID: <86802c440911041049g592770dqc69b0ce34ea04a10@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.2.01.0911041025350.31845@localhost.localdomain>
On Wed, Nov 4, 2009 at 10:29 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
>
> On Wed, 4 Nov 2009, Jesse Barnes wrote:
>>
>> Seems like a reasonable change to me. Linus is usually the gatekeeper
>> for resource.c.
>
> I'm certainly ok with this one. I wouldn't be surprised if it even allows
> for better code generation, apart from leaving resources untouched when
> allocation fails. So:
>
> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
>
> It was apparently sent to Andrew, but I can certainly take it. Or you can
> take it into the PCI tree. Or we can leave it in -mm. Anything goes. Just
> tell me.
>
looks should be put into pci tree.
two of patches that is releasing not big enough range from leaf bridge
could be user.
don't need the "save and restore" trick anymore.
YH
@@ -57,10 +100,23 @@ static void pbus_assign_resources_sorted
for (list = head.next; list;) {
res = list->res;
idx = res - &list->dev->resource[0];
+ /* save the size at first */
+ size = resource_size(res);
if (pci_assign_resource(list->dev, idx)) {
- res->start = 0;
- res->end = 0;
- res->flags = 0;
+ if (fail_head && !list->dev->subordinate &&
+ !pci_is_root_bus(list->dev->bus)) {
+ /*
+ * device need to keep flags and size
+ * for second try
+ */
+ res->start = 0;
+ res->end = size - 1;
+ add_to_failed_list(fail_head, list->dev, res);
+ } else {
+ res->start = 0;
+ res->end = 0;
+ res->flags = 0;
+ }
}
tmp = list;
list = list->next;
next prev parent reply other threads:[~2009-11-04 18:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-02 17:45 Bjorn Helgaas
2009-11-04 18:20 ` Jesse Barnes
2009-11-04 18:29 ` Linus Torvalds
2009-11-04 18:49 ` Yinghai Lu [this message]
2009-11-04 18:51 ` Jesse Barnes
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=86802c440911041049g592770dqc69b0ce34ea04a10@mail.gmail.com \
--to=yhlu.kernel@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=bjorn.helgaas@hp.com \
--cc=jbarnes@virtuousgeek.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®