Skip to contentSkip to conversation

try harder to load tty ldisc driver

PATCH In review Eugeniy Meshcheryakov 2 participants 2 messages Jul 29, 2008 – Jul 30, 2008 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 try harder to load tty ldisc driver

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.

--

drivers/char/tty_ldisc.c +1 -1
index 241cbde..f307f13 100644
@@ -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);
 	}
#1 lore raw
Quoted 6 lines · On Tue, 29 Jul 2008 22:45:12 +0200 Eugeniy Meshcheryakov <[email protected]>…

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.

Quoted 7 lines

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.

(And forwarded to the stable tree too)