Re: Warning about not setting tty->port: what to set it to?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2013-01-11, Grant Edwards <grant.b.edwards@xxxxxxxxx> 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 ...

--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux