From: Grant Edwards <grant.b.edwards@gmail.com>
To: linux-serial@vger.kernel.org
Subject: Re: Warning about not setting tty->port: what to set it to?
Date: Mon, 14 Jan 2013 16:51:25 +0000 (UTC) [thread overview]
Message-ID: <kd1d2d$dfs$1@ger.gmane.org> (raw)
In-Reply-To: kcpt0f$ott$1@ger.gmane.org
On 2013-01-11, Grant Edwards <grant.b.edwards@gmail.com> wrote:
> I maintain a serial card driver which, starting with kernel 3.7,
> produces this warning when a port is opened:
>
> tty_init_dev: ttyXYZ driver does not set tty->port. This will crash the kernel later. Fix the driver!
I've been looking at 3.7.2 in-kernel tty drivers to try to figure out
what to do about this, and I don't understand how the in-kernel
drivers are avoiding the same problem I'm seeing.
I've looked at three other tty drivers: amiserial.c, rocket.c,
cyclades.c:
Based on some examination/experimentation, it seems the check for
tty->port is done during driver "installation" and occurs _before_ a
tty driver's open() function is called().
But, amiserial.c doesn't set tty->port until the open() function is
called. How does the amiserial driver avoid the warning and stack
trace?
AFAICT, the rocket.c and cyclades.c drivers don't set tty->port at
all.
What am I missing?
--
Grant Edwards grant.b.edwards Yow! When this load is
at DONE I think I'll wash it
gmail.com AGAIN ...
prev parent reply other threads:[~2013-01-14 16:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-11 20:34 Warning about not setting tty->port: what to set it to? Grant Edwards
2013-01-14 16:51 ` Grant Edwards [this message]
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='kd1d2d$dfs$1@ger.gmane.org' \
--to=grant.b.edwards@gmail.com \
--cc=linux-serial@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.