lkml.org 
[lkml]   [2009]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: post 2.6.28 regression: device_initialize() now sleeps, and may fail without recovery strategy
Greg KH wrote:
> On Fri, Jan 09, 2009 at 10:13:55PM +0100, Stefan Richter wrote:
>> get_device() and put_device() seem to be about the only things that are
>> interesting before device_add().
...
> Hm, that could be pretty simple to handle. I'd really like to force the
> kobject itself to be dynamic, and inside the private portion of the
> device structure. If I do that, then get_ and put_ would need to
> allocate the object if it wasn't present. But that would mean that
> get_device could sleep, which isn't the case today

That could be a problem.

> (put_device() can always sleep, that's not an issue.)

Hmm, I wasn't aware of that, need to check my code...

...
>> Well, at least code which allocates struct device can check for failure
>> and handle it, while the allocator of dev->p can't even check. Unless
>> you change device_initialize() to return error status and add error
>> handling all over the place...
>
> yeah, that would be a much bigger task than I'm really pondering,
> although it probably is the correct thing to do...

If you inline struct device_private into struct device, then the problem
is gone. But then it's a little less private then you wanted it to be
of course.
--
Stefan Richter
-=====-==--= ---= -=--=
http://arcgraph.de/sr/


\
 
 \ /
  Last update: 2009-01-09 22:43    [W:0.044 / U:1.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site