linux/drivers/media/rc
Sean Young 30b4e122d7 media: rc: sir_ir: detect presence of port
Without this test, sir_ir clumsy claims resources for a device which
does not exist.

The 0-day kernel test robot reports the following errors (in a loop):
	sir_ir sir_ir.0: Trapped in interrupt
	genirq: Flags mismatch irq 4. 00000000 (ttyS0) vs. 00000000 (sir_ir)

When sir_ir is loaded with the default io and irq, the following happens:
 - sir_ir claims irq 4
 - user space opens /dev/ttyS0
 - in serial8250_do_startup(), some setup is done for ttyS0, which causes
   irq 4 to fire (in THRE test)
 - sir_ir does not realise it was not for it, and spins until the "trapped
   in interrupt"
 - now serial driver calls setup_irq() and fails and we get the
   "Flags mismatch" error.

There is no port present at 0x3e8 so simply check for the presence of a
port, as suggested by Linus.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Tested-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Sean Young <sean@mess.org>
Cc: <stable@vger.kernel.org> # 4.12+
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-11-15 08:57:34 -05:00
..
img-ir media: rc: Convert timers to use timer_setup() 2017-10-31 06:31:44 -04:00
keymaps media: rc: Add Astrometa T2hybrid keymap module 2017-10-31 06:35:02 -04:00
ati_remote.c [media] media: rc: constify usb_device_id 2017-10-04 15:06:09 -03:00
ene_ir.c media: rc: Convert timers to use timer_setup() 2017-10-31 06:31:44 -04:00
ene_ir.h [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
fintek-cir.c media: rc: rename RC_TYPE_* to RC_PROTO_* and RC_BIT_* to RC_PROTO_BIT_* 2017-08-20 10:02:48 -04:00
fintek-cir.h [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
gpio-ir-recv.c [media] media: rc: fix gpio-ir-receiver build failure 2017-10-05 10:16:21 -03:00
gpio-ir-tx.c media: rc: gpio-ir-tx: use ktime accessor functions 2017-08-31 05:35:54 -04:00
igorplugusb.c media: rc: Convert timers to use timer_setup() 2017-10-31 06:31:44 -04:00
iguanair.c media: rc: rename RC_TYPE_* to RC_PROTO_* and RC_BIT_* to RC_PROTO_BIT_* 2017-08-20 10:02:48 -04:00
imon.c media: rc: Convert timers to use timer_setup() 2017-10-31 06:31:44 -04:00
ir-hix5hd2.c media: rc: rename RC_TYPE_* to RC_PROTO_* and RC_BIT_* to RC_PROTO_BIT_* 2017-08-20 10:02:48 -04:00
ir-jvc-decoder.c media: rc: rename RC_TYPE_* to RC_PROTO_* and RC_BIT_* to RC_PROTO_BIT_* 2017-08-20 10:02:48 -04:00
ir-lirc-codec.c media: rc: check for integer overflow 2017-10-11 12:41:52 -04:00
ir-mce_kbd-decoder.c media: rc: Convert timers to use timer_setup() 2017-10-31 06:31:44 -04:00
ir-nec-decoder.c media: rc: nec decoder should not send both repeat and keycode 2017-10-11 12:37:53 -04:00
ir-rc5-decoder.c media: rc: rename RC_TYPE_* to RC_PROTO_* and RC_BIT_* to RC_PROTO_BIT_* 2017-08-20 10:02:48 -04:00
ir-rc6-decoder.c media: rc: rename RC_TYPE_* to RC_PROTO_* and RC_BIT_* to RC_PROTO_BIT_* 2017-08-20 10:02:48 -04:00
ir-rx51.c [media] ir-rx51: port to rc-core 2017-01-30 14:25:04 -02:00
ir-sanyo-decoder.c media: rc: rename RC_TYPE_* to RC_PROTO_* and RC_BIT_* to RC_PROTO_BIT_* 2017-08-20 10:02:48 -04:00
ir-sharp-decoder.c Update James Hogan's email address 2017-10-04 17:11:53 -07:00
ir-sony-decoder.c media: rc: rename RC_TYPE_* to RC_PROTO_* and RC_BIT_* to RC_PROTO_BIT_* 2017-08-20 10:02:48 -04:00
ir-spi.c media: rc-core: rename input_name to device_name 2017-08-20 09:43:52 -04:00
ir-xmp-decoder.c media: rc: rename RC_TYPE_* to RC_PROTO_* and RC_BIT_* to RC_PROTO_BIT_* 2017-08-20 10:02:48 -04:00
ite-cir.c media: rc: rename RC_TYPE_* to RC_PROTO_* and RC_BIT_* to RC_PROTO_BIT_* 2017-08-20 10:02:48 -04:00
ite-cir.h [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
Kconfig media: rc: ir-spi needs OF 2017-10-11 12:42:09 -04:00
lirc_dev.c media: lirc_dev: remove min_timeout and max_timeout 2017-10-11 12:37:36 -04:00
Makefile media: rc: Add driver for tango HW IR decoder 2017-10-11 12:41:08 -04:00
mceusb.c media: rc: mceusb: add support for 15f4:0135 2017-10-31 06:35:32 -04:00
meson-ir.c media: rc: rename RC_TYPE_* to RC_PROTO_* and RC_BIT_* to RC_PROTO_BIT_* 2017-08-20 10:02:48 -04:00
mtk-cir.c media: rc: rename RC_TYPE_* to RC_PROTO_* and RC_BIT_* to RC_PROTO_BIT_* 2017-08-20 10:02:48 -04:00
nuvoton-cir.c media: rc: rename RC_TYPE_* to RC_PROTO_* and RC_BIT_* to RC_PROTO_BIT_* 2017-08-20 10:02:48 -04:00
nuvoton-cir.h media: rc: nuvoton: remove rudimentary transmit functionality 2017-08-20 09:47:57 -04:00
pwm-ir-tx.c media: rc: pwm-ir-tx: add new driver 2017-08-20 09:46:18 -04:00
rc-core-priv.h [media] media: rename struct lirc_driver to struct lirc_dev 2017-10-04 14:13:08 -03:00
rc-ir-raw.c media: rc: Convert timers to use timer_setup() 2017-10-31 06:31:44 -04:00
rc-loopback.c media: rc: rename RC_TYPE_* to RC_PROTO_* and RC_BIT_* to RC_PROTO_BIT_* 2017-08-20 10:02:48 -04:00
rc-main.c media: rc: Convert timers to use timer_setup() 2017-10-31 06:31:44 -04:00
redrat3.c [media] media: rc: constify usb_device_id 2017-10-04 15:06:09 -03:00
serial_ir.c media: serial_ir: Convert timers to use timer_setup() 2017-10-27 17:38:54 +02:00
sir_ir.c media: rc: sir_ir: detect presence of port 2017-11-15 08:57:34 -05:00
st_rc.c media: rc: rename RC_TYPE_* to RC_PROTO_* and RC_BIT_* to RC_PROTO_BIT_* 2017-08-20 10:02:48 -04:00
streamzap.c [media] media: rc: constify usb_device_id 2017-10-04 15:06:09 -03:00
sunxi-cir.c media: rc: rename RC_TYPE_* to RC_PROTO_* and RC_BIT_* to RC_PROTO_BIT_* 2017-08-20 10:02:48 -04:00
tango-ir.c media: rc: Add driver for tango HW IR decoder 2017-10-11 12:41:08 -04:00
ttusbir.c media: rc: rename RC_TYPE_* to RC_PROTO_* and RC_BIT_* to RC_PROTO_BIT_* 2017-08-20 10:02:48 -04:00
winbond-cir.c media: rc: rename RC_TYPE_* to RC_PROTO_* and RC_BIT_* to RC_PROTO_BIT_* 2017-08-20 10:02:48 -04:00
zx-irdec.c media: rc: rename RC_TYPE_* to RC_PROTO_* and RC_BIT_* to RC_PROTO_BIT_* 2017-08-20 10:02:48 -04:00