Bug 204317

Summary: DVBSky T9580 V3 IR receiver not working any more since 5.1
Product: Drivers Reporter: Laz Lev (lazlev)
Component: Input DevicesAssignee: drivers_other
Status: RESOLVED CODE_FIX    
Severity: normal CC: ailin.nemui+kernel, jiloxe4653, lazlev, sean
Priority: P1    
Hardware: x86-64   
OS: Linux   
Kernel Version: 5.1 Subsystem:
Regression: Yes Bisected commit-id:
Attachments: Add some debugging to IR receiving
Add IR debugging and attempt to fix interrupts
Add IR debugging and attempt to fix interrupts and timeout

Description Laz Lev 2019-07-25 20:22:42 UTC
Up until 5.0 (5.0.11 on Arch Linux) my DVBSky T9580 V3 IR receiver is working perfectly. Since 5.1 (I first tried 5.1.2 on Arch) the receiver stops working without giving any obvious error messages anywhere.

Interestingly enough after the first reboot when upgrading to 5.1 the receiver still works for a split second before it seizes to work (I can get 1-2 successful key presses on my remote).

Neither "ir-keytable -t" nor "irw" give any output after that. I'm attaching some information about the different states between 5.0/5.1.

Hopefully someone can have a look and tell me if something changed in the source code or if I need to change something in my configuration.

### kernel 5.1.5
lsmod | grep rc
ir_rc5_decoder         20480  0
rc_dvbsky              16384  0
intel_powerclamp       20480  0
crct10dif_pclmul       16384  1
crc32_pclmul           16384  0
rc_core                57344  4 rc_dvbsky,smipcie,ir_rc5_decoder
crc32c_generic         16384  0
crc16                  16384  2 bluetooth,ext4
crc32c_intel           24576  3

sudo ir-keytable -v
Found device /sys/class/rc/rc0/
Parsing uevent /sys/class/rc/rc0/lirc0/uevent
/sys/class/rc/rc0/lirc0/uevent uevent MAJOR=242
/sys/class/rc/rc0/lirc0/uevent uevent MINOR=0
/sys/class/rc/rc0/lirc0/uevent uevent DEVNAME=lirc0
Input sysfs node is /sys/class/rc/rc0/input17/
Event sysfs node is /sys/class/rc/rc0/input17/event17/
Parsing uevent /sys/class/rc/rc0/input17/event17/uevent
/sys/class/rc/rc0/input17/event17/uevent uevent MAJOR=13
/sys/class/rc/rc0/input17/event17/uevent uevent MINOR=81
/sys/class/rc/rc0/input17/event17/uevent uevent DEVNAME=input/event17
Parsing uevent /sys/class/rc/rc0/uevent
/sys/class/rc/rc0/uevent uevent NAME=rc-dvbsky
/sys/class/rc/rc0/uevent uevent DRV_NAME=SMI_PCIe
/sys/class/rc/rc0/uevent uevent DEV_NAME=IR (DVBSky T9580 V3)
input device is /dev/input/event17
/sys/class/rc/rc0/protocols protocol rc-5 (enabled)
/sys/class/rc/rc0/protocols protocol nec (disabled)
/sys/class/rc/rc0/protocols protocol rc-6 (disabled)
/sys/class/rc/rc0/protocols protocol jvc (disabled)
/sys/class/rc/rc0/protocols protocol sony (disabled)
/sys/class/rc/rc0/protocols protocol rc-5-sz (disabled)
/sys/class/rc/rc0/protocols protocol sanyo (disabled)
/sys/class/rc/rc0/protocols protocol sharp (disabled)
/sys/class/rc/rc0/protocols protocol mce_kbd (disabled)
/sys/class/rc/rc0/protocols protocol xmp (disabled)
/sys/class/rc/rc0/protocols protocol imon (disabled)
/sys/class/rc/rc0/protocols protocol rc-mm (disabled)
/sys/class/rc/rc0/protocols protocol lirc (enabled)
Found /sys/class/rc/rc0/ (/dev/input/event17) with:
        Name: IR (DVBSky T9580 V3)
        Driver: SMI_PCIe, table: rc-dvbsky
        LIRC device: /dev/lirc0
        Supported kernel protocols: other lirc rc-5 rc-5-sz jvc sony nec sanyo mce_kbd rc-6 sharp xmp imon
        Enabled kernel protocols: lirc rc-5
        bus: 1, vendor/product: 4254:5580, version: 0x0001
        Repeat delay = 500 ms, repeat period = 125 ms


### kernel 5.0.11
$ lsmod | grep rc
rc_dvbsky              16384  0
intel_powerclamp       20480  0
crct10dif_pclmul       16384  1
crc32_pclmul           16384  0
rc_core                57344  3 rc_dvbsky,smipcie
crc32c_generic         16384  0
crc16                  16384  2 bluetooth,ext4
crc32c_intel           24576  3

$ sudo ir-keytable -v
[sudo] password for snoop:
Found device /sys/class/rc/rc0/
Parsing uevent /sys/class/rc/rc0/lirc0/uevent
/sys/class/rc/rc0/lirc0/uevent uevent MAJOR=241
/sys/class/rc/rc0/lirc0/uevent uevent MINOR=0
/sys/class/rc/rc0/lirc0/uevent uevent DEVNAME=lirc0
Input sysfs node is /sys/class/rc/rc0/input12/
Event sysfs node is /sys/class/rc/rc0/input12/event12/
Parsing uevent /sys/class/rc/rc0/input12/event12/uevent
/sys/class/rc/rc0/input12/event12/uevent uevent MAJOR=13
/sys/class/rc/rc0/input12/event12/uevent uevent MINOR=76
/sys/class/rc/rc0/input12/event12/uevent uevent DEVNAME=input/event12
Parsing uevent /sys/class/rc/rc0/uevent
/sys/class/rc/rc0/uevent uevent NAME=rc-dvbsky
/sys/class/rc/rc0/uevent uevent DRV_NAME=SMI_PCIe
/sys/class/rc/rc0/uevent uevent DEV_NAME=IR (DVBSky T9580 V3)
input device is /dev/input/event12
Found /sys/class/rc/rc0/ (/dev/input/event12) with:
        Name: IR (DVBSky T9580 V3)
        Driver: SMI_PCIe, table: rc-dvbsky
        LIRC device: /dev/lirc0
        Supported kernel protocols:
        Enabled kernel protocols:
        bus: 1, vendor/product: 4254:5580, version: 0x0001
        Repeat delay = 500 ms, repeat period = 125 ms
Comment 1 ailin.nemui+kernel 2020-07-10 12:25:24 UTC
same issue on OpenSUSE 15.2 kernel 5.3.18, it either doesn't work or registers double presses, or wrong presses
Comment 2 Laz Lev 2021-01-14 22:55:56 UTC
I bisected between kernel 5.0 and 5.1 and found the commit that breaks my IR receiver. Hopefully this can be resolved now?

$ git -C ./src/linux bisect bad
a49a7a4635dea5b799a8f77e227ef5c648fa29ec is the first bad commit
commit a49a7a4635dea5b799a8f77e227ef5c648fa29ec
Author: Patrick Lerda <patrick9876@free.fr>
Date:   Wed Jan 23 19:04:20 2019 -0500

    media: smipcie: add universal ir capability

    smipcie: switch to RC_DRIVER_IR_RAW.

    Signed-off-by: Patrick Lerda <patrick9876@free.fr>
    Signed-off-by: Sean Young <sean@mess.org>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

 drivers/media/pci/smipcie/smipcie-ir.c | 132 +++++++++++----------------------
 drivers/media/pci/smipcie/smipcie.h    |   1 -
 2 files changed, 45 insertions(+), 88 deletions(-)
Comment 3 Sean Young 2021-01-15 12:38:55 UTC
This commit changes the IR handling, it is very possible that there was a regression there. Please can you send the output of:

ir-ctl -r

(and then press some buttons)

Thanks.
Comment 4 Laz Lev 2021-01-15 22:36:05 UTC
On linux 5.0 (where my remote is still working) I get the following error:
$ ir-ctl -r
/dev/lirc0: device cannot receive raw ir

On linux 5.1 (where my remote stops working) I neither get an error nor any output when pressing buttons. Features are reported like this:
$ ir-ctl -f
Receive features /dev/lirc0:
 - Device can receive raw IR
 - Can report decoded scancodes and protocol
 - Resolution 83 microseconds
 - Receiving timeout 100000 microseconds
Send features /dev/lirc0:
 - Device cannot send

And device is detected like this during boot:
rc rc0: lirc_dev: driver SMI_PCIe registered at minor = 0, raw IR receiver, no transmitter

lircd is installed with devinput driver:
$ lircd --version
lircd 0.10.1

Some more information about how I configured my remote so far:
$ cp /lib/udev/rc_keymaps/dvbsky.toml /etc/rc_keymaps/

$ cat /etc/rc_keymaps/dvbsky.toml
[[protocols]]
name = "dvbsky"
protocol = "rc5"
variant = "rc5"
[protocols.scancodes]
0x0000 = "KEY_0"
0x0001 = "KEY_1"
0x0002 = "KEY_2"
0x0003 = "KEY_3"
0x0004 = "KEY_4"
0x0005 = "KEY_5"
0x0006 = "KEY_6"
0x0007 = "KEY_7"
0x0008 = "KEY_8"
0x0009 = "KEY_9"
0x000a = "KEY_MUTE"
0x000d = "KEY_OK"
0x000b = "KEY_STOP"
0x000c = "KEY_EXIT"
0x000e = "KEY_CAMERA"
0x000f = "KEY_SUBTITLE"
0x0010 = "KEY_VOLUMEUP"
0x0011 = "KEY_VOLUMEDOWN"
0x0012 = "KEY_FAVORITES"
0x0013 = "KEY_LIST"
0x0016 = "KEY_PAUSE"
0x0017 = "KEY_PLAY"
0x001f = "KEY_RECORD"
0x0020 = "KEY_CHANNELDOWN"
0x0021 = "KEY_CHANNELUP"
0x0025 = "KEY_POWER2"
0x0026 = "KEY_REWIND"
0x0027 = "KEY_FASTFORWARD"
0x0029 = "KEY_LAST"
0x002b = "KEY_MENU"
0x002c = "KEY_EPG"
0x002d = "KEY_ZOOM"
0x14   = "KEY_UP"
0x15   = "KEY_DOWN"
0x18   = "KEY_LEFT"
0x19   = "KEY_RIGHT"
0x1a   = "KEY_RED"
0x1b   = "KEY_GREEN"
0x1c   = "KEY_YELLOW"
0x1d   = "KEY_BLUE"

$ ir-keytable -a /etc/rc_maps.cfg -s rc0
Old keytable cleared
Wrote 40 keycode(s) to driver
Protocols changed to rc-5

Thanks for helping me!
Comment 5 Sean Young 2021-01-17 12:27:41 UTC
Created attachment 294695 [details]
Add some debugging to IR receiving

This patch adds some extra debugging so we can see what the hardware is producing.
Comment 6 Sean Young 2021-01-17 12:29:46 UTC
Please can you try the patch and tell us if there is any output in dmesg when you press some buttons.

Thanks
Comment 7 Laz Lev 2021-01-17 15:56:53 UTC
I applied the patch and got some key presses recognized right after reboot. After 2-3 seconds it stopped working and nothing gets logged anymore (I guess some hard crash?).

Jan 17 16:46:02 medianas kernel: rc rc0: smi_ir_decode: control 00000094
Jan 17 16:46:02 medianas kernel: rc rc0: smi_ir_decode: count 00000001
Jan 17 16:46:02 medianas kernel: rc rc0: smi_ir_decode: data 00000001
Jan 17 16:46:02 medianas kernel: rc rc0: smi_ir_decode: control 00000094
Jan 17 16:46:02 medianas kernel: rc rc0: smi_ir_decode: count 00000015
Jan 17 16:46:02 medianas kernel: rc rc0: smi_ir_decode: data 8b158b0b
Jan 17 16:46:02 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 17 16:46:02 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 17 16:46:02 medianas kernel: rc rc0: smi_ir_decode: data 950a8b0a
Jan 17 16:46:02 medianas kernel: rc rc0: smi_ir_decode: data 95159515
Jan 17 16:46:02 medianas kernel: rc rc0: smi_ir_decode: data 0000000a
Jan 17 16:46:02 medianas kernel: rc rc0: smi_ir_decode: control 00000094
Jan 17 16:46:02 medianas kernel: rc rc0: smi_ir_decode: count 00000015
Jan 17 16:46:02 medianas kernel: rc rc0: smi_ir_decode: data 8b158b0b
Jan 17 16:46:02 medianas kernel: rc rc0: smi_ir_decode: data 8b0a8b0b
Jan 17 16:46:02 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 17 16:46:02 medianas kernel: rc rc0: smi_ir_decode: data 950b8b0b
Jan 17 16:46:02 medianas kernel: rc rc0: smi_ir_decode: data 95159515
Jan 17 16:46:02 medianas kernel: rc rc0: smi_ir_decode: data 0000000a
Jan 17 16:46:02 medianas kernel: rc rc0: smi_ir_decode: control 00000094
Jan 17 16:46:02 medianas kernel: rc rc0: smi_ir_decode: count 00000001
Jan 17 16:46:02 medianas kernel: rc rc0: smi_ir_decode: data 00000001
Jan 17 16:46:03 medianas kernel: rc rc0: smi_ir_decode: control 00000094
Jan 17 16:46:03 medianas kernel: rc rc0: smi_ir_decode: count 00000015
Jan 17 16:46:03 medianas kernel: rc rc0: smi_ir_decode: data 8b0a8b0b
Jan 17 16:46:03 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b15
Jan 17 16:46:03 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 17 16:46:03 medianas kernel: rc rc0: smi_ir_decode: data 950b8b0b
Jan 17 16:46:03 medianas kernel: rc rc0: smi_ir_decode: data 95159515
Jan 17 16:46:03 medianas kernel: rc rc0: smi_ir_decode: data 0000000a
Jan 17 16:46:03 medianas kernel: rc rc0: smi_ir_decode: control 00000094
Jan 17 16:46:03 medianas kernel: rc rc0: smi_ir_decode: count 00000015
Jan 17 16:46:03 medianas kernel: rc rc0: smi_ir_decode: data 8b158b0b
Jan 17 16:46:03 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 17 16:46:03 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 17 16:46:03 medianas kernel: rc rc0: smi_ir_decode: data 950b8b0b
Jan 17 16:46:03 medianas kernel: rc rc0: smi_ir_decode: data 95159615
Jan 17 16:46:03 medianas kernel: rc rc0: smi_ir_decode: data 0000000a
Jan 17 16:46:03 medianas kernel: rc rc0: smi_ir_decode: control 00000094
Jan 17 16:46:03 medianas kernel: rc rc0: smi_ir_decode: count 00000015
Jan 17 16:46:03 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 17 16:46:03 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b15
Jan 17 16:46:03 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 17 16:46:03 medianas kernel: rc rc0: smi_ir_decode: data 950b8b0b
Jan 17 16:46:03 medianas kernel: rc rc0: smi_ir_decode: data 95159615
Jan 17 16:46:03 medianas kernel: rc rc0: smi_ir_decode: data 0000000a
Jan 17 16:46:04 medianas kernel: rc rc0: smi_ir_decode: control 00000094
Jan 17 16:46:04 medianas kernel: rc rc0: smi_ir_decode: count 00000015
Jan 17 16:46:04 medianas kernel: rc rc0: smi_ir_decode: data 8b158b0b
Jan 17 16:46:04 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 17 16:46:04 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 17 16:46:04 medianas kernel: rc rc0: smi_ir_decode: data 950a8b0b
Jan 17 16:46:04 medianas kernel: rc rc0: smi_ir_decode: data 95159515
Jan 17 16:46:04 medianas kernel: rc rc0: smi_ir_decode: data 0000000a
Jan 17 16:46:04 medianas kernel: rc rc0: smi_ir_decode: control 00000094
Jan 17 16:46:04 medianas kernel: rc rc0: smi_ir_decode: count 00000015
Jan 17 16:46:04 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 17 16:46:04 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b15
Jan 17 16:46:04 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 17 16:46:04 medianas kernel: rc rc0: smi_ir_decode: data 950b8b0b
Jan 17 16:46:04 medianas kernel: rc rc0: smi_ir_decode: data 95159515
Jan 17 16:46:04 medianas kernel: rc rc0: smi_ir_decode: data 0000000a
Comment 8 Laz Lev 2021-01-25 20:38:51 UTC
Sean Young: So I'm guessing the debug output I gave was not very helpful? Anything else we can try to locate the problem?

Do you know of any way to contact the original author Patrick Lerda? Last time I checked his mail box was full...
Comment 9 ailin.nemui+kernel 2021-01-25 20:51:52 UTC
reverting that commit fixes my remote
Comment 10 Sean Young 2021-01-26 10:48:19 UTC
Looks like the device reports IR fine and then stops. I don't know this driver either; neither do I have the hardware to experiment with. I've emailed the patch author and also got a mailbox full bounce.

So having read the driver code, it does some odd things which I can' explain. Disabling interrupts for each irq is unusual. I'm not sure they're being re-enabled correctly.

Please can you change line 179 from
 smi_set(IR_Init_Reg, rbIRhighidle);

to:

 smi_set(IR_Init_Reg, rbIRen | rbIRhighidle);

Possibly this will work, but this is guesswork I'm afraid.
Comment 11 Laz Lev 2021-01-26 23:00:35 UTC
I wanted to test your proposed change but there are three places where smi_set() is called:
line 83
line 92
line 121

https://github.com/torvalds/linux/blob/master/drivers/media/pci/smipcie/smipcie-ir.c

Line 121 is already set to the way you proposed so should I change line 83 and/or line 92?
Comment 12 Laz Lev 2021-01-26 23:18:39 UTC
Sorry, just saw that only line 92 exactly matches what you mentioned so I went ahead and changed that line to:
 smi_set(IR_Init_Reg, rbIRen | rbIRhighidle);

Unfortunately it did not fix the issue. Same behavior as before...
Comment 13 Sean Young 2021-01-29 10:58:37 UTC
Created attachment 294985 [details]
Add IR debugging and attempt to fix interrupts

The vendor code is here: http://dvbsky.net/download/linux/

I *hope* that now I've figured out what the problem is, and now the code matches what the original vendor code was done.

Please can you test this patch, and let me know if it works. Please include what the dmesg output please, whether it works or not.

Thank you very much!
Comment 14 ailin.nemui+kernel 2021-01-29 11:38:46 UTC
For reference, here was the original thread with working driver https://patchwork.kernel.org/project/linux-media/patch/201506292209394689855@gmail.com/
Comment 15 Laz Lev 2021-01-29 20:07:02 UTC
Sean, I just tested your patch and I can confirm that it is working *almost* perfectly now. I'm catching some double presses now although I only pressed once but other than that it continues working.

Here's some output from journalctl -k:
Jan 29 20:58:17 medianas kernel: rc rc0: smi_ir_decode: control 00000094
Jan 29 20:58:17 medianas kernel: rc rc0: smi_ir_decode: count 00000001
Jan 29 20:58:17 medianas kernel: rc rc0: smi_ir_decode: data 00000001
Jan 29 20:58:17 medianas kernel: rc rc0: smi_ir_decode: high idle
Jan 29 20:58:17 medianas kernel: rc rc0: smi_ir_decode: control 00000094
Jan 29 20:58:17 medianas kernel: rc rc0: smi_ir_decode: count 00000015
Jan 29 20:58:17 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 29 20:58:17 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b15
Jan 29 20:58:17 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 29 20:58:17 medianas kernel: rc rc0: smi_ir_decode: data 950b8b0b
Jan 29 20:58:17 medianas kernel: rc rc0: smi_ir_decode: data 95159515
Jan 29 20:58:17 medianas kernel: rc rc0: smi_ir_decode: data 0000000b
Jan 29 20:58:17 medianas kernel: rc rc0: smi_ir_decode: high idle
Jan 29 20:58:18 medianas kernel: rc rc0: smi_ir_decode: control 00000094
Jan 29 20:58:18 medianas kernel: rc rc0: smi_ir_decode: count 00000015
Jan 29 20:58:18 medianas kernel: rc rc0: smi_ir_decode: data 8b158b0b
Jan 29 20:58:18 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 29 20:58:18 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 29 20:58:18 medianas kernel: rc rc0: smi_ir_decode: data 950b8b0b
Jan 29 20:58:18 medianas kernel: rc rc0: smi_ir_decode: data 95159515
Jan 29 20:58:18 medianas kernel: rc rc0: smi_ir_decode: data 0000000b
Jan 29 20:58:18 medianas kernel: rc rc0: smi_ir_decode: high idle
Jan 29 20:58:18 medianas kernel: rc rc0: smi_ir_decode: control 00000094
Jan 29 20:58:18 medianas kernel: rc rc0: smi_ir_decode: count 00000015
Jan 29 20:58:18 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 29 20:58:18 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b15
Jan 29 20:58:18 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 29 20:58:18 medianas kernel: rc rc0: smi_ir_decode: data 950b8b0b
Jan 29 20:58:18 medianas kernel: rc rc0: smi_ir_decode: data 95159515
Jan 29 20:58:18 medianas kernel: rc rc0: smi_ir_decode: data 0000000b
Jan 29 20:58:18 medianas kernel: rc rc0: smi_ir_decode: high idle
Jan 29 20:58:18 medianas kernel: rc rc0: smi_ir_decode: control 00000094
Jan 29 20:58:18 medianas kernel: rc rc0: smi_ir_decode: count 00000001
Jan 29 20:58:18 medianas kernel: rc rc0: smi_ir_decode: data 00000002
Jan 29 20:58:18 medianas kernel: rc rc0: smi_ir_decode: high idle
Jan 29 20:58:19 medianas kernel: rc rc0: smi_ir_decode: control 00000094
Jan 29 20:58:19 medianas kernel: rc rc0: smi_ir_decode: count 00000015
Jan 29 20:58:19 medianas kernel: rc rc0: smi_ir_decode: data 8b158b0b
Jan 29 20:58:19 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 29 20:58:19 medianas kernel: rc rc0: smi_ir_decode: data 8b0a8b0b
Jan 29 20:58:19 medianas kernel: rc rc0: smi_ir_decode: data 950b8b0b
Jan 29 20:58:19 medianas kernel: rc rc0: smi_ir_decode: data 95159515
Jan 29 20:58:19 medianas kernel: rc rc0: smi_ir_decode: data 0000000b
Jan 29 20:58:19 medianas kernel: rc rc0: smi_ir_decode: high idle
Jan 29 20:58:19 medianas kernel: rc rc0: smi_ir_decode: control 00000094
Jan 29 20:58:19 medianas kernel: rc rc0: smi_ir_decode: count 00000015
Jan 29 20:58:19 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 29 20:58:19 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b15
Jan 29 20:58:19 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 29 20:58:19 medianas kernel: rc rc0: smi_ir_decode: data 950b8b0b
Jan 29 20:58:19 medianas kernel: rc rc0: smi_ir_decode: data 95159515
Jan 29 20:58:19 medianas kernel: rc rc0: smi_ir_decode: data 0000000b
Jan 29 20:58:19 medianas kernel: rc rc0: smi_ir_decode: high idle
Jan 29 20:58:19 medianas kernel: rc rc0: smi_ir_decode: control 00000094
Jan 29 20:58:19 medianas kernel: rc rc0: smi_ir_decode: count 00000015
Jan 29 20:58:19 medianas kernel: rc rc0: smi_ir_decode: data 8b158b0b
Jan 29 20:58:19 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 29 20:58:19 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 29 20:58:19 medianas kernel: rc rc0: smi_ir_decode: data 950b8b0b
Jan 29 20:58:19 medianas kernel: rc rc0: smi_ir_decode: data 95159515
Jan 29 20:58:19 medianas kernel: rc rc0: smi_ir_decode: data 0000000b
Comment 16 Sean Young 2021-01-30 09:47:42 UTC
Thank you for testing the patch! I think we're almost there.
Comment 17 Sean Young 2021-01-30 09:49:00 UTC
Created attachment 294997 [details]
Add IR debugging and attempt to fix interrupts and timeout

The drivers sets the timeout length to 100ms but then only generates timeouts of 10ms.
Comment 18 Laz Lev 2021-01-30 13:41:17 UTC
I just tested the new patch and now it seems to work perfectly. At least I couldn't find any more issues with it after playing around a little with it. I think this patch can be submitted to the kernel to fix the issue.

Here's some debug output:
Jan 30 14:36:23 medianas kernel: rc rc0: smi_ir_decode: data 950b8b0b
Jan 30 14:36:23 medianas kernel: rc rc0: smi_ir_decode: data 8b158b0b
Jan 30 14:36:23 medianas kernel: rc rc0: smi_ir_decode: data 000b8b0b
Jan 30 14:36:23 medianas kernel: rc rc0: smi_ir_decode: high idle
Jan 30 14:36:24 medianas kernel: rc rc0: smi_ir_decode: control 00000094
Jan 30 14:36:24 medianas kernel: rc rc0: smi_ir_decode: count 00000017
Jan 30 14:36:24 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 30 14:36:24 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b15
Jan 30 14:36:24 medianas kernel: rc rc0: smi_ir_decode: data 8b0a8b0b
Jan 30 14:36:24 medianas kernel: rc rc0: smi_ir_decode: data 950b8b0b
Jan 30 14:36:24 medianas kernel: rc rc0: smi_ir_decode: data 8b158b0b
Jan 30 14:36:24 medianas kernel: rc rc0: smi_ir_decode: data 000b8b0b
Jan 30 14:36:24 medianas kernel: rc rc0: smi_ir_decode: high idle
Jan 30 14:36:24 medianas kernel: rc rc0: smi_ir_decode: control 00000094
Jan 30 14:36:24 medianas kernel: rc rc0: smi_ir_decode: count 00000015
Jan 30 14:36:24 medianas kernel: rc rc0: smi_ir_decode: data 8b158b0b
Jan 30 14:36:24 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 30 14:36:24 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 30 14:36:24 medianas kernel: rc rc0: smi_ir_decode: data 950b8b0a
Jan 30 14:36:24 medianas kernel: rc rc0: smi_ir_decode: data 8b159515
Jan 30 14:36:24 medianas kernel: rc rc0: smi_ir_decode: data 0000000b
Jan 30 14:36:24 medianas kernel: rc rc0: smi_ir_decode: high idle
Jan 30 14:36:25 medianas kernel: rc rc0: smi_ir_decode: control 00000094
Jan 30 14:36:25 medianas kernel: rc rc0: smi_ir_decode: count 00000015
Jan 30 14:36:25 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 30 14:36:25 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b15
Jan 30 14:36:25 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 30 14:36:25 medianas kernel: rc rc0: smi_ir_decode: data 950b8b0b
Jan 30 14:36:25 medianas kernel: rc rc0: smi_ir_decode: data 8b159515
Jan 30 14:36:25 medianas kernel: rc rc0: smi_ir_decode: data 0000000b
Jan 30 14:36:25 medianas kernel: rc rc0: smi_ir_decode: high idle
Jan 30 14:36:25 medianas kernel: rc rc0: smi_ir_decode: control 00000094
Jan 30 14:36:25 medianas kernel: rc rc0: smi_ir_decode: count 00000015
Jan 30 14:36:25 medianas kernel: rc rc0: smi_ir_decode: data 8b158b0b
Jan 30 14:36:25 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 30 14:36:25 medianas kernel: rc rc0: smi_ir_decode: data 8b0a8b0b
Jan 30 14:36:25 medianas kernel: rc rc0: smi_ir_decode: data 950b8b0b
Jan 30 14:36:25 medianas kernel: rc rc0: smi_ir_decode: data 8b159515
Jan 30 14:36:25 medianas kernel: rc rc0: smi_ir_decode: data 0000000b
Jan 30 14:36:25 medianas kernel: rc rc0: smi_ir_decode: high idle
Jan 30 14:36:26 medianas kernel: rc rc0: smi_ir_decode: control 00000094
Jan 30 14:36:26 medianas kernel: rc rc0: smi_ir_decode: count 00000015
Jan 30 14:36:26 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0b
Jan 30 14:36:26 medianas kernel: rc rc0: smi_ir_decode: data 8b0a8b14
Jan 30 14:36:26 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0a
Jan 30 14:36:26 medianas kernel: rc rc0: smi_ir_decode: data 950b8b0a
Jan 30 14:36:26 medianas kernel: rc rc0: smi_ir_decode: data 96159615
Jan 30 14:36:26 medianas kernel: rc rc0: smi_ir_decode: data 0000000a
Jan 30 14:36:26 medianas kernel: rc rc0: smi_ir_decode: high idle
Jan 30 14:36:26 medianas kernel: rc rc0: smi_ir_decode: control 00000094
Jan 30 14:36:26 medianas kernel: rc rc0: smi_ir_decode: count 00000001
Jan 30 14:36:26 medianas kernel: rc rc0: smi_ir_decode: data 00000001
Jan 30 14:36:26 medianas kernel: rc rc0: smi_ir_decode: high idle
Jan 30 14:36:27 medianas kernel: rc rc0: smi_ir_decode: control 00000094
Jan 30 14:36:27 medianas kernel: rc rc0: smi_ir_decode: count 00000015
Jan 30 14:36:27 medianas kernel: rc rc0: smi_ir_decode: data 8b158b0b
Jan 30 14:36:27 medianas kernel: rc rc0: smi_ir_decode: data 8b0a8b0a
Jan 30 14:36:27 medianas kernel: rc rc0: smi_ir_decode: data 8b0b8b0a
Jan 30 14:36:27 medianas kernel: rc rc0: smi_ir_decode: data 950a8b0a
Jan 30 14:36:27 medianas kernel: rc rc0: smi_ir_decode: data 96149614
Jan 30 14:36:27 medianas kernel: rc rc0: smi_ir_decode: data 0000000a
Jan 30 14:36:27 medianas kernel: rc rc0: smi_ir_decode: high idle
Jan 30 14:36:30 medianas kernel: rc rc0: smi_ir_decode: control 00000094
Jan 30 14:36:30 medianas kernel: rc rc0: smi_ir_decode: count 00000063
Comment 19 Sean Young 2021-01-31 10:56:10 UTC
Wonderful. 

I've cleaned up the patch. This includes some changes to make it conform to current coding standards (aka checkpatch.pl).

https://www.spinics.net/lists/linux-media/msg186295.html
Comment 20 Laz Lev 2021-02-10 20:10:32 UTC
Hey Sean, thanks again for putting in the time to fix this problem. Much appreciated!

Do you know how long it normally takes to review and accept kernel patches like this? Is there some kind of auto-accept mechanism after a period of time with no activity?

Just wondering what's the normal procedure here. I'm not in a big hurry but still would love to see this applied sooner rather than later of course :)
Comment 21 Laz Lev 2021-03-03 20:29:39 UTC
Patch has been applied and will be part of the upcoming kernel 5.12. Thanks Sean!