aboutsummaryrefslogtreecommitdiff
path: root/arch/um/drivers/line.c
AgeCommit message (Collapse)AuthorFilesLines
2024-07-04um: line: always fill *error_out in setup_one_line()Johannes Berg1-0/+2
The pointer isn't initialized by callers, but I have encountered cases where it's still printed; initialize it in all possible cases in setup_one_line(). Link: https://patch.msgid.link/20240703172235.ad863568b55f.Iaa1eba4db8265d7715ba71d5f6bb8c7ff63d27e9@changeid Acked-By: Anton Ivanov <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2024-04-22um: Add winch to winch_handlers before registering winch IRQRoberto Sassu1-6/+8
Registering a winch IRQ is racy, an interrupt may occur before the winch is added to the winch_handlers list. If that happens, register_winch_irq() adds to that list a winch that is scheduled to be (or has already been) freed, causing a panic later in winch_cleanup(). Avoid the race by adding the winch to the winch_handlers list before registering the IRQ, and rolling back if um_request_irq() fails. Fixes: 42a359e31a0e ("uml: SIGIO support cleanup") Signed-off-by: Roberto Sassu <[email protected]> Reviewed-by: Johannes Berg <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
2024-01-18Merge tag 'tty-6.8-rc1' of ↵Linus Torvalds1-1/+1
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 and serial driver changes for 6.8-rc1. As usual, Jiri has a bunch of refactoring and cleanups for the tty core and drivers in here, along with the usual set of rs485 updates (someday this might work properly...) Along with those, in here are changes for: - sc16is7xx serial driver updates - platform driver removal api updates - amba-pl011 driver updates - tty driver binding updates - other small tty/serial driver updates and changes All of these have been in linux-next for a while with no reported issues" * tag 'tty-6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (197 commits) serial: sc16is7xx: refactor EFR lock serial: sc16is7xx: reorder code to remove prototype declarations serial: sc16is7xx: refactor FIFO access functions to increase commonality serial: sc16is7xx: drop unneeded MODULE_ALIAS serial: sc16is7xx: replace hardcoded divisor value with BIT() macro serial: sc16is7xx: add explicit return for some switch default cases serial: sc16is7xx: add macro for max number of UART ports serial: sc16is7xx: add driver name to struct uart_driver serial: sc16is7xx: use i2c_get_match_data() serial: sc16is7xx: use spi_get_device_match_data() serial: sc16is7xx: use DECLARE_BITMAP for sc16is7xx_lines bitfield serial: sc16is7xx: improve do/while loop in sc16is7xx_irq() serial: sc16is7xx: remove obsolete loop in sc16is7xx_port_irq() serial: sc16is7xx: set safe default SPI clock frequency serial: sc16is7xx: add check for unsupported SPI modes during probe serial: sc16is7xx: fix invalid sc16is7xx_lines bitfield in case of probe error serial: 8250_exar: Set missing rs485_supported flag serial: omap: do not override settings for RS485 support serial: core, imx: do not set RS485 enabled if it is not supported serial: core: make sure RS485 cannot be enabled when it is not supported ...
2024-01-04um: Reap winch thread if it failsBenjamin Berg1-5/+8
When the winch thread runs into an error condition, it would exit(1) and never be reaped until shutdown time. Change this to write a command byte which causes the driver to kill it, therefore reaping the child. Signed-off-by: Benjamin Berg <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
2023-12-08tty: um: convert to u8/__u8 and size_tJiri Slaby (SUSE)1-1/+1
Switch character types to u8 and sizes to size_t. To conform to characters/sizes in the rest of the tty layer. Note we use __u8 in the userspace files. Signed-off-by: "Jiri Slaby (SUSE)" <[email protected]> Cc: Richard Weinberger <[email protected]> Cc: Anton Ivanov <[email protected]> Cc: Johannes Berg <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2023-08-11tty: make tty_operations::write()'s count size_tJiri Slaby (SUSE)1-1/+1
Unify with the rest of the code. Use size_t for counts and ssize_t for retval. Signed-off-by: "Jiri Slaby (SUSE)" <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2023-08-11tty: propagate u8 data to tty_operations::write()Jiri Slaby (SUSE)1-1/+1
Data are now typed as u8. Propagate this change to tty_operations::write(). Signed-off-by: "Jiri Slaby (SUSE)" <[email protected]> Cc: Richard Henderson <[email protected]> Cc: Ivan Kokshaysky <[email protected]> Cc: Matt Turner <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Richard Weinberger <[email protected]> Cc: Anton Ivanov <[email protected]> Cc: Johannes Berg <[email protected]> Cc: Chris Zankel <[email protected]> Cc: Max Filippov <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Vaibhav Gupta <[email protected]> Cc: Jens Taprogge <[email protected]> Cc: Karsten Keil <[email protected]> Cc: Scott Branden <[email protected]> Cc: Ulf Hansson <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Eric Dumazet <[email protected]> Cc: Jakub Kicinski <[email protected]> Cc: Paolo Abeni <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Vasily Gorbik <[email protected]> Cc: Alexander Gordeev <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: Sven Schnelle <[email protected]> Cc: David Lin <[email protected]> Cc: Johan Hovold <[email protected]> Cc: Alex Elder <[email protected]> Cc: Laurentiu Tudor <[email protected]> Cc: Jiri Kosina <[email protected]> Cc: David Sterba <[email protected]> Cc: Shawn Guo <[email protected]> Cc: Sascha Hauer <[email protected]> Cc: Pengutronix Kernel Team <[email protected]> Cc: Fabio Estevam <[email protected]> Cc: NXP Linux Team <[email protected]> Cc: Arnaud Pouliquen <[email protected]> Cc: Oliver Neukum <[email protected]> Cc: Mathias Nyman <[email protected]> Cc: Marcel Holtmann <[email protected]> Cc: Johan Hedberg <[email protected]> Cc: Luiz Augusto von Dentz <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-05-27um: line: Use separate IRQs per lineJohannes Berg1-9/+13
Today, all possible serial lines (ssl*=) as well as all possible consoles (con*=) each share a single interrupt (with a fixed number) with others of the same type. Now, if you have two lines, say ssl0 and ssl1, and one of them is connected to an fd you cannot read (e.g. a file), but the other gets a read interrupt, then both of them get the interrupt since it's shared. Then, the read() call will return EOF, since it's a file being written and there's nothing to read (at least not at the current offset, at the end). Unfortunately, this is treated as a read error, and we close this line, losing all the possible output. It might be possible to work around this and make the IRQ sharing work, however, now that we have dynamically allocated IRQs that are easy to use, simply use that to achieve separating between the events; then there's no interrupt for that line and we never attempt the read in the first place, thus not closing the line. This manifested itself in the wifi hostap/hwsim tests where the parallel script communicates via one serial console and the kernel messages go to another (a file) and sending data on the communication console caused the kernel messages to stop flowing into the file. Reported-by: Jouni Malinen <[email protected]> Signed-off-by: Johannes Berg <[email protected]> Acked-By: anton ivanov <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
2021-07-27tty: drop put_tty_driverJiri Slaby1-1/+1
put_tty_driver() is an alias for tty_driver_kref_put(). There is no need for two exported identical functions, therefore switch all users of old put_tty_driver() to new tty_driver_kref_put() and remove the former for good. Cc: Richard Henderson <[email protected]> Cc: Ivan Kokshaysky <[email protected]> Cc: Matt Turner <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Jeff Dike <[email protected]> Cc: Richard Weinberger <[email protected]> Cc: Anton Ivanov <[email protected]> Cc: Chris Zankel <[email protected]> Cc: Max Filippov <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Samuel Iglesias Gonsalvez <[email protected]> Cc: Jens Taprogge <[email protected]> Cc: Karsten Keil <[email protected]> Cc: Scott Branden <[email protected]> Cc: Ulf Hansson <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Jakub Kicinski <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Vasily Gorbik <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: David Lin <[email protected]> Cc: Johan Hovold <[email protected]> Cc: Alex Elder <[email protected]> Cc: Jiri Slaby <[email protected]> Cc: Laurentiu Tudor <[email protected]> Cc: Jiri Kosina <[email protected]> Cc: David Sterba <[email protected]> Cc: Shawn Guo <[email protected]> Cc: Sascha Hauer <[email protected]> Cc: Pengutronix Kernel Team <[email protected]> Cc: Fabio Estevam <[email protected]> Cc: NXP Linux Team <[email protected]> Cc: Oliver Neukum <[email protected]> Cc: Felipe Balbi <[email protected]> Cc: Mathias Nyman <[email protected]> Cc: Marcel Holtmann <[email protected]> Cc: Johan Hedberg <[email protected]> Cc: Luiz Augusto von Dentz <[email protected]> Acked-by: Alex Elder <[email protected]> Acked-by: Christian Borntraeger <[email protected]> Acked-by: Max Filippov <[email protected]> Acked-by: David Sterba <[email protected]> Acked-by: Samuel Iglesias Gonsálvez <[email protected]> Signed-off-by: Jiri Slaby <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-07-27tty: stop using alloc_tty_driverJiri Slaby1-5/+6
alloc_tty_driver was deprecated by tty_alloc_driver in commit 7f0bc6a68ed9 (TTY: pass flags to alloc_tty_driver) in 2012. I never got into eliminating alloc_tty_driver until now. So we still have two functions for allocating drivers which might be confusing. So get rid of alloc_tty_driver uses to eliminate it for good in the next patch. Note we need to switch return value checking as tty_alloc_driver uses ERR_PTR. And flags are now a parameter of tty_alloc_driver. Cc: Richard Henderson <[email protected]>(odd fixer:ALPHA PORT) Cc: Ivan Kokshaysky <[email protected]> Cc: Matt Turner <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: "James E.J. Bottomley" <[email protected]> Cc: Helge Deller <[email protected]> Cc: Jeff Dike <[email protected]> Cc: Richard Weinberger <[email protected]> Cc: Anton Ivanov <[email protected]> Cc: Chris Zankel <[email protected]> Cc: Max Filippov <[email protected]> Cc: Samuel Iglesias Gonsalvez <[email protected]> Cc: Jens Taprogge <[email protected]> Cc: Karsten Keil <[email protected]> Cc: Ulf Hansson <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Jakub Kicinski <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Vasily Gorbik <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: Laurentiu Tudor <[email protected]> Cc: Jiri Kosina <[email protected]> Cc: David Sterba <[email protected]> Cc: Shawn Guo <[email protected]> Cc: Sascha Hauer <[email protected]> Cc: Oliver Neukum <[email protected]> Cc: Felipe Balbi <[email protected]> Cc: Johan Hovold <[email protected]> Cc: Marcel Holtmann <[email protected]> Cc: Johan Hedberg <[email protected]> Cc: Luiz Augusto von Dentz <[email protected]> Acked-by: Samuel Iglesias Gonsálvez <[email protected]> Acked-by: Max Filippov <[email protected]> Acked-by: David Sterba <[email protected]> Acked-by: Christian Borntraeger <[email protected]> Signed-off-by: Jiri Slaby <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-05-13tty: remove empty tty_operations::set_termiosJiri Slaby1-5/+0
tty_operations::set_termios is optional. If it doesn't exist, nothing is called. So remove almost¹ empty set_termios implementations. ¹ capi had an useless pr_debug in it. Signed-off-by: Jiri Slaby <[email protected]> Cc: Jeff Dike <[email protected]> Cc: Richard Weinberger <[email protected]> Cc: Karsten Keil <[email protected]> Acked-By: Anton Ivanov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-05-13tty: make tty_operations::chars_in_buffer return uintJiri Slaby1-2/+2
tty_operations::chars_in_buffer is another hook which is expected to return values >= 0. So make it explicit by the return type too -- use unsigned int. Signed-off-by: Jiri Slaby <[email protected]> Acked-By: Anton Ivanov <[email protected]> Acked-by: David Sterba <[email protected]> Cc: Jeff Dike <[email protected]> Cc: Richard Weinberger <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Samuel Iglesias Gonsalvez <[email protected]> Cc: Jens Taprogge <[email protected]> Cc: Karsten Keil <[email protected]> Cc: Ulf Hansson <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Jakub Kicinski <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Vasily Gorbik <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: David Lin <[email protected]> Cc: Johan Hovold <[email protected]> Cc: Alex Elder <[email protected]> Cc: Jiri Kosina <[email protected]> Cc: Shawn Guo <[email protected]> Cc: Sascha Hauer <[email protected]> Cc: Oliver Neukum <[email protected]> Cc: Felipe Balbi <[email protected]> Cc: Mathias Nyman <[email protected]> Cc: Marcel Holtmann <[email protected]> Cc: Johan Hedberg <[email protected]> Cc: Luiz Augusto von Dentz <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-05-13tty: make tty_operations::write_room return uintJiri Slaby1-3/+3
Line disciplines expect a positive value or zero returned from tty->ops->write_room (invoked by tty_write_room). So make this assumption explicit by using unsigned int as a return value. Both of tty->ops->write_room and tty_write_room. Signed-off-by: Jiri Slaby <[email protected]> Acked-by: Laurentiu Tudor <[email protected]> Acked-by: Alex Elder <[email protected]> Acked-by: Max Filippov <[email protected]> # xtensa Acked-by: David Sterba <[email protected]> Acked-By: Anton Ivanov <[email protected]> Acked-by: Geert Uytterhoeven <[email protected]> Cc: Richard Henderson <[email protected]> Cc: Ivan Kokshaysky <[email protected]> Cc: Matt Turner <[email protected]> Cc: "James E.J. Bottomley" <[email protected]> Cc: Helge Deller <[email protected]> Cc: Jeff Dike <[email protected]> Cc: Richard Weinberger <[email protected]> Cc: Chris Zankel <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Samuel Iglesias Gonsalvez <[email protected]> Cc: Jens Taprogge <[email protected]> Cc: Karsten Keil <[email protected]> Cc: Scott Branden <[email protected]> Cc: Ulf Hansson <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Jakub Kicinski <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Vasily Gorbik <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: David Lin <[email protected]> Cc: Johan Hovold <[email protected]> Cc: Jiri Kosina <[email protected]> Cc: Shawn Guo <[email protected]> Cc: Sascha Hauer <[email protected]> Cc: Oliver Neukum <[email protected]> Cc: Felipe Balbi <[email protected]> Cc: Mathias Nyman <[email protected]> Cc: Marcel Holtmann <[email protected]> Cc: Johan Hedberg <[email protected]> Cc: Luiz Augusto von Dentz <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-12-13um: Support dynamic IRQ allocationJohannes Berg1-6/+12
It's cumbersome and error-prone to keep adding fixed IRQ numbers, and for proper device wakeup support for the virtio/vhost-user support we need to have different IRQs for each device. Even if in theory two IRQs (with and without wake) might be sufficient, it's much easier to reason about it when we have dynamic number assignment. It also makes it easier to add new devices that may dynamically exist or depending on the configuration, etc. Add support for this, up to 64 IRQs (the same limit as epoll FDs we have right now). Since it's not easy to port all the existing places to dynamic allocation (some data is statically initialized) keep the low numbers are reserved for the existing hard-coded IRQ numbers. Acked-By: Anton Ivanov <[email protected]> Signed-off-by: Johannes Berg <[email protected]> Acked-By: Anton Ivanov <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
2020-12-13um: line: Don't free winch (with IRQ) under spinlockJohannes Berg1-4/+8
Lockdep correctly complains that one shouldn't call um_free_irq() with free_irq() inside under a spinlock since that will attempt to acquire a mutex. Rearrange the code to keep the list manipulations under the lock while moving the actual freeing outside of it, to avoid this. In particular, this removes the lockdep complaint at shutdown that I was seeing with lockdep enabled. Signed-off-by: Johannes Berg <[email protected]> Acked-By: [email protected] Signed-off-by: Richard Weinberger <[email protected]>
2020-06-24um: line, remove put_charJiri Slaby1-5/+0
um's put_char only calls write. And the tty layer/disciplines do the same if put_char is NULL. So we can safely remove this put_char wrapper. Signed-off-by: Jiri Slaby <[email protected]> Cc: Jeff Dike <[email protected]> Cc: Richard Weinberger <[email protected]> Cc: Anton Ivanov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-09-15um: Add SPDX headers for files in arch/um/driversAlex Dewar1-1/+1
Convert files to use SPDX header. All files are licensed under the GPLv2. Signed-off-by: Alex Dewar <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
2018-12-27um: Remove obsolete reenable_XX callsAnton Ivanov1-10/+0
reenable_fd has been a NOP since the introduction of the EPOLL based interrupt controller. reenable_channel() is no longer needed as the flow control is now handled via the write IRQs on the channel. Signed-off-by: Anton Ivanov <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
2018-10-29um: Make line/tty semantics use true write IRQAnton Ivanov1-2/+2
This fixes a long standing bug where large amounts of output could freeze the tty (most commonly seen on stdio console). While the bug has always been there it became more pronounced after moving to the new interrupt controller. The line semantics are now changed to have true IRQ write semantics which should further improve the tty/line subsystem stability and performance Signed-off-by: Anton Ivanov <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
2018-02-19Epoll based IRQ controllerAnton Ivanov1-1/+1
1. Removes the need to walk the IRQ/Device list to determine who triggered the IRQ. 2. Improves scalability (up to several times performance improvement for cases with 10s of devices). 3. Improves UML baseline IO performance for one disk + one NIC use case by up to 10%. 4. Introduces write poll triggered IRQs. 5. Prerequisite for introducing high performance mmesg family of functions in network IO. 6. Fixes RNG shutdown which was leaking a file descriptor Signed-off-by: Anton Ivanov <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
2017-03-02sched/headers: Prepare for new header dependencies before moving code to ↵Ingo Molnar1-1/+2
<linux/sched/signal.h> We are going to split <linux/sched/signal.h> out of <linux/sched.h>, which will have to be picked up from other headers and a couple of .c files. Create a trivial placeholder <linux/sched/signal.h> file that just maps to <linux/sched.h> to make this patch obviously correct and bisectable. Include the new header in the files that are going to need it. Acked-by: Linus Torvalds <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Signed-off-by: Ingo Molnar <[email protected]>
2014-11-05uml: Fix unsafe pid reference to foreground process groupPeter Hurley1-1/+5
Although the tty core maintains a pid reference for the foreground process group, if the foreground process group is changed that pid reference is dropped. Thus, the pid reference used for signalling could become stale. Safely obtain a pid reference to the foreground process group and release the reference after signalling is complete. cc: Jeff Dike <[email protected]> Acked-by: Richard Weinberger <[email protected]> Signed-off-by: Peter Hurley <[email protected]> Reviewed-by: Alan Cox <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-03-21Merge 3.9-rc3 into tty-nextGreg Kroah-Hartman1-18/+24
2013-03-18TTY: add tty_port_tty_wakeup helperJiri Slaby1-7/+1
It allows for cleaning up on a considerable amount of places. They did port_get, wakeup, kref_put. Now the only thing needed is to call tty_port_tty_wakeup which does exactly that. One exception is ifx6x60 where tty_wakeup was open-coded. We now call tty_wakeup properly there. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-03-11um: Use tty_port in SIGWINCH handlerRichard Weinberger1-6/+10
The tty below tty_port might get destroyed by the tty layer while we hold a reference to it. So we have to carry tty_port around... Signed-off-by: Richard Weinberger <[email protected]>
2013-03-11um: Use tty_port_operations->destructRichard Weinberger1-12/+14
As we setup the SIGWINCH handler in tty_port_operations->activate it makes sense to tear down it in ->destruct. Signed-off-by: Richard Weinberger <[email protected]>
2013-01-15TTY: switch tty_flip_buffer_pushJiri Slaby1-4/+3
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]>
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-10-10Merge branch 'for-linus-37rc1' of ↵Linus Torvalds1-8/+8
git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml Pull UML changes from Richard Weinberger: "UML receives this time only cleanups. The most outstanding change is the 'include "foo.h"' do 'include <foo.h>' conversion done by Al Viro. It touches many files, that's why the diffstat is rather big." * 'for-linus-37rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml: typo in UserModeLinux-HOWTO hppfs: fix the return value of get_inode() hostfs: drop vmtruncate um: get rid of pointless include "..." where include <...> will do um: move sysrq.h out of include/shared um/x86: merge 32 and 64 bit variants of ptrace.h um/x86: merge 32 and 64bit variants of checksum.h
2012-10-09um: get rid of pointless include "..." where include <...> will doAl Viro1-8/+8
Signed-off-by: Al Viro <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
2012-08-13TTY: use tty_port_register_deviceJiri Slaby1-1/+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-08-01Merge branch 'for-linus-3.6-rc1' of ↵Linus Torvalds1-155/+63
git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml Pull UML fixes from Richard Weinberger: "This patch set contains mostly fixes and cleanups. The UML tty driver uses now tty_port and is no longer broken like hell :-)" * 'for-linus-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml: um: Add arch/x86/um to MAINTAINERS um: pass siginfo to guest process um: fix ubd_file_size for read-only files um: pull interrupt_end() into userspace() um: split syscall_trace(), pass pt_regs to it um: switch UPT_SET_RETURN_VALUE and regs_return_value to pt_regs um: set BLK_CGROUP=y in defconfig um: remove count_lock um: fully use tty_port um: Remove dead code um: remove line_ioctl() TTY: um/line, use tty from tty_port TTY: um/line, add tty_port
2012-07-28um: remove count_lockRichard Weinberger1-6/+0
this lock is no longer needed. Signed-off-by: Richard Weinberger <[email protected]>
2012-07-28um: fully use tty_portRichard Weinberger1-57/+45
... use all tty_port helpers Signed-off-by: Richard Weinberger <[email protected]>
2012-07-28um: remove line_ioctl()Richard Weinberger1-86/+0
line_ioctl() has no real function. Signed-off-by: Richard Weinberger <[email protected]>
2012-07-28TTY: um/line, use tty from tty_portJiri Slaby1-7/+18
This means switching to the tty refcounted model so that we will not race with interrupts. Signed-off-by: Jiri Slaby <[email protected]> Cc: Jeff Dike <[email protected]> Cc: Richard Weinberger <[email protected]> Cc: [email protected] Signed-off-by: Richard Weinberger <[email protected]>
2012-07-28TTY: um/line, add tty_portJiri Slaby1-3/+4
And use count from there. Signed-off-by: Jiri Slaby <[email protected]> Cc: Jeff Dike <[email protected]> Cc: Richard Weinberger <[email protected]> Cc: [email protected] Signed-off-by: Richard Weinberger <[email protected]>
2012-07-19um: remove IRQF_SAMPLE_RANDOM which is now a no-opTheodore Ts'o1-7/+6
With the changes in the random tree, IRQF_SAMPLE_RANDOM is now a no-op; interrupt randomness is now collected unconditionally in a very low-overhead fashion; see commit 775f4b297b. The IRQF_SAMPLE_RANDOM flag was scheduled to be removed in 2009 on the feature-removal-schedule, so this patch is preparation for the final removal of this flag. Signed-off-by: "Theodore Ts'o" <[email protected]> Cc: Jeff Dike <[email protected]> Cc: Richard Weinberger <[email protected]>
2012-05-21um: Implement um_free_irq()Richard Weinberger1-1/+1
Instead of using chip->release() we can achieve the same using a simple wrapper for free_irq(). We have already um_request_irq(), so um_free_irq() is the perfect counterpart. Signed-off-by: Richard Weinberger <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]>
2012-03-25um: deadlock in line_write_interrupt()Al Viro1-0/+1
Signed-off-by: Al Viro <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
2012-03-25um: switch close_chan() to struct lineAl Viro1-1/+1
... and switch chan_interrupt() to directly calling close_one_chan(), so we can lose delay_free_irq argument of close_chan() as well. Signed-off-by: Al Viro <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
2012-03-25um: race fix: initialize delayed_work *before* registering IRQAl Viro1-14/+2
... since chan_interrupt() might schedule it if there's too much incoming data. Kill task argument of chan_interrupt(), while we are at it - it's always &line->task. Signed-off-by: Al Viro <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
2012-03-25um: line->have_irq is never checked...Al Viro1-1/+0
looks like a half-arsed duplicate of line->enabled Signed-off-by: Al Viro <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
2012-03-25um: switch users of ->chan_list to ->chan_{in,out} (easy cases)Al Viro1-12/+12
Signed-off-by: Al Viro <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
2012-03-25um: finally kill ->init_str leaksAl Viro1-1/+3
now we can do that... Signed-off-by: Al Viro <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
2012-03-25um: get rid of lines_init()Al Viro1-21/+10
move config-independent parts of initialization into register_lines(), call setup_one_line() after it instead of abusing ->init_str. Signed-off-by: Al Viro <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
2012-03-25um: switch line.c tty drivers to dynamic device creationAl Viro1-14/+23
Current code doesn't update the symlinks in /sys/dev/char when we add/remove tty lines. Fixing that allows to stop messing with ->valid before the driver registration, which is a Good Thing(tm) - we shouldn't have it set before we really have the things set up and ready for line_open(). We need tty_driver available to call tty_{un,}register_device(), so we just stash a reference to it into struct line_driver. Signed-off-by: Al Viro <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
2012-03-25um: fix races between line_open() and line_config()Al Viro1-28/+26
Pull parse_chan_pair() call into setup_one_line(), under the mutex. We really don't want open() to succeed before parse_chan_pair() had been done (or after it has failed, BTW). We also want "remove con<n>" to free irqs, etc., same as "config con<n>=none". Signed-off-by: Al Viro <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
2012-03-25um: convert count_lock to mutex, fix a race in line_open()Al Viro1-17/+9
If two processes are opening the same line, the second to get into line_open() will decide that it doesn't need to do anything (correctly) or wait for anything. The latter, unfortunately, is incorrect - the first opener might not be through yet. We need to have exclusion covering the entire line_init(), including the blocking parts. Moreover, the next patch will need to widen the exclusion on mconsole side of things, also including the blocking bits, so let's just convert that sucker to mutex... Signed-off-by: Al Viro <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
2012-03-25um: get rid of the init_prio messAl Viro1-41/+28
make line_setup() act on a separate array of conf strings + default conf, have lines array initialized explicitly by that data, bury LINE_INIT() macro from hell. Signed-off-by: Al Viro <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>