Skip to contentSkip to conversation

sx tty_driver add .owner field remove MOD_INC_DEC_USE_COUNT

PATCH Greg KH 3 participants 4 messages May 29, 2003 – May 30, 2003 1 message not in the archive Char and misc drivers

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Greg KH

author
#1 lore raw
Quoted 20 lines · Linux Kernel Mailing List

ChangeSet 1.1424, 2003/05/26 17:01:08-07:00, [email protected]

[PATCH] sx tty_driver add .owner field remove MOD_INC_DEC_USE_COUNT

From: Hanna Linder <[email protected]>

# This patch includes the following deltas:
# ChangeSet 1.1423 -> 1.1424
# drivers/char/sx.c 1.29 -> 1.30
#

 sx.c |   42 +-----------------------------------------
 1 files changed, 1 insertion(+), 41 deletions(-)

diff -Nru a/drivers/char/sx.c b/drivers/char/sx.c

drivers/char/sx.c line 308

Quoted 4 lines
drivers/char/sx.c +0 -1
@@ -305,7 +305,6 @@
 static int  sx_get_CD (void * ptr); 
 static void sx_shutdown_port (void * ptr);
 static int  sx_set_real_termios (void  *ptr);
-static void sx_hungup (void  *ptr);

Ick, this patch should be reverted, it should not be removing sx_hungup() for no reason. I think Hanna agrees with this.

thanks,

greg k-h

#2 lore raw
Quoted 3 lines · --On Thursday, May 29, 2003 12:02:50 PM -0700 Greg KH <[email protected]> wrote:

Ick, this patch should be reverted, it should not be removing sx_hungup() for no reason. I think Hanna agrees with this.

Yup. Sorry. Not sure what happened there. Here is the patch to replace the sx_hangup function. This is based off 2.5.70-bk3 and I have compiled it but dont have the hardware to test it.

Hanna

---

drivers/char/sx.c +35 -0
diff -Nrup -Xdontdiff linux-2.5.70-bk3/drivers/char/sx.c linux-sx/drivers/char/sx.c
@@ -299,6 +299,7 @@ static void sx_enable_rx_interrupts (voi
 static int  sx_get_CD (void * ptr); 
 static void sx_shutdown_port (void * ptr);
 static int  sx_set_real_termios (void  *ptr);
+static void sx_hungup (void  *ptr);
 static void sx_close (void  *ptr);
 static int sx_chars_in_buffer (void * ptr);
 static int sx_init_board (struct sx_board *board);
@@ -379,6 +380,7 @@ static struct real_driver sx_real_driver
 	sx_set_real_termios, 
 	sx_chars_in_buffer,
 	sx_close,
+	sx_hungup,
 };
 
 
@@ -1499,6 +1501,39 @@ static int sx_open  (struct tty_struct *
 }
 
 
+/* I haven't the foggiest why the decrement use count has to happen
+   here. The whole linux serial drivers stuff needs to be redesigned.
+   My guess is that this is a hack to minimize the impact of a bug
+   elsewhere. Thinking about it some more. (try it sometime) Try
+   running minicom on a serial port that is driven by a modularized
+   driver. Have the modem hangup. Then remove the driver module. Then
+   exit minicom.  I expect an "oops".  -- REW */
+static void sx_hungup (void *ptr)
+{
+  /*
+	struct sx_port *port = ptr; 
+  */
+	func_enter ();
+
+	/* Don't force the SX card to close. mgetty doesn't like it !!!!!! -- pvdl */
+	/* For some reson we added this code. Don't know why anymore ;-( -- pvdl */
+	/*
+	sx_setsignals (port, 0, 0);
+	sx_reconfigure_port(port);	
+	sx_send_command (port, HS_CLOSE, 0, 0);
+
+	if (sx_read_channel_byte (port, hi_hstat) != HS_IDLE_CLOSED) {
+		if (sx_send_command (port, HS_FORCE_CLOSED, -1, HS_IDLE_CLOSED) != 1) {
+			printk (KERN_ERR 
+			        "sx: sent the force_close command, but card didn't react\n");
+		} else
+			sx_dprintk (SX_DEBUG_CLOSE, "sent the force_close command.\n");
+	}
+	*/
+	func_exit ();
+}
+
+
 static void sx_close (void *ptr)
 {
 	struct sx_port *port = ptr; 
#3 lore raw

In message <12430000.1054244110@w-hlinder> you write:

Quoted 9 lines
Quoted 3 lines · --On Thursday, May 29, 2003 12:02:50 PM -0700 Greg KH <[email protected]> wrote:

Ick, this patch should be reverted, it should not be removing sx_hungup() for no reason. I think Hanna agrees with this.

Yup. Sorry. Not sure what happened there. Here is the patch to replace the sx_hangup function. This is based off 2.5.70-bk3 and I have compiled it but dont have the hardware to test it.

Yes, but I don't think you need to put back the comment about decrementing use counts 8)

drivers/char/sx.c static int sx_open (struct tty_struct * · line 1510

Quoted 7 lines
drivers/char/sx.c +7 -0
+/* I haven't the foggiest why the decrement use count has to happen
+   here. The whole linux serial drivers stuff needs to be redesigned.
+   My guess is that this is a hack to minimize the impact of a bug
+   elsewhere. Thinking about it some more. (try it sometime) Try
+   running minicom on a serial port that is driven by a modularized
+   driver. Have the modem hangup. Then remove the driver module. Then
+   exit minicom.  I expect an "oops".  -- REW */

Cheers,
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

#4 lore raw

Heh. I figured out why I deleted it, it was not a mistake. The whole function is commented out! Except the func_enter and exit calls which are printk wrappers. Besides, no one ever calls this function anyway...

So leave it out. No need to put it back in...

Hanna

Quoted 27 lines · --On Friday, May 30, 2003 06:05:24 PM +1000 Rusty Russell <[email protected]>…

In message <12430000.1054244110@w-hlinder> you write:

Quoted 9 lines
Quoted 3 lines · --On Thursday, May 29, 2003 12:02:50 PM -0700 Greg KH <[email protected]> wrote:

Ick, this patch should be reverted, it should not be removing sx_hungup() for no reason. I think Hanna agrees with this.

Yup. Sorry. Not sure what happened there. Here is the patch to replace the sx_hangup function. This is based off 2.5.70-bk3 and I have compiled it but dont have the hardware to test it.

Yes, but I don't think you need to put back the comment about decrementing use counts 8)

drivers/char/sx.c static int sx_open (struct tty_struct * · line 1510

Quoted 7 lines
drivers/char/sx.c +7 -0
+/* I haven't the foggiest why the decrement use count has to happen
+   here. The whole linux serial drivers stuff needs to be redesigned.
+   My guess is that this is a hack to minimize the impact of a bug
+   elsewhere. Thinking about it some more. (try it sometime) Try
+   running minicom on a serial port that is driven by a modularized
+   driver. Have the modem hangup. Then remove the driver module. Then
+   exit minicom.  I expect an "oops".  -- REW */

Cheers,
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.