From patchwork Wed Jun 17 01:04:51 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Torvalds X-Patchwork-Id: 30752 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5H154BX025038 for ; Wed, 17 Jun 2009 01:05:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758582AbZFQBE7 (ORCPT ); Tue, 16 Jun 2009 21:04:59 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758431AbZFQBE7 (ORCPT ); Tue, 16 Jun 2009 21:04:59 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:52761 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751143AbZFQBE7 (ORCPT ); Tue, 16 Jun 2009 21:04:59 -0400 Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [140.211.169.55]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id n5H14qQe018305 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 16 Jun 2009 18:04:53 -0700 Received: from localhost (localhost [127.0.0.1]) by imap1.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with ESMTP id n5H14pr7005534; Tue, 16 Jun 2009 18:04:52 -0700 Date: Tue, 16 Jun 2009 18:04:51 -0700 (PDT) From: Linus Torvalds X-X-Sender: torvalds@localhost.localdomain To: Andrew Patterson cc: linux-pci@vger.kernel.org, Linux Kernel Mailing List , jbarnes@virtuousgeek.org, Ivan Kokshaysky Subject: Re: [PATCH 0/1] Recurse when searching for empty slots in resources trees In-Reply-To: Message-ID: References: <20090616220419.14021.84524.stgit@bob.kio> <1245192703.8234.226.camel@bluto.andrew> <1245195498.8234.236.camel@bluto.andrew> User-Agent: Alpine 2.01 (LFD 1184 2008-12-16) MIME-Version: 1.0 X-Spam-Status: No, hits=-3.971 required=5 tests=AWL, BAYES_00, OSDL_HEADER_SUBJECT_BRACKETED X-Spam-Checker-Version: SpamAssassin 3.2.4-osdl_revision__1.47__ X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Tue, 16 Jun 2009, Linus Torvalds wrote: > > Can you try this patch? Oops. As Jesse pointed out, there was no patch. _This_ time. Linus --- kernel/resource.c | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/kernel/resource.c b/kernel/resource.c index ac5f3a3..d9d7ede 100644 --- a/kernel/resource.c +++ b/kernel/resource.c @@ -140,6 +140,13 @@ __initcall(ioresources_init); #endif /* CONFIG_PROC_FS */ +#define set_parent(x,p) __set_parent(__FUNCTION__, x, p) +static void __set_parent(const char *fn, struct resource *x, struct resource *parent) +{ + WARN("%s: parent of '%s' is '%s'\n", fn, x->name, parent ? parent->name : "none"); + x->parent = parent; +} + /* Return the conflict entry if you can't request it */ static struct resource * __request_resource(struct resource *root, struct resource *new) { @@ -159,7 +166,7 @@ static struct resource * __request_resource(struct resource *root, struct resour if (!tmp || tmp->start > end) { new->sibling = tmp; *p = new; - new->parent = root; + set_parent(new, root); return NULL; } p = &tmp->sibling; @@ -395,13 +402,13 @@ static struct resource * __insert_resource(struct resource *parent, struct resou break; } - new->parent = parent; + set_parent(new, parent); new->sibling = next->sibling; new->child = first; next->sibling = NULL; for (next = first; next; next = next->sibling) - next->parent = new; + set_parent(next, new); if (parent->child == first) { parent->child = new;