public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Toralf Förster" <toralf.foerster@gmx.de>
To: Vivek Goyal <vgoyal@redhat.com>, Richard Weinberger <richard@nod.at>
Cc: "akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	user-mode-linux-devel
	<user-mode-linux-devel@lists.sourceforge.net>,
	sahne@0x90.at
Subject: Re: [uml-devel] "resource: provide new functions to walk through resources" breaks UML
Date: Mon, 11 Aug 2014 21:25:08 +0200	[thread overview]
Message-ID: <53E91894.3060501@gmx.de> (raw)
In-Reply-To: <20140811184401.GE1863@redhat.com>

On 08/11/2014 08:44 PM, Vivek Goyal wrote:
> 
> Hi Richard,
> 
> Can you please give the attached patch a try and see if it fixes the UML
> issue.
> 
> I noticed that previous code had a for() loop which will not execute
> if p was null. I have resorted back to same code now. 
> 
> Thanks
> Vivek
> 
> 
> ---
>  kernel/resource.c |   11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> Index: linux-2.6/kernel/resource.c
> ===================================================================
> --- linux-2.6.orig/kernel/resource.c	2014-08-11 13:36:19.942423192 -0400
> +++ linux-2.6/kernel/resource.c	2014-08-11 13:50:20.529387653 -0400
> @@ -351,15 +351,12 @@ static int find_next_iomem_res(struct re
>  	end = res->end;
>  	BUG_ON(start >= end);
>  
> -	read_lock(&resource_lock);
> -
> -	if (first_level_children_only) {
> -		p = iomem_resource.child;
> +	if (first_level_children_only)
>  		sibling_only = true;
> -	} else
> -		p = &iomem_resource;
>  
> -	while ((p = next_resource(p, sibling_only))) {
> +	read_lock(&resource_lock);
> +
> +	for (p = iomem_resource.child; p; p = next_resource(p, sibling_only)) {
>  		if (p->flags != res->flags)
>  			continue;
>  		if (name && strcmp(p->name, name))
> 
At least at my system (32 bit x86) the patch seems to work (applied on top of v3.16-10473-gc8d6637)

-- 
Toralf


  parent reply	other threads:[~2014-08-11 19:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-10 16:56 "resource: provide new functions to walk through resources" breaks UML Richard Weinberger
2014-08-11 12:22 ` Vivek Goyal
2014-08-11 12:25   ` Richard Weinberger
2014-08-11 18:44     ` Vivek Goyal
2014-08-11 19:18       ` Richard Weinberger
2014-08-11 19:25       ` Toralf Förster [this message]
2014-08-11 19:48       ` Daniel Walter

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=53E91894.3060501@gmx.de \
    --to=toralf.foerster@gmx.de \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard@nod.at \
    --cc=sahne@0x90.at \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    --cc=vgoyal@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox