linux-stable/arch/um
Johannes Berg ab11cd8bcf um: line: Use separate IRQs per line
[ Upstream commit d5a9597d69 ]

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 <j@w1.fi>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-By: anton ivanov <anton.ivanov@cambridgegreys.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-14 18:41:39 +02:00
..
configs kunit: Move default config from arch/um -> tools/testing/kunit 2021-06-23 17:49:17 -06:00
drivers um: line: Use separate IRQs per line 2022-06-14 18:41:39 +02:00
include um: line: Use separate IRQs per line 2022-06-14 18:41:39 +02:00
kernel ptrace/um: Replace PT_DTRACE with TIF_SINGLESTEP 2022-06-09 10:25:16 +02:00
os-Linux um: Use swap() to make code cleaner 2021-12-21 21:41:04 +01:00
scripts
.gitignore um: gitignore: Add kernel/capflags.c 2021-12-21 21:22:43 +01:00
Kbuild kbuild: require all architectures to have arch/$(SRCARCH)/Kbuild 2021-05-26 23:10:37 +09:00
Kconfig Peter Zijlstra says: 2022-01-11 17:24:45 -08:00
Kconfig.debug
Makefile kbuild: do not require sub-make for separate output tree builds 2021-08-10 08:23:39 +09:00
Makefile-os-Linux
Makefile-skas