Re: [PATCH 1/2] input: make serio_register_driver() return error code

From: Akinobu Mita
Date: Wed Nov 08 2006 - 07:36:58 EST


On Tue, Nov 07, 2006 at 09:20:07AM -0500, Dmitry Torokhov wrote:
> >This patch makes serio_register_driver() call driver_register()
> >directly instead of kseriod so that it can check whether
> >driver_register() is succeeded or not.
> >
>
> This slows down boot process because probing for mice and keyboards
> takes too long (for some touchpads it takes about 4 seconds to do

I understand the reason why driver_register() is done by kseriod.

> reset). We could change allocation from GFP_ATOMIC to GFP_KERNEL for
> SERIO_REGISTER_DRIVER events to make it more robust but otherwise I'd
> leave serio_register_driver return void. You could also add a flag to
> serio driver indicating whether registration is complete and check
> that flag in serio_unregister_driver so it does not do stupid things.

I reorganzed the patch set.

serio driver registration can fail in two different ways.

1) serio_event allocation failure by serio_register_driver().

It happens in module_init() context. It is possible to check this
allocation failure by making serio_register_driver() return error.

2) driver_register() failure by kseriod.

This failure cannot be checked by serio_register_driver().
But it is necessary to prevent serio_unregister_driver() from
trying to call driver_unregister() with not registered driver
by adding flag to serio driver indicating whether registration is
complete.

1/4: make serio_register_driver() return error -- 1)
2/4: check serio_register_driver() error -- 1)
3/4: check whether serio dirver registration is completed -- 2)
4/4: change to GFP_KERNEL for SERIO_REGISTER_DRIVER event allocation

-
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/