Re: [PATCH] virtio-mmio: Devices parameter parsing

From: Rusty Russell
Date: Mon Nov 21 2011 - 20:00:06 EST


On Mon, 21 Nov 2011 17:56:50 +0000, Pawel Moll <pawel.moll@xxxxxxx> wrote:
> On Mon, 2011-11-21 at 14:44 +0000, Pawel Moll wrote:
> > I'll post v3 tonight or tomorrow.
>
> Ok, it won't be v3 then...
>
> I tried again, using your suggestions - see below (just the crucial bit,
> however I have the kernel-parameters.txt bits ready as well). Parsing
> works like charm, however when it gets to device_register() and
> platform_device_register_resndata() I hit the same problem as
> previously. Both are using slab allocator...
>
> device_register()->device_add()->device_private_init()->kzalloc()
>
> and
>
> platform_device_register_resndata()->platform_device_register_full()->
> platform_device_alloc()->kzalloc().
>
> Essentially it seems that the parameter callbacks are just executed
> waaay to early to do more than just set few integers here and there...
>
> Any ideas?

Rewrite the kernel and every arch so allocators work as soon as we hit
start_kernel() and we can get rid of hundreds of ugly workarounds?

Perhaps not today. So, we will need a linked list of devices and
resources. Yeah, that means allocating, which means YA
slab_is_available()/alloc_bootmem() hack.

Think of yourself as a pioneer...

Thanks :)
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/