public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* post 2.6.28 regression: device_initialize() now sleeps, and may fail without recovery strategy
@ 2009-01-09 18:35 Stefan Richter
  2009-01-09 19:49 ` [PATCH post 2.6.28] firewire: core: fix sleep in atomic context due to driver core change Stefan Richter
  2009-01-09 20:56 ` post 2.6.28 regression: device_initialize() now sleeps, and may fail without recovery strategy Greg KH
  0 siblings, 2 replies; 12+ messages in thread
From: Stefan Richter @ 2009-01-09 18:35 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Kay Sievers, linux-kernel, Jay Fenlason

>From commit 2831fe6f9cc4e16c103504ee09a47a084297c0f3, "driver core:
create a private portion of struct device":

 void device_initialize(struct device *dev)
 {
+	dev->p = kzalloc(sizeof(*dev->p), GFP_KERNEL);
+	if (!dev->p) {
+		WARN_ON(1);
+		return;
+	}
+	dev->p->device = dev;
 	dev->kobj.kset = devices_kset;
 	kobject_init(&dev->kobj, &device_ktype);


First of all, this prevents initialization of struct device in atomic
contexts, such as drivers/firewire/fw-device.c::fw_node_event.

This is a bug in current mainline.

We can fix the bug by changing firewire-core, but
  a) it'd be more than a one-liner,
  b) who knows which other subsystems are affected.

Next, the above code is bogus.  In 2.6.28, device_initialize() could
never fail and was thus safe to use as a void-valued function.

How does driver core handle dev->p == NULL in subsequent usages of dev now?
-- 
Stefan Richter
-=====-==--= ---= -=--=
http://arcgraph.de/sr/

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2009-01-09 22:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-09 18:35 post 2.6.28 regression: device_initialize() now sleeps, and may fail without recovery strategy Stefan Richter
2009-01-09 19:49 ` [PATCH post 2.6.28] firewire: core: fix sleep in atomic context due to driver core change Stefan Richter
2009-01-09 21:17   ` Alan Cox
2009-01-09 21:54     ` Greg KH
2009-01-09 22:28       ` [git pull] FireWire fix Stefan Richter
2009-01-09 20:56 ` post 2.6.28 regression: device_initialize() now sleeps, and may fail without recovery strategy Greg KH
2009-01-09 21:13   ` Stefan Richter
2009-01-09 21:20     ` Stefan Richter
2009-01-09 21:34       ` Greg KH
2009-01-09 21:30     ` Greg KH
2009-01-09 21:40       ` Stefan Richter
2009-01-09 21:24   ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox