* [PATCH] try harder to load tty ldisc driver
@ 2008-07-29 20:45 Eugeniy Meshcheryakov
2008-07-30 22:51 ` Alan Cox
0 siblings, 1 reply; 2+ messages in thread
From: Eugeniy Meshcheryakov @ 2008-07-29 20:45 UTC (permalink / raw)
To: alan; +Cc: linux-kernel
Currently function tty_ldisc_get() tries to load an ldisc driver module
only when tty_ldisc_try_get() returns -EAGAIN. This happens only if
module is being unloaded. If ldisc module is not loaded
tty_ldisc_try_get() returns -EINVAL and this case is not handled in
tty_ldisc_get(), so request_module() is not called.
Attached patch fixes this by calling request_module() if
tty_ldisc_try_get() returned any error code.
I discovered this when my UMTS modem stopped working with 2.6.27-rc1
because module ppp_async was not loaded.
Signed-off-by: Eugeniy Meshcheryakov <eugen@debian.org>
--
diff --git a/drivers/char/tty_ldisc.c b/drivers/char/tty_ldisc.c
index 241cbde..f307f13 100644
--- a/drivers/char/tty_ldisc.c
+++ b/drivers/char/tty_ldisc.c
@@ -169,7 +169,7 @@ static int tty_ldisc_get(int disc, struct tty_ldisc *ld)
if (disc < N_TTY || disc >= NR_LDISCS)
return -EINVAL;
err = tty_ldisc_try_get(disc, ld);
- if (err == -EAGAIN) {
+ if (err < 0) {
request_module("tty-ldisc-%d", disc);
err = tty_ldisc_try_get(disc, ld);
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] try harder to load tty ldisc driver
2008-07-29 20:45 [PATCH] try harder to load tty ldisc driver Eugeniy Meshcheryakov
@ 2008-07-30 22:51 ` Alan Cox
0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2008-07-30 22:51 UTC (permalink / raw)
To: Eugeniy Meshcheryakov; +Cc: linux-kernel
On Tue, 29 Jul 2008 22:45:12 +0200
Eugeniy Meshcheryakov <eugen@debian.org> wrote:
> Currently function tty_ldisc_get() tries to load an ldisc driver module
> only when tty_ldisc_try_get() returns -EAGAIN. This happens only if
> module is being unloaded. If ldisc module is not loaded
> tty_ldisc_try_get() returns -EINVAL and this case is not handled in
> tty_ldisc_get(), so request_module() is not called.
>
> Attached patch fixes this by calling request_module() if
> tty_ldisc_try_get() returned any error code.
>
> I discovered this when my UMTS modem stopped working with 2.6.27-rc1
> because module ppp_async was not loaded.
>
> Signed-off-by: Eugeniy Meshcheryakov <eugen@debian.org>
Signed-off-by: Alan Cox <alan@redhat.com>
(And forwarded to the stable tree too)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-30 23:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-29 20:45 [PATCH] try harder to load tty ldisc driver Eugeniy Meshcheryakov
2008-07-30 22:51 ` Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox