linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: w.sang@pengutronix.de
Cc: linux-ide@vger.kernel.org, bzolnier@gmail.com
Subject: Re: WARNINGs because of ide-proc handling
Date: Mon, 13 Sep 2010 21:17:56 -0700 (PDT)	[thread overview]
Message-ID: <20100913.211756.191403182.davem@davemloft.net> (raw)
In-Reply-To: <20100903185934.GA27291@pengutronix.de>

From: Wolfram Sang <w.sang@pengutronix.de>
Date: Fri, 3 Sep 2010 20:59:34 +0200

> Checking my debug-output again, I assume that the hard-disk has the entries,
> because it is the first user of ide-gd, so that driver still needs to be
> requested. Maybe this is enough delay for the directories to appear? Wild
> guess...

The issue has to do with the order of module initialization.

I've never seen this since on machines where IDE is actually used I
tend to build everything statically into the tree.

In such a configuration, the ide-cd, ide-gd, etc. drivers come at the
end of the link, based upon the ordering listed in the file
drivers/ide/Makefile.

Therefore, their probe functions are invoked last, long after core IDE
and the individual IDE host controller drivers register.

The individual IDE host controller probes will therefore happen first.

As we discussed, things work if ide_proc_port_register_devices()
executes before ide_proc_register_driver() is called.

And this is satisfied by the "all of IDE built-in" configuration
because the event sequence is:

1) IDE host controller driver registers, probes and finds ideX
2) ide_host_register(ideX, ...)
3) ide_proc_port_register_devices(ideX)

... some time passes ...

4) ide-gd driver registers
5) generic_ide_probe(hdX)
6) ide_gd_probe()
7) disk_ops->setup()
8) ide_disk_setup()
9) ide_proc_register_driver(hdX)

etc.

At ide_host_register() time, hwif_register_devices() created all of
the IDE devices on the ide_bus_type bus, but since ide-gd et al.  were
not registered yet, these device instances don't get matched and
probed at hwif_register_devices() time.

However, if the various IDE core driver bits are modules and are
loaded already, then the ide-cs driver subsequently loads, or an
ide-cs device hot plugs, then we get into the situation you've
discovered where we invoke the PROCFS init functions in the wrong
order.

Anyways, I just wanted to let you know that I figured out why it does
work in some circumstances, and I will now go back and do a final
audit of your patch before applying it.

Thanks.

      reply	other threads:[~2010-09-14  4:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-31 20:56 WARNINGs because of ide-proc handling Wolfram Sang
2010-09-02  2:33 ` David Miller
2010-09-02 21:28   ` Wolfram Sang
2010-09-02 22:14     ` David Miller
2010-09-03  5:53       ` Wolfram Sang
2010-09-03 12:34         ` David Miller
2010-09-03 14:21           ` Bartlomiej Zolnierkiewicz
2010-09-03 14:35           ` David Miller
2010-09-03 14:47             ` Wolfram Sang
2010-09-03 18:59             ` Wolfram Sang
2010-09-14  4:17               ` David Miller [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=20100913.211756.191403182.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=bzolnier@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=w.sang@pengutronix.de \
    /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).