From: grant.likely@secretlab.ca (Grant Likely)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] tty: serial: remove __init on pl011 console ops
Date: Wed, 13 Feb 2013 21:21:08 +0000 [thread overview]
Message-ID: <20130213212109.099AE3E3557@localhost> (raw)
In-Reply-To: <CAD6h2NQbpH4KrDA7_-WYx+gzrA60fRHCk8D=-Je2fsEC-+z79Q@mail.gmail.com>
On Sun, 10 Feb 2013 11:31:53 +0800, Haojian Zhuang <haojian.zhuang@linaro.org> wrote:
> I agree on Russell. And console isn't the only one device.
> In kernel_init_freeable(), we can find that we have an
> assumption that all initial calls are already finished, and
> we need to discard them & start the user-mode stuff.
> But at that time, deferred probe may still not run since
> they're in another kernel thread. It's very dangerous that
> user mode stuff start running but device driver isn't ready
> yet.
Linux has been moving in that direction for quite a while now. Userspace
can start before a lot of devices are ready. Mass storage for instance.
An initramfs can start userspace, but if the real rootfs is on rotating
storage, then it will have to wait for it to become ready before
mounting the real root. Distributions ran into this problem quite a
while ago.
That said, console is pretty important, and it isn't good that the
fallout of deferred probe is that console gets initialized even later.
Linus, we should get some engineers around a whiteboard at connect and
map out the initialization order issues. I've been pushing for moving as
much as possible to device_initcall() time, which in general I think is
the right thing to do, but this is the downside.
> Then let's move to my error case. Serial driver fails to
> bind pinctrl, and it's moved into deferred probe list. And
> kernel_init_freeable() in kernel_init thread keeps working
> on CPU, the deferred probe doesn't have chances to be
> scheduled yet. So two issues happen.
> 1. /dev/console is accessed before serial driver is ready.
> Since it fails, user can't input anything on console any
> more.
This is a fair point and is a better argument for me to having a pass
over the deferred drivers before exiting the device initcalls.
> 2. __init memory section is released before serial driver
> is ready. It results in system hang while deferred probe
> runs.
The __init section in a .probe() path is a problem in and of itself. I
do think that the __init annotations either need to be removed or the
hooks into them need to be cleared when the init sections are
discarded.
g.
next prev parent reply other threads:[~2013-02-13 21:21 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-06 11:47 [PATCH 1/2] tty: serial: remove __init on pl011 console ops Haojian Zhuang
2013-02-06 11:47 ` [PATCH 2/2] tty: serial: use module_init on pl011_init Haojian Zhuang
2013-02-06 17:17 ` Linus Walleij
2013-02-06 11:52 ` [PATCH 1/2] tty: serial: remove __init on pl011 console ops Russell King - ARM Linux
2013-02-06 12:31 ` Haojian Zhuang
2013-02-06 16:31 ` Linus Walleij
2013-02-06 16:38 ` Russell King - ARM Linux
2013-02-06 16:46 ` Linus Walleij
2013-02-09 17:22 ` Haojian Zhuang
2013-02-09 22:31 ` Grant Likely
2013-02-09 22:41 ` Russell King - ARM Linux
2013-02-10 3:31 ` Haojian Zhuang
2013-02-13 21:21 ` Grant Likely [this message]
2013-02-13 21:04 ` Grant Likely
2013-02-13 22:52 ` Russell King - ARM Linux
2013-02-13 23:04 ` Grant Likely
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=20130213212109.099AE3E3557@localhost \
--to=grant.likely@secretlab.ca \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).