mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Dmitry Torokhov" <dmitry.torokhov@gmail.com>
To: "Akinobu Mita" <akinobu.mita@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] input: make serio_register_driver() return error code
Date: Tue, 7 Nov 2006 09:20:07 -0500	[thread overview]
Message-ID: <d120d5000611070620l5a0731d8jd5778bc8c8b49b2b@mail.gmail.com> (raw)
In-Reply-To: <20061107120605.GA13896@localhost>

On 11/7/06, Akinobu Mita <akinobu.mita@gmail.com> wrote:
> serio_register_driver() may fail under memory shortage.
>
> When serio_register_driver() called, it queues SERIO_REGISTER_DRIVER
> event into global serio_event_list, and then kseriod kernel thread
> handles that event and do driver_register().
>
> But event allocation by serio_register_driver() may fail.
> Because it is GFP_ATOMIC allocation. It will cause the problem
> by serio_unregister_driver() with not being registered driver
> at module_exit() time
>
> 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
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.

-- 
Dmitry

  reply	other threads:[~2006-11-07 14:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-07 12:06 Akinobu Mita
2006-11-07 14:20 ` Dmitry Torokhov [this message]
2006-11-08 12:36   ` Akinobu Mita
2006-11-08 12:38     ` [PATCH 1/4] input: make serio_register_driver() return error Akinobu Mita
2006-11-08 12:39     ` [PATCH 2/4] input: check serio_register_driver() error Akinobu Mita
2006-11-08 12:40     ` [PATCH 3/4] input: check whether serio dirver registration is completed Akinobu Mita
2006-11-11 16:12       ` Alexey Dobriyan
2006-11-08 12:41     ` [PATCH 4/4] input: change to GFP_KERNEL for SERIO_REGISTER_DRIVER event allocation Akinobu Mita
2006-11-17  6:37     ` [PATCH 1/2] input: make serio_register_driver() return error code Dmitry Torokhov
2006-11-18  6:51       ` Akinobu Mita

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d120d5000611070620l5a0731d8jd5778bc8c8b49b2b@mail.gmail.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=akinobu.mita@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®