Re: PCI BAR mem resource allocation "regression"

From: Jesse Barnes
Date: Mon Dec 15 2008 - 19:54:21 EST


On Monday, December 15, 2008 4:25 pm Linus Torvalds wrote:
> On Mon, 15 Dec 2008, Jesse Barnes wrote:
> > I can put your patch in my -next branch if you think it would help (not
> > that - next gets a ton of testing, but hey)...
>
> Better than nothing, I guess.
>
> We may end up back-porting it (since Chen confirms that it's not just a
> warning, it actually affects functionality), but let's get it some testing
> in -next first and then eventually in the merge window. So you might mark
> it for attention for 'stable@xxxxxxxxxx' as you commit it.

I pushed it to my -next branch, though I forgot to add the stable@ cc and fix
up the comments while I was there... I think I'll have to rebase anyway, so
I'll take care of both of those when I do.

Thanks,
--
Jesse Barnes, Intel Open Source Technology Center

commit d4e9908a08199fe4d728c68cc7c5ca2d827ae99f
Author: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Date: Sat Dec 13 17:37:57 2008 -0800

resource: revert parent nesting of identical ranges

Revert the change that causes inverted resource nesting in the case of
identical resource ranges. Initially introduced by
d33b6fba2c4350651f3f61ff2ab858a2f116e9a4, this change was provided
without a justification and seems to cause problems on some machines in
the face of PCI hot plugging.

The patch makes resources registered against an existing but identical
range nest as children of the existing resource, rather than parents.

Reported-by: Alex Chiang <achiang@xxxxxx>
Tested-by: Alex Chiang <achiang@xxxxxx>
Tested-by: Justin Chen <justin.chen@xxxxxx>
Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx>

diff --git a/kernel/resource.c b/kernel/resource.c
index c251b0f..741357f 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -381,8 +381,6 @@ static struct resource * __insert_resource(struct resource
*parent, struct resou

if ((first->start > new->start) || (first->end < new->end))
break;
- if ((first->start == new->start) && (first->end == new->end))
- break;
}

for (next = first; ; next = next->sibling) {

¢éì¹»®&Þ~º&¶¬?+-±éݶ¥?w®?Ë?±Êâméb?ìdz¹Þ?)í?æèw*jg¬±¨¶????Ý¢j/?êäz¹Þ??à2?Þ?¨è­Ú&¢)ß¡«a¶Úþø®G«?éh®æj:+v?¨?wè?Ù¥>W?±êÞiÛaxPjØm¶?ÿà -»+?ùd?_