public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Hanna Linder <hannal@us.ibm.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: linux-kernel-owner@vger.kernel.org, rusty@rustcorp.com.au,
	hannal@us.ibm.com
Subject: Re: [PATCH] sx tty_driver add .owner field remove MOD_INC_DEC_USE_COUNT
Date: Thu, 29 May 2003 14:35:10 -0700	[thread overview]
Message-ID: <12430000.1054244110@w-hlinder> (raw)
In-Reply-To: <20030529190250.GB24737@kroah.com>

--On Thursday, May 29, 2003 12:02:50 PM -0700 Greg KH <greg@kroah.com> 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

---
diff -Nrup -Xdontdiff linux-2.5.70-bk3/drivers/char/sx.c linux-sx/drivers/char/sx.c
--- linux-2.5.70-bk3/drivers/char/sx.c	Thu May 29 14:03:43 2003
+++ linux-sx/drivers/char/sx.c	Thu May 29 14:11:39 2003
@@ -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; 


  reply	other threads:[~2003-05-29 21:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200305270126.h4R1QjA3029554@hera.kernel.org>
2003-05-29 19:02 ` [PATCH] sx tty_driver add .owner field remove MOD_INC_DEC_USE_COUNT Greg KH
2003-05-29 21:35   ` Hanna Linder [this message]
2003-05-30  8:05     ` Rusty Russell
2003-05-30 17:48       ` Hanna Linder

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=12430000.1054244110@w-hlinder \
    --to=hannal@us.ibm.com \
    --cc=linux-kernel-owner@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /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