owner in irtty-sir
PATCH 1/1 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
drivers/net/irda/sir_kthread.c renamed from drivers/net/irda/sir_kthread.d0.c +7 -0
@@ -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))
drivers/net/irda/irtty-sir.c renamed from drivers/net/irda/irtty-sir.d0.c +2 -7
@@ -504,10 +504,7 @@ static int irtty_open(struct tty_structstruct 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, };/* ------------------------------------------------------- */