From: Jean Tourrilhes <jt@bougret.hpl.hp.com>
To: Jeff Garzik <jgarzik@pobox.com>,
Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: [PATCH 2.5] owner in irtty-sir
Date: Tue, 13 May 2003 15:22:27 -0700 [thread overview]
Message-ID: <20030513222227.GE2634@bougret.hpl.hp.com> (raw)
ir259_sir_kthread_Morton-2.diff :
o [CORRECT] fix module ownership in irtty-sir
o [FEATURE] important comment in sir_kthread
diff -u -p linux/drivers/net/irda/sir_kthread.d0.c linux/drivers/net/irda/sir_kthread.c
--- linux/drivers/net/irda/sir_kthread.d0.c Mon May 12 17:47:43 2003
+++ linux/drivers/net/irda/sir_kthread.c Mon May 12 17:55:49 2003
@@ -151,6 +151,13 @@ static int irda_thread(void *startup)
while (irda_rq_queue.thread != NULL) {
+ /* We use TASK_INTERRUPTIBLE, rather than
+ * TASK_UNINTERRUPTIBLE. Andrew Morton made this
+ * change ; he told me that it is safe, because "signal
+ * blocking is now handled in daemonize()", he added
+ * that the problem is that "uninterruptible sleep
+ * contributes to load average", making user worry.
+ * Jean II */
set_task_state(current, TASK_INTERRUPTIBLE);
add_wait_queue(&irda_rq_queue.kick, &wait);
if (list_empty(&irda_rq_queue.request_list))
diff -u -p linux/drivers/net/irda/irtty-sir.d0.c linux/drivers/net/irda/irtty-sir.c
--- linux/drivers/net/irda/irtty-sir.d0.c Mon May 12 17:49:22 2003
+++ linux/drivers/net/irda/irtty-sir.c Mon May 12 17:53:09 2003
@@ -504,10 +504,7 @@ static int irtty_open(struct tty_struct
struct sirtty_cb *priv;
int ret = 0;
- /* unfortunately, there's no tty_ldisc->owner field
- * so there is some window for SMP race with rmmod
- */
- MOD_INC_USE_COUNT;
+ /* Module stuff handled via irda_ldisc.owner - Jean II */
/* First make sure we're not already connected. */
if (tty->disc_data != NULL) {
@@ -569,7 +566,6 @@ static int irtty_open(struct tty_struct
out_put:
sirdev_put_instance(dev);
out:
- MOD_DEC_USE_COUNT;
return ret;
}
@@ -614,8 +610,6 @@ static void irtty_close(struct tty_struc
tty->driver->stop(tty);
kfree(priv);
-
- MOD_DEC_USE_COUNT;
}
/* ------------------------------------------------------- */
@@ -633,6 +627,7 @@ static struct tty_ldisc irda_ldisc = {
.receive_buf = irtty_receive_buf,
.receive_room = irtty_receive_room,
.write_wakeup = irtty_write_wakeup,
+ .owner = THIS_MODULE,
};
/* ------------------------------------------------------- */
reply other threads:[~2003-05-13 22:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20030513222227.GE2634@bougret.hpl.hp.com \
--to=jt@bougret.hpl.hp.com \
--cc=jgarzik@pobox.com \
--cc=jt@hpl.hp.com \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®