Commit 179bb11d authored by Jean Tourrilhes's avatar Jean Tourrilhes Committed by Linus Torvalds

[PATCH] owner in irtty-sir

ir259_sir_kthread_Morton-2.diff :
	o [CORRECT] fix module ownership in irtty-sir
	o [FEATURE] important comment in sir_kthread
parent a5ae87c6
...@@ -504,10 +504,7 @@ static int irtty_open(struct tty_struct *tty) ...@@ -504,10 +504,7 @@ static int irtty_open(struct tty_struct *tty)
struct sirtty_cb *priv; struct sirtty_cb *priv;
int ret = 0; int ret = 0;
/* unfortunately, there's no tty_ldisc->owner field /* Module stuff handled via irda_ldisc.owner - Jean II */
* so there is some window for SMP race with rmmod
*/
MOD_INC_USE_COUNT;
/* First make sure we're not already connected. */ /* First make sure we're not already connected. */
if (tty->disc_data != NULL) { if (tty->disc_data != NULL) {
...@@ -569,7 +566,6 @@ static int irtty_open(struct tty_struct *tty) ...@@ -569,7 +566,6 @@ static int irtty_open(struct tty_struct *tty)
out_put: out_put:
sirdev_put_instance(dev); sirdev_put_instance(dev);
out: out:
MOD_DEC_USE_COUNT;
return ret; return ret;
} }
...@@ -614,8 +610,6 @@ static void irtty_close(struct tty_struct *tty) ...@@ -614,8 +610,6 @@ static void irtty_close(struct tty_struct *tty)
tty->driver->stop(tty); tty->driver->stop(tty);
kfree(priv); kfree(priv);
MOD_DEC_USE_COUNT;
} }
/* ------------------------------------------------------- */ /* ------------------------------------------------------- */
...@@ -633,6 +627,7 @@ static struct tty_ldisc irda_ldisc = { ...@@ -633,6 +627,7 @@ static struct tty_ldisc irda_ldisc = {
.receive_buf = irtty_receive_buf, .receive_buf = irtty_receive_buf,
.receive_room = irtty_receive_room, .receive_room = irtty_receive_room,
.write_wakeup = irtty_write_wakeup, .write_wakeup = irtty_write_wakeup,
.owner = THIS_MODULE,
}; };
/* ------------------------------------------------------- */ /* ------------------------------------------------------- */
......
...@@ -151,6 +151,13 @@ static int irda_thread(void *startup) ...@@ -151,6 +151,13 @@ static int irda_thread(void *startup)
while (irda_rq_queue.thread != NULL) { 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); set_task_state(current, TASK_INTERRUPTIBLE);
add_wait_queue(&irda_rq_queue.kick, &wait); add_wait_queue(&irda_rq_queue.kick, &wait);
if (list_empty(&irda_rq_queue.request_list)) if (list_empty(&irda_rq_queue.request_list))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment