<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/tty_driver.h, branch v3.5-rc2</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.5-rc2</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.5-rc2'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2012-03-08T19:38:51Z</updated>
<entry>
<title>TTY: tty_driver, document tty-&gt;ops-&gt;shutdown limitation</title>
<updated>2012-03-08T19:38:51Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2012-03-05T13:51:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=26b23209c0ea5503824df60b8f218fb04b80cad0'/>
<id>urn:sha1:26b23209c0ea5503824df60b8f218fb04b80cad0</id>
<content type='text'>
Note that tty-&gt;ops-&gt;shutdown is called from whatever context the user
drops the last tty reference from. E.g. if one takes a reference in
an ISR, tty close happens on other CPU and the final tty put is from
the ISR, tty-&gt;ops-&gt;shutdown will be called from that hard irq context.

We would have a problem in vt if we start using tty refcounting from
other contexts than user there. It is because vt's shutdown uses
mutexes. This is yet to be fixed.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Reported-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>TTY: remove minor_num from tty_driver</title>
<updated>2012-03-08T19:30:21Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2012-03-05T13:51:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=87cab16beb882d3f9e61a2c0184fa7cf76de1f90'/>
<id>urn:sha1:87cab16beb882d3f9e61a2c0184fa7cf76de1f90</id>
<content type='text'>
It was added back in 2004 and never used for anything real. Remove the
only assignment in the tree as well.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>TTY: let alloc_tty_driver deduce the owner automatically</title>
<updated>2012-03-08T19:30:21Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2012-03-05T13:51:50Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1a54a76d5171f3ffd89eb69f6f38d535724e3d05'/>
<id>urn:sha1:1a54a76d5171f3ffd89eb69f6f38d535724e3d05</id>
<content type='text'>
Like the rest of the kernel, make a stub from alloc_tty_driver which
calls __alloc_tty_driver with proper owner. This will save us one more
assignment on the driver side.

Also this fixes some drivers which didn't set the owner. This allowed
user to remove the module from the system even though a tty from the
driver is still open.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: remove unused tty_driver-&gt;termios_locked</title>
<updated>2012-01-17T18:30:38Z</updated>
<author>
<name>Konstantin Khlebnikov</name>
<email>khlebnikov@openvz.org</email>
</author>
<published>2012-01-17T08:54:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=20c300b10c358daa507be335aec6aa3987ef425a'/>
<id>urn:sha1:20c300b10c358daa507be335aec6aa3987ef425a</id>
<content type='text'>
This field is unused since 2.6.28 (commit fe6e29fdb1a7: "tty: simplify
ktermios allocation", to be exact)

Signed-off-by: Konstantin Khlebnikov &lt;khlebnikov@openvz.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>TTY: pty, fix pty counting</title>
<updated>2011-08-23T17:10:38Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2011-08-10T12:59:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=24d406a6bf736f7aebdc8fa0f0ec86e0890c6d24'/>
<id>urn:sha1:24d406a6bf736f7aebdc8fa0f0ec86e0890c6d24</id>
<content type='text'>
tty_operations-&gt;remove is normally called like:
queue_release_one_tty
 -&gt;tty_shutdown
   -&gt;tty_driver_remove_tty
     -&gt;tty_operations-&gt;remove

However tty_shutdown() is called from queue_release_one_tty() only if
tty_operations-&gt;shutdown is NULL. But for pty, it is not.
pty_unix98_shutdown() is used there as -&gt;shutdown.

So tty_operations-&gt;remove of pty (i.e. pty_unix98_remove()) is never
called. This results in invalid pty_count. I.e. what can be seen in
/proc/sys/kernel/pty/nr.

I see this was already reported at:
  https://lkml.org/lkml/2009/11/5/370
But it was not fixed since then.

This patch is kind of a hackish way. The problem lies in -&gt;install. We
allocate there another tty (so-called tty-&gt;link). So -&gt;install is
called once, but -&gt;remove twice, for both tty and tty-&gt;link. The fix
here is to count both tty and tty-&gt;link and divide the count by 2 for
user.

And to have -&gt;remove called, let's make tty_driver_remove_tty() global
and call that from pty_unix98_shutdown() (tty_operations-&gt;shutdown).

While at it, let's document that when -&gt;shutdown is defined,
tty_shutdown() is not called.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Cc: Alan Cox &lt;alan@linux.intel.com&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>tty: now phase out the ioctl file pointer for good</title>
<updated>2011-02-17T19:59:56Z</updated>
<author>
<name>Alan Cox</name>
<email>alan@linux.intel.com</email>
</author>
<published>2011-02-14T16:27:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6caa76b7786891b42b66a0e61e2c2fff2c884620'/>
<id>urn:sha1:6caa76b7786891b42b66a0e61e2c2fff2c884620</id>
<content type='text'>
Only oddities here are a couple of drivers that bogusly called the ldisc
helpers instead of returning -ENOIOCTLCMD. Fix the bug and the rest goes
away.

Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>tiocmset: kill the file pointer argument</title>
<updated>2011-02-17T19:52:43Z</updated>
<author>
<name>Alan Cox</name>
<email>alan@linux.intel.com</email>
</author>
<published>2011-02-14T16:26:50Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=20b9d17715017ae4dd4ec87fabc36d33b9de708e'/>
<id>urn:sha1:20b9d17715017ae4dd4ec87fabc36d33b9de708e</id>
<content type='text'>
Doing tiocmget was such fun we should do tiocmset as well for the same
reasons

Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>tiocmget: kill off the passing of the struct file</title>
<updated>2011-02-17T19:47:33Z</updated>
<author>
<name>Alan Cox</name>
<email>alan@linux.intel.com</email>
</author>
<published>2011-02-14T16:26:14Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=60b33c133ca0b7c0b6072c87234b63fee6e80558'/>
<id>urn:sha1:60b33c133ca0b7c0b6072c87234b63fee6e80558</id>
<content type='text'>
We don't actually need this and it causes problems for internal use of
this functionality. Currently there is a single use of the FILE * pointer.
That is the serial core which uses it to check tty_hung_up_p. However if
that is true then IO_ERROR is also already set so the check may be removed.

Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>tty: fix typos/errors in tty_driver.h comments</title>
<updated>2010-12-16T21:14:32Z</updated>
<author>
<name>Timur Tabi</name>
<email>timur@freescale.com</email>
</author>
<published>2010-12-13T20:08:53Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6ce5b1ce5f6922db32599e73bcb22f5cdcbf241f'/>
<id>urn:sha1:6ce5b1ce5f6922db32599e73bcb22f5cdcbf241f</id>
<content type='text'>
Fix various typos and other errors in comments of tty_driver.h.  The most
significant is the wrong name of a function for the description of
TTY_DRIVER_DYNAMIC_DEV.

Signed-off-by: Timur Tabi &lt;timur@freescale.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>TTY: include termios.h in tty_driver.h</title>
<updated>2010-11-16T20:50:17Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2010-11-04T15:20:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3dfbd044d0d99cad2fe50e4f6c79845703fa0558'/>
<id>urn:sha1:3dfbd044d0d99cad2fe50e4f6c79845703fa0558</id>
<content type='text'>
We reference termios and termiox in tty_driver.h, but we do not include
linux/termios.h where these are defined. Add the #include properly.

Otherwise when we include tty_driver.h, we get compile errors.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Cc: Greg KH &lt;gregkh@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
</feed>
