[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.1.10.0804221350110.2779@woody.linux-foundation.org>
Date:	Tue, 22 Apr 2008 13:58:43 -0700 (PDT)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	"Rafael J. Wysocki" <rjw@...k.pl>, Greg KH <greg@...ah.com>
cc:	Zdenek Kabelac <zdenek.kabelac@...il.com>,
	Ingo Molnar <mingo@...e.hu>, Jiri Slaby <jirislaby@...il.com>,
	paulmck@...ux.vnet.ibm.com, David Miller <davem@...emloft.net>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	herbert@...dor.apana.org.au,
	Alan Stern <stern@...land.harvard.edu>,
	pm list <linux-pm@...ts.linux-foundation.org>
Subject: Re: device_pm_add (was: Re: 2.6.25-git2: BUG: unable to handle kernel
 paging request at ffffffffffffffff)
On Tue, 22 Apr 2008, Rafael J. Wysocki wrote:
> 
> There is a bug in device_add() that IMO can be fixed this way:
Ok, looks fine. Greg?
> Index: linux-2.6/drivers/base/core.c
> ===================================================================
> --- linux-2.6.orig/drivers/base/core.c
> +++ linux-2.6/drivers/base/core.c
> @@ -820,11 +820,11 @@ int device_add(struct device *dev)
>  	error = bus_add_device(dev);
>  	if (error)
>  		goto BusError;
> +	bus_attach_device(dev);
>  	error = device_pm_add(dev);
>  	if (error)
>  		goto PMError;
>  	kobject_uevent(&dev->kobj, KOBJ_ADD);
> -	bus_attach_device(dev);
>  	if (parent)
>  		klist_add_tail(&dev->knode_parent, &parent->klist_children);
>  
> The problem is that bus_remove_device() assumes bus_attach_device() to have
> run, AFAICS.
As to the other issue:
> > So I would suggest reverting that commit, or at least just making it a 
> > warning (while still registering the device).
> 
> Are drivers supposed to register children of suspended devices?  That doesn't
> make much sense IMO ...
Well, that's why I think the warning itself makes sense - and then we can 
decide whether it makes sense for that particular case or not. Clearly it 
happens (since it triggered), now we need to figure out _why_ it happened. 
But I don't think debugging messages should change behaviour.
		Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Powered by blists - more mailing lists
 
