aboutsummaryrefslogtreecommitdiff
path: root/drivers/tty/rocket.c
AgeCommit message (Collapse)AuthorFilesLines
2020-04-27Merge 5.7-rc3 into tty-nextGreg Kroah-Hartman1-11/+14
We need the tty/serial fixes in here too. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-04-23tty: rocket, remove unneeded variableJiri Slaby1-6/+4
num_chan in register_PCI is used only as an alias for ports_per_aiop. So drop num_chan and use ports_per_aiop directly. Signed-off-by: Jiri Slaby <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-04-23tty: rocket, avoid OOB accessJiri Slaby1-11/+14
init_r_port can access pc104 array out of bounds. pc104 is a 2D array defined to have 4 members. Each member has 8 submembers. * we can have more than 4 (PCI) boards, i.e. [board] can be OOB * line is not modulo-ed by anything, so the first line on the second board can be 4, on the 3rd 12 or alike (depending on previously registered boards). It's zero only on the first line of the first board. So even [line] can be OOB, quite soon (with the 2nd registered board already). This code is broken for ages, so just avoid the OOB accesses and don't try to fix it as we would need to find out the correct line number. Use the default: RS232, if we are out. Generally, if anyone needs to set the interface types, a module parameter is past the last thing that should be used for this purpose. The parameters' description says it's for ISA cards anyway. Signed-off-by: Jiri Slaby <[email protected]> Cc: stable <[email protected]> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-11-04tty: rocket: reduce stack usageSudip Mukherjee1-13/+19
The build of xtensa allmodconfig gives warning of: In function 'get_ports.isra.0': warning: the frame size of 1040 bytes is larger than 1024 bytes Signed-off-by: Sudip Mukherjee <[email protected]> Acked-by: Jiri Slaby <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-05-08Merge tag 'tty-5.2-rc1' of ↵Linus Torvalds1-4/+10
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial updates from Greg KH: "Here is the "big" set of tty/serial driver patches for 5.2-rc1. It's really pretty small, not much happening in this portion of the kernel at the moment. When the "highlight" is the movement of the documentation from .txt to .rst files, it's a good merge window. There's a number of small fixes and updates over the various serial drivers, and a new "tty null" driver for those embedded systems that like to make things even smaller and not break things. All of these have been in linux-next for a while with no reported issues" * tag 'tty-5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (45 commits) tty: serial: add driver for the SiFive UART dt-bindings: serial: add documentation for the SiFive UART driver serial: uartps: Add support for cts-override dt-bindings: xilinx-uartps: Add support for cts-override serial: milbeaut_usio: Fix error handling in probe and remove tty: rocket: deprecate the rp_ioctl tty: rocket: Remove RCPK_GET_STRUCT ioctl tty: update obsolete termios comment tty: serial_core: fix error code returned by uart_register_driver() serial: 8250-mtk: modify baudrate setting serial: 8250-mtk: add follow control docs: serial: convert docs to ReST and rename to *.rst serial: 8250_exar: Adjust IOT2000 matching TTY: serial_core, add ->install serial: Fix using plain integer instead of Null pointer tty:serial_core: Spelling mistake tty: Add NULL TTY driver tty: vt: keyboard: Allow Unicode compose base char Revert "tty: fix NULL pointer issue when tty_port ops is not set" serial: Add Milbeaut serial control ...
2019-05-06tty: rocket: fix incorrect forward declaration of 'rp_init()'Linus Torvalds1-1/+1
Make the forward declaration actually match the real function definition, something that previous versions of gcc had just ignored. This is another patch to fix new warnings from gcc-9 before I start the merge window pulls. I don't want to miss legitimate new warnings just because my system update brought a new compiler with new warnings. Signed-off-by: Linus Torvalds <[email protected]>
2019-04-25tty: rocket: deprecate the rp_ioctlFuqian Huang1-0/+10
The rp_ioctl is deprecated. Add dev_warn_ratelimited to warn the use of rp_ioctl. Signed-off-by: Fuqian Huang <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-04-25tty: rocket: Remove RCPK_GET_STRUCT ioctlFuqian Huang1-4/+0
If the cmd is RCPK_GET_STRUCT, copy_to_user will copy info to user space. As info->port.ops is the address of a constant object rocket_port_ops (assigned in init_r_port), a kernel address leakage happens. Remove the RCPK_GET_STRUCT ioctl. Signed-off-by: Fuqian Huang <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-08-02tty: rocket: Fix possible buffer overwrite on register_PCIAnton Vasilyev1-1/+1
If number of isa and pci boards exceed NUM_BOARDS on the path rp_init()->init_PCI()->register_PCI() then buffer overwrite occurs in register_PCI() on assign rcktpt_io_addr[i]. The patch adds check on upper bound for index of registered board in register_PCI. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-11-21treewide: Switch DEFINE_TIMER callbacks to struct timer_list *Kees Cook1-2/+2
This changes all DEFINE_TIMER() callbacks to use a struct timer_list pointer instead of unsigned long. Since the data argument has already been removed, none of these callbacks are using their argument currently, so this renames the argument to "unused". Done using the following semantic patch: @match_define_timer@ declarer name DEFINE_TIMER; identifier _timer, _callback; @@ DEFINE_TIMER(_timer, _callback); @change_callback depends on match_define_timer@ identifier match_define_timer._callback; type _origtype; identifier _origarg; @@ void -_callback(_origtype _origarg) +_callback(struct timer_list *unused) { ... } Signed-off-by: Kees Cook <[email protected]>
2017-11-13Merge tag 'tty-4.15-rc1' of ↵Linus Torvalds1-14/+1
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial updates from Greg KH: "Here is the big tty/serial driver pull request for 4.15-rc1. Lots of serial driver updates in here, some small vt cleanups, and a raft of SPDX and license boilerplate cleanups, messing up the diffstat a bit. Nothing major, with no realy functional changes except better hardware support for some platforms. All of these have been in linux-next for a while with no reported issues" * tag 'tty-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (110 commits) tty: ehv_bytechan: fix spelling mistake tty: serial: meson: allow baud-rates lower than 9600 serial: 8250_fintek: Fix crash with baud rate B0 serial: 8250_fintek: Disable delays for ports != 0 serial: 8250_fintek: Return -EINVAL on invalid configuration tty: Remove redundant license text tty: serdev: Remove redundant license text tty: hvc: Remove redundant license text tty: serial: Remove redundant license text tty: add SPDX identifiers to all remaining files in drivers/tty/ tty: serial: jsm: remove redundant pointer ts tty: serial: jsm: add space before the open parenthesis '(' tty: serial: jsm: fix coding style tty: serial: jsm: delete space between function name and '(' tty: serial: jsm: add blank line after declarations tty: serial: jsm: change the type of local variable tty: serial: imx: remove dead code imx_dma_rxint tty: serial: imx: disable ageing timer interrupt if dma in use serial: 8250: fix potential deadlock in rs485-mode serial: m32r_sio: Drop redundant .data assignment ...
2017-11-08tty: Remove redundant license textGreg Kroah-Hartman1-14/+0
Now that the SPDX tag is in all tty files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Cc: Jiri Slaby <[email protected]> Cc: James Hogan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-11-08tty: add SPDX identifiers to all remaining files in drivers/tty/Greg Kroah-Hartman1-0/+1
It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Update the drivers/tty files files with the correct SPDX license identifier based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Jiri Slaby <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Chris Metcalf <[email protected]> Cc: Jiri Kosina <[email protected]> Cc: David Sterba <[email protected]> Cc: James Hogan <[email protected]> Cc: Rob Herring <[email protected]> Cc: Eric Anholt <[email protected]> Cc: Stefan Wahren <[email protected]> Cc: Florian Fainelli <[email protected]> Cc: Ray Jui <[email protected]> Cc: Scott Branden <[email protected]> Cc: [email protected] Cc: "James E.J. Bottomley" <[email protected]> Cc: Helge Deller <[email protected]> Cc: Joachim Eastwood <[email protected]> Cc: Matthias Brugger <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Tobias Klauser <[email protected]> Cc: Russell King <[email protected]> Cc: Vineet Gupta <[email protected]> Cc: Richard Genoud <[email protected]> Cc: Alexander Shiyan <[email protected]> Cc: Baruch Siach <[email protected]> Cc: "Maciej W. Rozycki" <[email protected]> Cc: "Uwe Kleine-König" <[email protected]> Cc: Pat Gefre <[email protected]> Cc: "Guilherme G. Piccoli" <[email protected]> Cc: Jason Wessel <[email protected]> Cc: Vladimir Zapolskiy <[email protected]> Cc: Sylvain Lemieux <[email protected]> Cc: Carlo Caione <[email protected]> Cc: Kevin Hilman <[email protected]> Cc: Liviu Dudau <[email protected]> Cc: Sudeep Holla <[email protected]> Cc: Lorenzo Pieralisi <[email protected]> Cc: Andy Gross <[email protected]> Cc: David Brown <[email protected]> Cc: "Andreas Färber" <[email protected]> Cc: Kevin Cernekee <[email protected]> Cc: Laxman Dewangan <[email protected]> Cc: Thierry Reding <[email protected]> Cc: Jonathan Hunter <[email protected]> Cc: Barry Song <[email protected]> Cc: Patrice Chotard <[email protected]> Cc: Maxime Coquelin <[email protected]> Cc: Alexandre Torgue <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Peter Korsgaard <[email protected]> Cc: Timur Tabi <[email protected]> Cc: Tony Prisk <[email protected]> Cc: Michal Simek <[email protected]> Cc: "Sören Brinkmann" <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Kate Stewart <[email protected]> Cc: Philippe Ombredanne <[email protected]> Cc: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-10-05timer: Remove expires and data arguments from DEFINE_TIMERKees Cook1-1/+1
Drop the arguments from the macro and adjust all callers with the following script: perl -pi -e 's/DEFINE_TIMER\((.*), 0, 0\);/DEFINE_TIMER($1);/g;' \ $(git grep DEFINE_TIMER | cut -d: -f1 | sort -u | grep -v timer.h) Signed-off-by: Kees Cook <[email protected]> Acked-by: Geert Uytterhoeven <[email protected]> # for m68k parts Acked-by: Guenter Roeck <[email protected]> # for watchdog parts Acked-by: David S. Miller <[email protected]> # for networking parts Acked-by: Greg Kroah-Hartman <[email protected]> Acked-by: Kalle Valo <[email protected]> # for wireless parts Acked-by: Arnd Bergmann <[email protected]> Cc: [email protected] Cc: Petr Mladek <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Lai Jiangshan <[email protected]> Cc: Sebastian Reichel <[email protected]> Cc: Kalle Valo <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Pavel Machek <[email protected]> Cc: [email protected] Cc: Chris Metcalf <[email protected]> Cc: [email protected] Cc: [email protected] Cc: "James E.J. Bottomley" <[email protected]> Cc: Wim Van Sebroeck <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Ursula Braun <[email protected]> Cc: Viresh Kumar <[email protected]> Cc: Harish Patil <[email protected]> Cc: Stephen Boyd <[email protected]> Cc: Michael Reed <[email protected]> Cc: Manish Chopra <[email protected]> Cc: Len Brown <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: [email protected] Cc: Heiko Carstens <[email protected]> Cc: Tejun Heo <[email protected]> Cc: Julian Wiedmann <[email protected]> Cc: John Stultz <[email protected]> Cc: Mark Gross <[email protected]> Cc: [email protected] Cc: [email protected] Cc: "Martin K. Petersen" <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: "Rafael J. Wysocki" <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Stefan Richter <[email protected]> Cc: Guenter Roeck <[email protected]> Cc: [email protected] Cc: Martin Schwidefsky <[email protected]> Cc: Andrew Morton <[email protected]> Cc: [email protected] Cc: Sudip Mukherjee <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2017-06-13tty: rocket: drop broken alt-speed supportJohan Hovold1-21/+6
Setting an alt_speed using the ROCKET_SPD flags has been deprecated since v2.1.69, and has been broken since commit 6865ff222cca ("TTY: do not warn about setting speed via SPD_*") without anyone noticing. To make things worse commit 6df3526b6649 ("rocket: first pass at termios reporting") in v2.6.25 started reporting back the actual baud rate used, something which also required 38400 to again be set whenever changing a SPD flag. Drop the broken alt-speed handling altogether, and add a ratelimited warning about using TIOCCSERIAL to change speed as being deprecated. Note that the rocket driver has never supported using a custom divisor (ASYNC_SPD_CUST equivalent). Signed-off-by: Johan Hovold <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Alan Cox <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-04-20Annotate hardware config module parameters in drivers/tty/David Howells1-5/+5
When the kernel is running in secure boot mode, we lock down the kernel to prevent userspace from modifying the running kernel image. Whilst this includes prohibiting access to things like /dev/mem, it must also prevent access by means of configuring driver modules in such a way as to cause a device to access or modify the kernel image. To this end, annotate module_param* statements that refer to hardware configuration and indicate for future reference what type of parameter they specify. The parameter parser in the core sees this information and can skip such parameters with an error message if the kernel is locked down. The module initialisation then runs as normal, but just sees whatever the default values for those parameters is. Note that we do still need to do the module initialisation because some drivers have viable defaults set in case parameters aren't specified and some drivers support automatic configuration (e.g. PNP or PCI) in addition to manually coded parameters. This patch annotates drivers in drivers/tty/. Suggested-by: Alan Cox <[email protected]> Signed-off-by: David Howells <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> cc: Jiri Slaby <[email protected]> cc: [email protected]
2016-11-10tty: rocket: fix invalid user-pointer checksJohan Hovold1-4/+0
Drop invalid user-pointer checks from custom ioctl handlers. A NULL-pointer can be valid in user space and copy_to_user() takes care of sanity checking. Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-04-30TTY: add __init attributeJulia Lawall1-1/+2
Add __init attribute on a function that is only called from other __init functions and that is not inlined, at least with gcc version 4.8.4 on an x86 machine with allyesconfig. Currently, the function is put in the .text.unlikely segment. Declaring it as __init will cause it to be put in the .init.text and to disappear after initialization. The result of objdump -x on the function before the change is as follows: 000000000000014c l F .text.unlikely 0000000000000a2e init_r_port And after the change it is as follows: 0000000000000000 l F .init.text 0000000000000a29 init_r_port Done with the help of Coccinelle. The semantic patch checks for local static non-init functions that are called from an __init function and are not called from any other function. Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-04-30tty: Replace ASYNC_INITIALIZED bit and update atomicallyPeter Hurley1-5/+5
Replace ASYNC_INITIALIZED bit in the tty_port::flags field with TTY_PORT_INITIALIZED bit in the tty_port::iflags field. Introduce helpers tty_port_set_initialized() and tty_port_initialized() to abstract atomic bit ops. Note: the transforms for test_and_set_bit() and test_and_clear_bit() are unnecessary as the state transitions are already mutually exclusive; the tty lock prevents concurrent open/close/hangup. Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-04-30tty: Replace ASYNC_NORMAL_ACTIVE bit and update atomicallyPeter Hurley1-2/+3
Replace ASYNC_NORMAL_ACTIVE bit in the tty_port::flags field with TTY_PORT_ACTIVE bit in the tty_port::iflags field. Introduce helpers tty_port_set_active() and tty_port_active() to abstract atomic bit ops. Extract state changes from port lock sections, as this usage is broken and confused; the state transitions are protected by the tty lock (which mutually excludes parallel open/close/hangup), and no user tests the active state while holding the port lock. Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28tty: Remove ASYNC_CLOSINGPeter Hurley1-1/+1
The tty core no longer provides nor uses ASYNC_CLOSING; remove from tty_port_close_start() and tty_port_close_end() as well as tty drivers which open-code these state changes. Unfortunately, even though the bit is masked from userspace, its inclusion in a uapi header precludes removing the macro. Cc: Martin Schwidefsky <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: [email protected] Cc: Mikael Starvik <[email protected]> Cc: Jesper Nilsson <[email protected]> Cc: [email protected] Cc: Samuel Ortiz <[email protected]> Cc: "David S. Miller" <[email protected]> Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28tty: Use termios c_*flag macrosPeter Hurley1-4/+4
Expressions of the form "tty->termios.c_*flag & FLAG" are more clearly expressed with the termios flags macros, I_FLAG(), C_FLAG(), O_FLAG(), and L_FLAG(). Convert treewide. Signed-off-by: Peter Hurley <[email protected]> Acked-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28tty: rocket: Remove private close_waitPeter Hurley1-2/+0
This driver's private completion variable, close_wait, is no longer used for wait since "tty: Remove ASYNC_CLOSING checks in open()/hangup"; remove. Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-27tty: Remove chars_in_buffer() line discipline methodPeter Hurley1-4/+2
The chars_in_buffer() line discipline method serves no functional purpose, other than as a (dubious) debugging aid for mostly bit-rotting drivers. Despite being documented as an optional method, every caller is unconditionally executed (although conditionally compiled). Furthermore, direct tty->ldisc access without an ldisc ref is unsafe. Lastly, N_TTY's chars_in_buffer() has warned of removal since 3.12. Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-10-17tty: Remove tty_port::close_waitPeter Hurley1-1/+0
With the removal of tty_wait_until_sent_from_close(), tty drivers no longer wait during open for parallel closes to complete (instead, the tty core waits before calling the driver open() method). Thus, the close_wait waitqueue is no longer used for waiting. Remove struct tty_port::close_wait. Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-10-17tty: Remove ASYNC_CLOSING checks in open()/hangup() methodsPeter Hurley1-12/+0
Since at least before 2.6.30, tty drivers that do not drop the tty lock while closing cannot observe ASYNC_CLOSING set while holding the tty lock; this includes the tty driver's open() and hangup() methods, since the tty core calls these methods holding the tty lock. For these drivers, waiting for ASYNC_CLOSING to clear while opening is not required, since this condition cannot occur. Similarly, even when the open() method drops and reacquires the tty lock after blocking, ASYNC_CLOSING cannot be set (again, for drivers that do not drop the tty lock while closing). Now that tty port drivers no longer drop the tty lock while closing (since 'tty: Remove tty_wait_until_sent_from_close()'), the same conditions apply: waiting for ASYNC_CLOSING to clear while opening is not required, nor is re-checking ASYNC_CLOSING after dropping and reacquiring the tty lock while blocking (eg., in *_block_til_ready()). Note: The ASYNC_CLOSING flag state is still maintained since several bitrotting drivers use it for (dubious) other purposes. Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-01-09TTY: fix misspelling of current function in stringJulia Lawall1-2/+2
Replace a misspelled function name by %s and then __func__. This was done using Coccinelle, including the use of Levenshtein distance, as proposed by Rasmus Villemoes. Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-12-08tty: remove DEFINE_PCI_DEVICE_TABLE macroJingoo Han1-1/+1
Don't use DEFINE_PCI_DEVICE_TABLE macro, because this macro is not preferred. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-05-20TTY: rocket, fix more no-PCI warningsJiri Slaby1-147/+141
Commit "TTY: rocket, fix compilation warning" fixed a compilation warning, but there was still a problem with !CONFIG_PCI configs. So fix them for good by coupling the PCI functions together and moving them inside a common #ifdef. Signed-off-by: Jiri Slaby <[email protected]> Reported-by: kbuild test robot <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-04-15TTY: rocket, fix compilation warningJiri Slaby1-19/+21
When CONFIG_PCI is unset, we see these warnings in rocket: drivers/tty/rocket.c:3140:13: warning: 'rmSpeakerReset' defined but not used drivers/tty/rocket.c:2599:12: warning: 'sPCIInitController' defined but not used Fix those by moving the functions to one place and make them depend on CONFIG_PCI. Signed-off-by: Jiri Slaby <[email protected]> Reported-by: Toralf Foerster <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-03-18TTY: cleanup tty->hw_stopped usesJiri Slaby1-11/+8
tty->hw_stopped is set only by drivers to remember HW state. If it is never set to 1 in a particular driver, there is no need to check it in the driver at all. Remove such checks. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-03-18TTY: add tty_port_tty_hangup helperJiri Slaby1-6/+1
It allows for cleaning up on a considerable amount of places. They did port_get, hangup, kref_put. Now the only thing needed is to call tty_port_tty_hangup which does exactly that. And they can also decide whether to consider CLOCAL or completely ignore that. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-01-17tty: rocket: Explicitly list supported PCI IDsKevin Cernekee1-3/+25
Matching PCI_ANY_ID causes conflicts with RocketPort 2 adapters, which are supported by a different driver. Signed-off-by: Kevin Cernekee <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-01-15tty: add parenthesis to macro POLL_PERIOD in rocket.cCong Ding1-1/+1
Macros should be enclosed in parenthesis Signed-off-by: Cong Ding <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-01-15TTY: switch tty_flip_buffer_pushJiri Slaby1-14/+11
Now, we start converting tty buffer functions to actually use tty_port. This will allow us to get rid of the need of tty in many call sites. Only tty_port will needed and hence no more tty_port_tty_get in those paths. Now, the one where most of tty_port_tty_get gets removed: tty_flip_buffer_push. IOW we also closed all the races in drivers not using tty_port_tty_get at all yet. Also we move tty_flip_buffer_push declaration from include/linux/tty.h to include/linux/tty_flip.h to all others while we are changing it anyway. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-01-15TTY: switch tty_insert_flip_charJiri Slaby1-1/+2
Now, we start converting tty buffer functions to actually use tty_port. This will allow us to get rid of the need of tty in many call sites. Only tty_port will needed and hence no more tty_port_tty_get in those paths. tty_insert_flip_char is the next one to proceed. This one is used all over the code, so the patch is huge. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-01-15TTY: convert more flipping functionsJiri Slaby1-1/+1
Now, we start converting tty buffer functions to actually use tty_port. This will allow us to get rid of the need of tty pointer in many call sites. Only tty_port will be needed and hence no more tty_port_tty_get calls in those paths. Now 4 string flipping ones are on turn: * tty_insert_flip_string_flags * tty_insert_flip_string_fixed_flag * tty_prepare_flip_string * tty_prepare_flip_string_flags Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-11-21tty: remove use of __devinitdataBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devinitdata is no longer needed. Signed-off-by: Bill Pemberton <[email protected]> Cc: Alan Cox <[email protected]> Cc: Peter Korsgaard <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-11-15TTY: call tty_port_destroy in the rest of driversJiri Slaby1-0/+2
After commit "TTY: move tty buffers to tty_port", the tty buffers are not freed in some drivers. This is because tty_port_destructor is not called whenever a tty_port is freed. This was an assumption I counted with but was unfortunately untrue. So fix the drivers to fulfil this assumption. To be sure, the TTY buffers (and later some stuff) are gone along with the tty_port, we have to call tty_port_destroy at tear-down places. This is mostly where the structure containing a tty_port is freed. This patch does exactly that -- put tty_port_destroy at those places. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-08-13TTY: use tty_port_register_deviceJiri Slaby1-2/+2
Currently we have no way to assign tty->port while performing tty installation. There are two ways to provide the link tty_struct => tty_port. Either by calling tty_port_install from tty->ops->install or tty_port_register_device called instead of tty_register_device when the device is being set up after connected. In this patch we modify most of the drivers to do the latter. When the drivers use tty_register_device and we have tty_port already, we switch to tty_port_register_device. So we have the tty_struct => tty_port link for free for those. Signed-off-by: Jiri Slaby <[email protected]> Acked-by: Alan Cox <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-07-16tty: move the termios object into the ttyAlan Cox1-9/+9
This will let us sort out a whole pile of tty related races. The alternative would be to keep points and refcount the termios objects. However 1. They are tiny anyway 2. Many devices don't use the stored copies 3. We can remove a pty special case Signed-off-by: Alan Cox <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-03-08TTY: remove unneeded tty->index checksJiri Slaby1-3/+3
Checking if tty->index is in bounds is not needed. The tty has the index set in the initial open. This is done in get_tty_driver. And it can be only in interval <0,driver->num). So remove the tests which check exactly this interval. Some are left untouched as they check against the current backing device count. (Leaving apart that the check is racy in most of the cases.) Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-03-08TTY: remove re-assignments to tty_driver membersJiri Slaby1-1/+0
All num, magic and owner are set by alloc_tty_driver. No need to re-set them on each allocation site. pti driver sets something different to what it passes to alloc_tty_driver. It is not a bug, since we don't use the lines parameter in any way. Anyway this is fixed, and now we do the right thing. Signed-off-by: Jiri Slaby <[email protected]> Acked-by: Tilman Schmidt <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-01-13module_param: make bool parameters really bool (drivers & misc)Rusty Russell1-1/+1
module_param(bool) used to counter-intuitively take an int. In fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy trick. It's time to remove the int/unsigned int option. For this version it'll simply give a warning, but it'll break next kernel version. Acked-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Rusty Russell <[email protected]>
2011-07-26atomic: use <linux/atomic.h>Arun Sharma1-1/+1
This allows us to move duplicated code in <asm/atomic.h> (atomic_inc_not_zero() for now) to <linux/atomic.h> Signed-off-by: Arun Sharma <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: David Miller <[email protected]> Cc: Eric Dumazet <[email protected]> Acked-by: Mike Frysinger <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-04-19TTY: rocket, remove unused variablesJiri Slaby1-47/+0
drivers/tty/rocket.c:1393:2: warning: Value stored to 'cp' is never read cp = &info->channel; ^ ~~~~~~~~~~~~~~ drivers/tty/rocket.c:1412:2: warning: Value stored to 'cp' is never read cp = &info->channel; ^ ~~~~~~~~~~~~~~ drivers/tty/rocket.c:1730:2: warning: Value stored to 'cp' is never read cp = &info->channel; ^ ~~~~~~~~~~~~~~ drivers/tty/rocket.c:1825:3: warning: Value stored to 'str' is never read str = "8"; ^ ~~~ [many 'str' warnings stripped] drivers/tty/rocket.c:2037:3: warning: Value stored to 'board_type' is never read board_type = "RocketModem"; ^ ~~~~~~~~~~~~~ [some 'board_type' warnings stripped] Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-03-31Fix common misspellingsLucas De Marchi1-2/+2
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <[email protected]>
2011-02-22tty: move a number of tty drivers from drivers/char/ to drivers/tty/Greg Kroah-Hartman1-0/+3199
As planned by Arnd Bergmann, this moves the following drivers from drivers/char/ to drivers/tty/ as that's where they really belong: amiserial nozomi synclink rocket cyclades moxa mxser isicom bfin_jtag_comm Cc: Arnd Bergmann <[email protected]> Cc: Alan Cox <[email protected]> Cc: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>