public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergey Vlasov <vsu@altlinux.ru>
To: Jason Baron <jbaron@redhat.com>
Cc: Krzysztof Taraszka <dzimi@pld-linux.org>, linux-kernel@vger.kernel.org
Subject: Re: [Patch] 2.4.28-pre3 tty/ldisc fixes
Date: Sun, 7 Nov 2004 23:06:01 +0300	[thread overview]
Message-ID: <20041107200601.GA2345@sirius.home> (raw)
In-Reply-To: <Pine.LNX.4.44.0411020958460.8117-100000@dhcp83-105.boston.redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1987 bytes --]

On Tue, Nov 02, 2004 at 10:02:44AM -0500, Jason Baron wrote:
> 
> On Sun, 31 Oct 2004, Krzysztof Taraszka wrote:
> 
> > Dnia sobota, 30 pa?dziernika 2004 21:19, napisa?e?:
> > > On Fri, Oct 29, 2004 at 02:29:43PM -0400, Jason Baron wrote:
> > 
> > > > Here's an updated 2.4 tty patch. I'm not sure if the updated patch would
> > > > fix the above issue, but it has a lot of changes so it might be worth a
> > > > try.
> > >
> > > This looks better - at least the system boots without hang or oops ;)
> > 
> > where is an updated 2.4 tty patch ?
> 
> hmmm...seems like my e-mails keeping getting dropped, perhaps the patch is
> too large? Here is a link to the patch:
> 
> http://people.redhat.com/~jbaron/tty/2.4-tty-V5.patch

Finally I have found the bug which prevented SieFS (slink) from
working.  The bug was in drivers/char/tty_ioctl.c:

@@ -131,16 +141,20 @@ static void change_termios(struct tty_st
 		}
 	}
 
-	if (tty->driver.set_termios)
-		(*tty->driver.set_termios)(tty, &old_termios);
+	ld = tty_ldisc_ref(tty);
+	if (ld != NULL) {
+		if (ld->set_termios)
+			(ld->set_termios)(tty, &old_termios);
+		tty_ldisc_deref(ld);
+	}
+	spin_unlock_irqrestore(&tty_termios_lock, flags);
 
-	if (tty->ldisc.set_termios)
-		(*tty->ldisc.set_termios)(tty, &old_termios);
 }
 
The call to tty->driver.set_termios was lost, therefore the serial
port speed was not set properly.

Simply adding this call back does not work, because set_termios
handlers in usbserial use semaphores for locking, and therefore cannot
be called while holding the tty_termios_lock spinlock.  Because of
this, some more backporting from 2.6.x is needed - Alan Cox has
already changed tty_termios_lock to a per-tty semaphore in 2.6.x, this
change is needed for 2.4.x too.

The patches are in separate emails: first is the backport of the
termios locking changes, second patch adds back lost call to
tty->driver.set_termios (which is safe after first patch).

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2004-11-07 20:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-24 17:49 [Patch] 2.4.28-pre3 tty/ldisc fixes Jason Baron
2004-10-28 18:35 ` Sergey Vlasov
2004-10-28 18:42   ` Jason Baron
     [not found]   ` <Pine.LNX.4.44.0410291426240.13340-200000@dhcp83-105.boston.redhat.com>
2004-10-30 19:19     ` Sergey Vlasov
2004-10-31  9:53       ` Krzysztof Taraszka
2004-11-02 15:02         ` Jason Baron
2004-11-07 20:06           ` Sergey Vlasov [this message]
2004-11-07 20:10             ` [PATCH] Update termios to use per tty semaphore (backport from 2.6.x) Sergey Vlasov
2004-11-07 20:13             ` [PATCH] Add back lost call to tty->driver.set_termios Sergey Vlasov
2004-10-31 17:18       ` [Patch] 2.4.28-pre3 tty/ldisc fixes Sergey Vlasov

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=20041107200601.GA2345@sirius.home \
    --to=vsu@altlinux.ru \
    --cc=dzimi@pld-linux.org \
    --cc=jbaron@redhat.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