From: Dmitry Torokhov <dtor_core@ameritech.net>
To: Vojtech Pavlik <vojtech@suse.cz>
Cc: linux-kernel@vger.kernel.org, Vojtech Pavlik <vojtech@suse.cz>,
Andrew Morton <akpm@osdl.org>
Subject: Re: [2.6 RFC/PATCH] Input: possible deadlock in i8042
Date: Mon, 1 Dec 2003 01:59:30 -0500 [thread overview]
Message-ID: <200312010159.32255.dtor_core@ameritech.net> (raw)
In-Reply-To: <20031130090009.GA17038@ucw.cz>
===================================================================
ChangeSet@1.1513, 2003-11-30 23:38:00-05:00, dtor_core@ameritech.net
Input: Unregister port not only when there us no free IRQ
available but also when write to control register
failed.
Use serio_unregister_port_delayed in i8042_open to
avoid deadlock on serio_sem.
Also logging moved a bit
i8042.c | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
===================================================================
diff -Nru a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
--- a/drivers/input/serio/i8042.c Mon Dec 1 01:15:56 2003
+++ b/drivers/input/serio/i8042.c Mon Dec 1 01:15:56 2003
@@ -231,21 +231,29 @@
if (request_irq(values->irq, i8042_interrupt,
SA_SHIRQ, "i8042", i8042_request_irq_cookie)) {
printk(KERN_ERR "i8042.c: Can't get irq %d for %s, unregistering the port.\n", values->irq, values->name);
- values->exists = 0;
- serio_unregister_port(port);
- return -1;
+ goto irq_fail;
}
i8042_ctr |= values->irqen;
if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) {
- printk(KERN_ERR "i8042.c: Can't write CTR while opening %s.\n", values->name);
- return -1;
+ printk(KERN_ERR "i8042.c: Can't write CTR while opening %s, unregistering the port\n", values->name);
+ goto ctr_fail;
}
i8042_interrupt(0, NULL, NULL);
return 0;
+
+ctr_fail:
+ i8042_ctr &= ~values->irqen;
+ free_irq(values->irq, i8042_request_irq_cookie);
+
+irq_fail:
+ values->exists = 0;
+ serio_unregister_port_delayed(port);
+
+ return -1;
}
/*
@@ -691,13 +699,13 @@
return -1;
}
- serio_register_port(port);
-
printk(KERN_INFO "serio: i8042 %s port at %#lx,%#lx irq %d\n",
values->name,
(unsigned long) I8042_DATA_REG,
(unsigned long) I8042_COMMAND_REG,
values->irq);
+
+ serio_register_port(port);
return 0;
}
prev parent reply other threads:[~2003-12-01 6:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-30 8:03 [2.6 RFC/PATCH] Input: possible deadlock in i8042 Dmitry Torokhov
2003-11-30 9:00 ` Vojtech Pavlik
2003-11-30 9:19 ` Dmitry Torokhov
2003-12-01 6:58 ` Dmitry Torokhov
2003-12-01 6:59 ` Dmitry Torokhov [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=200312010159.32255.dtor_core@ameritech.net \
--to=dtor_core@ameritech.net \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vojtech@suse.cz \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.