linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Magnus Damm <magnus.damm@gmail.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: dmitry.torokhov@gmail.com, srk@ti.com, khilman@ti.com,
	chinyeow.sim.xt@renesas.com, linux-sh@vger.kernel.org,
	tony@atomide.com, nsekhar@ti.com, linux-i2c@vger.kernel.org,
	linux-input@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] Input: tca6416-keypad: Change to module_init()
Date: Wed, 23 Mar 2011 00:16:04 +0900	[thread overview]
Message-ID: <AANLkTimBkGCxzV8czXimkc5X_+SX8qRUrUiJRiS_UeV1@mail.gmail.com> (raw)
In-Reply-To: <20110322142855.GB2202@sirena.org.uk>

On Tue, Mar 22, 2011 at 11:28 PM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> On Tue, Mar 22, 2011 at 11:26:19PM +0900, Magnus Damm wrote:
>
>> The tca6416 driver makes use of the I2C bus for chatting
>> with the actual hardware device. Without this patch both
>> the I2C bus driver and the tca6416 driver are initialized
>> at the subsys_initcall() level. This may lead to problems
>> with the tca6416 driver being initialized before the I2C
>> bus driver.
>
> While this change seems reasonable I'm curious what the problems caused
> by out of order registration are?

The boot up time is delayed with 5 seconds or so due to a delay that
only happens if subsys_initcall() level is used for both tca6416 and
the I2C driver. By disabling the tca6416 driver in the kernel
configuration the delay goes away. I have not tracked it down further
than using module_init() instead of subsys_initcall() in the tca6416
driver. This because tca6416-keypad.c is the only keyboard driver that
uses subsys_initcall().

If I enable initcall_debug then I get this output:

calling  input_init+0x0/0x114 @ 1
initcall input_init+0x0/0x114 returned 0 after 0 usecs
calling  tca6416_keypad_init+0x0/0x10 @ 1
initcall tca6416_keypad_init+0x0/0x10 returned 0 after 0 usecs
calling  sh_mobile_i2c_adap_init+0x0/0xc @ 1
i2c-sh_mobile i2c-sh_mobile.0: clocks managed by runtime pm
input: tca6408-keys as
/devices/platform/i2c-sh_mobile.0/i2c-0/0-0020/input/input0
[delay]

If my interpretation of the log above is correct then
tca6416_keypad_init() is executed before sh_mobile_i2c_adap_init().

As for link order, i2c is located after input in driver/Makefile. I
believe that matches well with the log above.

Thanks,

/ magnus

      parent reply	other threads:[~2011-03-22 15:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-22 14:26 [PATCH] Input: tca6416-keypad: Change to module_init() Magnus Damm
2011-03-22 14:28 ` Mark Brown
2011-03-22 14:33   ` Paul Mundt
2011-03-22 15:22     ` Magnus Damm
2011-03-22 15:32       ` Paul Mundt
2011-03-22 15:43         ` Magnus Damm
     [not found]           ` <AANLkTimyxdcJ-eEke9x7X1zdiJNbFtncfv0=NzKjtAme-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-03-22 15:57             ` Paul Mundt
2011-03-22 16:20               ` Magnus Damm
2011-03-22 16:31                 ` Mark Brown
     [not found]                   ` <20110322163144.GC2202-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2011-03-22 16:51                     ` Magnus Damm
2011-03-22 16:59                       ` Mark Brown
     [not found]                         ` <20110322165907.GG22583-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2011-03-23 16:04                           ` Magnus Damm
2011-03-23 16:20                             ` Mark Brown
     [not found]                               ` <20110323162021.GA26594-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2011-03-24  3:38                                 ` Magnus Damm
2011-03-24  7:57                                   ` Dmitry Torokhov
2011-03-29  7:11                             ` Magnus Damm
2011-03-22 15:16   ` Magnus Damm [this message]

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=AANLkTimBkGCxzV8czXimkc5X_+SX8qRUrUiJRiS_UeV1@mail.gmail.com \
    --to=magnus.damm@gmail.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=chinyeow.sim.xt@renesas.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=khilman@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=nsekhar@ti.com \
    --cc=srk@ti.com \
    --cc=tony@atomide.com \
    /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;
as well as URLs for NNTP newsgroup(s).