mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Sergio Luis" <eeeesti@gmail.com>
To: "Alan Cox" <alan@redhat.com>
Cc: "Linus Torvalds" <torvalds@linux-foundation.org>,
	"Greg KH" <greg@kroah.com>,
	linux-usb@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: tty: usb-serial krefs - bad magic number for tty struct (188:0)
Date: Sun, 19 Oct 2008 14:39:46 -0300	[thread overview]
Message-ID: <ce0170d90810191039i6c78bac1ue1e4b688d47740ff@mail.gmail.com> (raw)
In-Reply-To: <ce0170d90810180915m10caa101ucc9e9a8a17cbb6cb@mail.gmail.com>

On Sat, Oct 18, 2008 at 1:15 PM, Sergio Luis <eeeesti@gmail.com> wrote:
> Hello,
>
> commit 4a90f09b20f4622dcbff1f0e1e6bae1704f8ad8c
>
> tty: usb-serial krefs
>
> Use kref in the USB serial drivers so that we don't free tty structures
> from under the URB receive handlers as has historically been the case if
> you were unlucky. This also gives us a framework for general tty drivers to
> use tty_port objects and refcount.
>
> Contains two err->dev_err changes merged together to fix clashes in the
> -next tree.
>
> Signed-off-by: Alan Cox <alan@redhat.com>
> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
>
> ----
>
> causes problems with my usb hsdpa modem. when I try to connect pppd
> dies and I get these messages on dmesg:
>
> [...]
> usb-storage: device scan complete
> PPP generic driver version 2.4.2
> bad magic number for tty struct (188:0) in tty_ioctl
> bad magic number for tty struct (188:0) in tty_ioctl
> bad magic number for tty struct (188:0) in tty_release_dev
> bad magic number for tty struct (188:0) in tty_poll
> bad magic number for tty struct (188:0) in tty_poll
> bad magic number for tty struct (188:0) in tty_write
> bad magic number for tty struct (188:0) in tty_ioctl
> bad magic number for tty struct (188:0) in tty_ioctl
> bad magic number for tty struct (188:0) in tty_ioctl
> bad magic number for tty struct (188:0) in tty_release_dev
>
> ---
>
> drivers/usb/serial/ChangeLog.history has this:
>
> (03/26/2002) gkh
>        removed the port->tty check from port_paranoia_check() due to serial
>        consoles not having a tty device assigned to them.
>
> and this seems to be the problem here.
> something in this commit seems to make it reach the tty_paranoia_check
> in tty_ioctl() from drivers/char/tty_io.c, but I could be completely
> wrong.
>
> Sergio.
>
Hello,

one of the problems was the tty_kref_put(tty) in
usb_serial_port_work() [drivers/usb/serial/usb-serial.c], that was
releasing the tty device. I removed that line and it _almost_ worked.
well, it worked, but only _once_. If I stopped the daemon and tried to
start it again, it would give me I/O error and would not open
/dev/ttyUSB0 anymore.
I'd suggest to revert that commit and to review it more carefully.
What do you people think?

Thanks,
Sergio.

  reply	other threads:[~2008-10-19 17:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-18 16:15 Sergio Luis
2008-10-19 17:39 ` Sergio Luis [this message]
2008-10-19 20:24   ` Alan Cox
2008-10-21 12:38   ` Alan Cox
2008-10-21 12:42     ` Sergio Luis
2008-10-21 13:03       ` Alan Cox

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=ce0170d90810191039i6c78bac1ue1e4b688d47740ff@mail.gmail.com \
    --to=eeeesti@gmail.com \
    --cc=alan@redhat.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=torvalds@linux-foundation.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

all inboxes | Powered by JetHome®