Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gulikit King Kong Controller hang #36

Open
pickfire opened this issue May 3, 2022 · 18 comments
Open

Gulikit King Kong Controller hang #36

pickfire opened this issue May 3, 2022 · 18 comments

Comments

@pickfire
Copy link

pickfire commented May 3, 2022

I believe this is merged into linux but opening an issue here since it was mentioned in https://github.com/DanielOgorchock/joycond

I am using gulikit king kong controller with nintendo switch mode, but when I connect it to my computer, it freezes. There was once I upgraded the kernel (linux-zen) without reboot and it seemed to work fine, I guess some modules wasn't modprobed then it will work fine (no freeze) and detected a pro controller in yuzu but I am not sure which module.

5月 03 21:43:08 mi kernel: hid-generic 0005:045E:02E0.0006: unknown main item tag 0x0
5月 03 21:43:08 mi kernel: input: Pro Controller as /devices/pci0000:00/0000:00:08.1/0000:02:00.3/usb1/1-4/1-4:1.0/bluetooth/hci0/hci0:1/0005:045E:02E0.0006/input/input21
5月 03 21:43:08 mi kernel: hid-generic 0005:045E:02E0.0006: input,hidraw5: BLUETOOTH HID v9.03 Gamepad [Pro Controller] on 80:30:49:10:6b:d0

I got that log when I connect it through bluetooth, but on wired the computer freeze and keyboard caps lock led kept blinking.

Not sure if this is related but I got quite a bit of it in the journalctl logs.

Failed to find catalog entry: Invalid argument

uname -a

Linux mi 5.17.5-zen1-1-zen #1 ZEN SMP PREEMPT Wed, 27 Apr 2022 20:56:14 +0000 x86_64 GNU/Linux

I am not quite sure how to figure out what causes the computer to freeze but it happens after I changed the mode to switch controller, IIRC last time I saw something related to failed to probe ... mentioning nintendo in the journalctl but I can't it anymore.

If any more details is needed, feel free to say what information is needed, I guess it won't be easy to reproduce without the same hardware.

There are 4 modes for the controller, switch, xinput, dinput, android and switch is the only one that freezes the computer.

@dogtopus
Copy link

dogtopus commented May 3, 2022

If you can, could you please use kdump to create a memory dump and at least post the backtrace here? This will save tremendous amount of time that will otherwise be wasted on trying to reproduce the kernel panic.

@pickfire
Copy link
Author

pickfire commented May 4, 2022

I tried doing a kdump following https://wiki.archlinux.org/title/Kdump and https://www.kernel.org/doc/html/latest/admin-guide/kdump/kdump.html but I still can't seemed to get the crash dump after spending hours on it, when it crash, the caps lock led is no longer blinking but I still don't see the crash dump file in the specified location, I also can't find the logs on why this happened. I did

sudo kexec -p /boot/vmlinuz-linux-zen --initrd=/boot/initramfs-linux-zen-kdump.img --append='root="LABEL=root" rootflags=rw,relatime,compress=zstd:3,ssd,space_cache,subvolid=5,subvol=/ systemd.unit=kdump-save.service 1 irqpoll nr_cpus=1 reset_devices'

Without the -p I can access the system fine, but when the system crash, it doesn't seemed to update the display, the display still freezes so I am not sure if it is doing anything.

@dogtopus
Copy link

dogtopus commented May 4, 2022

Did you try the kdump-save.service mentioned on the arch wiki?

Maybe also try switching to a console before you attempt to crash the system.

@pickfire
Copy link
Author

pickfire commented May 5, 2022

Did you try the kdump-save.service mentioned on the arch wiki?

Yes, I put that within the initramfs using mkinitfs but I don't seemed to find it in the journal log when it crash, not sure why.

Maybe also try switching to a console before you attempt to crash the system.

I also try crashing it in TTY2, and it also stuck the same way it did with X11, it did not go to the new console started from kexec, it just freezes.

@dogtopus
Copy link

dogtopus commented May 5, 2022

Does crashing with sysrq trigger trigger the kdump properly? I guess something might went wrong during the crash kexec() and made it freeze.

Maybe you could also try other methods like getting a backtrace via the serial port or pstore dump. If everything fails you might need to run the kernel in a VM and attach a debugger.

@pickfire
Copy link
Author

pickfire commented May 6, 2022

Does crashing with sysrq trigger trigger the kdump properly? I guess something might went wrong during the crash kexec() and made it freeze.

No, I did echo c > /proc/sysrq-trigger, and also try crashing the system by turning on the controller on nintendo switch mode. It works as in the caps lock led no longer blinks, but the screen is still stuck so I can't do anything.

Maybe you could also try other methods like getting a backtrace via the serial port or pstore dump. If everything fails you might need to run the kernel in a VM and attach a debugger.

But I don't know how to use serial port or pstore dump. Hmm, the last probably sounds as hard.

Is there an easier way like say I get to use a live rescue disk that I can easily plug on my laptop and crash it there to get the kdump? That way I can just run the live rescue disk and after it crash save the file to my disk or somewhere then I can send it here.

@pickfire
Copy link
Author

pickfire commented May 21, 2022

Now after I updated kernel to 5.17.9-zen1-1-zen it seemed like I no longer get kernel panic. But my computer still hangs.

Kernel log
...
5月 21 10:48:29 mi kernel: hid-generic 0005:057E:2009.0006: unknown main item tag 0x0
5月 21 10:48:29 mi kernel: input: Pro Controller as /devices/pci0000:00/0000:00:08.1/0000:02:00.3/usb1/1-4/1-4:1.0/bluetooth/hci0/hci0:3/0005:057E:2009.0006/input/input21
5月 21 10:48:29 mi kernel: hid-generic 0005:057E:2009.0006: input,hidraw5: BLUETOOTH HID v0.01 Gamepad [Pro Controller] on 80:30:49:10:6b:d0
5月 21 10:48:29 mi kernel: nintendo 0005:057E:2009.0006: unknown main item tag 0x0
5月 21 10:48:29 mi kernel: nintendo 0005:057E:2009.0006: hidraw5: BLUETOOTH HID v80.01 Gamepad [Pro Controller] on 80:30:49:10:6b:d0
5月 21 10:48:31 mi kernel: nintendo 0005:057E:2009.0006: using user cal for left stick
5月 21 10:48:31 mi kernel: nintendo 0005:057E:2009.0006: using user cal for right stick
5月 21 10:48:31 mi kernel: nintendo 0005:057E:2009.0006: using factory cal for IMU
5月 21 10:48:31 mi kernel: nintendo 0005:057E:2009.0006: controller MAC = 98:B6:E9:EC:11:08
5月 21 10:48:31 mi kernel: input: Nintendo Switch Pro Controller as /devices/pci0000:00/0000:00:08.1/0000:02:00.3/usb1/1-4/1-4:1.0/bluetooth/hci0/hci0:3/0005:057E:2009.0006/input/input22
5月 21 10:48:31 mi kernel: input: Nintendo Switch Pro Controller IMU as /devices/pci0000:00/0000:00:08.1/0000:02:00.3/usb1/1-4/1-4:1.0/bluetooth/hci0/hci0:3/0005:057E:2009.0006/input/input23
5月 21 10:48:31 mi kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI
5月 21 10:48:31 mi kernel: CPU: 5 PID: 33678 Comm: khidpd_057e2009 Not tainted 5.17.9-zen1-1-zen #1 b447c96d85e73a9127528593906685354a7b7c5d
5月 21 10:48:31 mi kernel: Hardware name: TIMI RedmiBook 14 II/TM1951, BIOS RMARN4B0P0909 08/19/2020
5月 21 10:48:31 mi kernel: RIP: 0010:nintendo_hid_event+0x5ff/0xd20 [hid_nintendo]
5月 21 10:48:31 mi kernel: Code: 08 00 00 44 8b 83 04 08 00 00 89 c6 0f b7 04 24 8b bb 00 08 00 00 39 c8 0f 8e 51 04 00 00 29 c8 29 cf 89 c2 c1 e0 0f 29 d0 99 <f7> ff 44 8b 8b 10 08 00 00 8b bb 0c 08 00 00 ba 01 80 ff ff 0f b7
5月 21 10:48:31 mi kernel: RSP: 0018:ffffae304aee3d48 EFLAGS: 00010212
5月 21 10:48:31 mi kernel: RAX: 000000000403f7f8 RBX: ffff8ca346ea8028 RCX: 0000000000000000
5月 21 10:48:31 mi kernel: RDX: 0000000000000000 RSI: 0000000000000807 RDI: 0000000000000000
5月 21 10:48:31 mi kernel: RBP: ffff8ca35fd28184 R08: 0000000000000000 R09: 0000000000000001
5月 21 10:48:31 mi kernel: R10: 0000000000000001 R11: 0000000000000008 R12: ffff8ca346ea8790
5月 21 10:48:31 mi kernel: R13: 0000000000008000 R14: ffff8ca33bac1800 R15: ffff8ca346ea876c
5月 21 10:48:31 mi kernel: FS:  0000000000000000(0000) GS:ffff8ca43f740000(0000) knlGS:0000000000000000
5月 21 10:48:31 mi kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
5月 21 10:48:31 mi kernel: CR2: 00007fb0dbc47524 CR3: 000000039b610000 CR4: 0000000000350ee0
5月 21 10:48:31 mi kernel: Call Trace:
5月 21 10:48:31 mi kernel:  <TASK>
5月 21 10:48:31 mi kernel:  ? schedule+0x4b/0xc0
5月 21 10:48:31 mi kernel:  hid_input_report+0x127/0x160
5月 21 10:48:31 mi kernel:  hidp_session_thread+0x4ff/0x9c0 [hidp d07bb5eb2176277bd5f206374ffe91a88aa9a489]
5月 21 10:48:31 mi kernel:  ? hidp_close+0x10/0x10 [hidp d07bb5eb2176277bd5f206374ffe91a88aa9a489]
5月 21 10:48:31 mi kernel:  ? hidp_close+0x10/0x10 [hidp d07bb5eb2176277bd5f206374ffe91a88aa9a489]
5月 21 10:48:31 mi kernel:  ? do_wait_intr_irq+0xa0/0xa0
5月 21 10:48:31 mi kernel:  ? hidp_session_remove+0x180/0x180 [hidp d07bb5eb2176277bd5f206374ffe91a88aa9a489]
5月 21 10:48:31 mi kernel:  kthread+0x138/0x160
5月 21 10:48:31 mi kernel:  ? kthread_complete_and_exit+0x20/0x20
5月 21 10:48:31 mi kernel:  ret_from_fork+0x1f/0x30
5月 21 10:48:31 mi kernel:  </TASK>
5月 21 10:48:31 mi kernel: Modules linked in: hid_nintendo ff_memless hidp snd_seq_dummy snd_hrtimer snd_seq snd_seq_device ccm rfcomm tun cmac algif_hash algif_skcipher af_alg bnep nls_iso8859_1 vfat fat hid_apple btusb btrtl btbcm btintel btmtk bluetooth ecdh_generic crc16 usbhid apple_mfi_fastcharge intel_rapl_msr intel_rapl_common edac_mce_amd joydev kvm_amd snd_acp3x_pdm_dma mousedev snd_acp3x_rn kvm snd_soc_dmic irqbypass hid_multitouch serio_raw wmi_bmof crct10dif_pclmul snd_sof_amd_renoir lzo_rle crc32_pclmul snd_acp_config snd_sof_amd_acp rtw88_8822ce ghash_clmulni_intel snd_sof_pci rtw88_8822c aesni_intel crypto_simd snd_sof cryptd snd_hda_codec_realtek rapl snd_soc_acpi rtw88_pci snd_hda_codec_generic ledtrig_audio snd_hda_codec_hdmi pcspkr rtw88_core snd_hda_intel snd_soc_core snd_intel_dspcfg snd_compress snd_intel_sdw_acpi ac97_bus mac80211 snd_pcm_dmaengine snd_hda_codec snd_pci_acp6x snd_hda_core snd_hwdep snd_pci_acp5x sp5100_tco snd_pcm k10temp snd_rn_pci_acp3x libarc4 i2c_piix4
5月 21 10:48:31 mi kernel:  snd_pci_acp3x snd_timer snd xhci_pci tpm_crb xhci_pci_renesas soundcore ccp cfg80211 ucsi_acpi typec_ucsi rfkill tpm_tis typec tpm_tis_core roles mac_hid i8042 video tpm i2c_hid_acpi wmi rng_core i2c_hid acpi_cpufreq pinctrl_amd amd_pmc pkcs8_key_parser dm_multipath dm_mod ledtrig_timer sg crypto_user fuse zram bpf_preload ip_tables x_tables amdgpu drm_ttm_helper ttm gpu_sched atkbd libps2 serio btrfs blake2b_generic libcrc32c crc32c_generic crc32c_intel xor raid6_pq
5月 21 10:48:31 mi kernel: ---[ end trace 0000000000000000 ]---
5月 21 10:48:31 mi kernel: RIP: 0010:nintendo_hid_event+0x5ff/0xd20 [hid_nintendo]
5月 21 10:48:31 mi kernel: Code: 08 00 00 44 8b 83 04 08 00 00 89 c6 0f b7 04 24 8b bb 00 08 00 00 39 c8 0f 8e 51 04 00 00 29 c8 29 cf 89 c2 c1 e0 0f 29 d0 99 <f7> ff 44 8b 8b 10 08 00 00 8b bb 0c 08 00 00 ba 01 80 ff ff 0f b7
5月 21 10:48:31 mi kernel: RSP: 0018:ffffae304aee3d48 EFLAGS: 00010212
5月 21 10:48:31 mi kernel: RAX: 000000000403f7f8 RBX: ffff8ca346ea8028 RCX: 0000000000000000
5月 21 10:48:31 mi kernel: RDX: 0000000000000000 RSI: 0000000000000807 RDI: 0000000000000000
5月 21 10:48:31 mi kernel: RBP: ffff8ca35fd28184 R08: 0000000000000000 R09: 0000000000000001
5月 21 10:48:31 mi kernel: R10: 0000000000000001 R11: 0000000000000008 R12: ffff8ca346ea8790
5月 21 10:48:31 mi kernel: R13: 0000000000008000 R14: ffff8ca33bac1800 R15: ffff8ca346ea876c
5月 21 10:48:31 mi kernel: FS:  0000000000000000(0000) GS:ffff8ca43f740000(0000) knlGS:0000000000000000
5月 21 10:48:31 mi kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
5月 21 10:48:31 mi kernel: CR2: 00007fb0dbc47524 CR3: 000000039b610000 CR4: 0000000000350ee0
5月 21 10:48:31 mi kernel: BUG: unable to handle page fault for address: ffffae304aee3ea8
5月 21 10:48:31 mi kernel: #PF: supervisor read access in kernel mode
5月 21 10:48:31 mi kernel: #PF: error_code(0x0000) - not-present page
5月 21 10:48:31 mi kernel: PGD 100000067 P4D 100000067 PUD 1001b4067 PMD 107b95067 PTE 0
5月 21 10:48:31 mi kernel: Oops: 0000 [#2] PREEMPT SMP NOPTI
5月 21 10:48:31 mi kernel: CPU: 3 PID: 531 Comm: kworker/u33:2 Tainted: G      D           5.17.9-zen1-1-zen #1 b447c96d85e73a9127528593906685354a7b7c5d
5月 21 10:48:31 mi kernel: Hardware name: TIMI RedmiBook 14 II/TM1951, BIOS RMARN4B0P0909 08/19/2020
5月 21 10:48:31 mi kernel: Workqueue: hci0 hci_rx_work [bluetooth]
5月 21 10:48:31 mi kernel: RIP: 0010:__wake_up_common+0x11b/0x1f0
5月 21 10:48:31 mi kernel: Code: 00 01 00 00 00 00 ad de 48 8b 44 24 08 48 be 22 01 00 00 00 00 ad de 48 89 48 18 48 89 70 20 c7 00 00 00 00 00 e9 28 ff ff ff <49> 8b 47 18 49 8d 57 18 4d 89 f8 48 83 e8 18 48 39 d3 0f 84 77 ff
5月 21 10:48:31 mi kernel: RSP: 0018:ffffae3041183c58 EFLAGS: 00010083
5月 21 10:48:31 mi kernel: RAX: 0000000000000000 RBX: ffff8ca25335bac8 RCX: 00000000000000c3
5月 21 10:48:31 mi kernel: RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff8ca35f9d8520
5月 21 10:48:31 mi kernel: RBP: 0000000000000000 R08: ffff8ca35f9d8520 R09: ffffae3041183ca8
5月 21 10:48:31 mi kernel: R10: 0000000000000000 R11: 0000000000000008 R12: 0000000000000010
5月 21 10:48:31 mi kernel: R13: 00000000000000c3 R14: 0000000000000001 R15: ffffae304aee3e90
5月 21 10:48:31 mi kernel: FS:  0000000000000000(0000) GS:ffff8ca43f6c0000(0000) knlGS:0000000000000000
5月 21 10:48:31 mi kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
5月 21 10:48:31 mi kernel: CR2: ffffae304aee3ea8 CR3: 0000000188204000 CR4: 0000000000350ee0
5月 21 10:48:31 mi kernel: Call Trace:
5月 21 10:48:31 mi kernel:  <TASK>
5月 21 10:48:31 mi kernel:  __wake_up_sync_key+0x80/0xc0
5月 21 10:48:31 mi kernel:  sock_def_readable+0x3c/0x80
5月 21 10:48:31 mi kernel:  __sock_queue_rcv_skb+0x121/0x230
5月 21 10:48:31 mi kernel:  l2cap_sock_recv_cb+0x5a/0xa0 [bluetooth 91de6cd5e8008c1d1b8bbe3f5c8462078a370a2a]
5月 21 10:48:31 mi kernel:  l2cap_recv_frame+0x55e/0x26a0 [bluetooth 91de6cd5e8008c1d1b8bbe3f5c8462078a370a2a]
5月 21 10:48:31 mi kernel:  ? newidle_balance+0x2ae/0x450
5月 21 10:48:31 mi kernel:  ? psi_task_switch+0xcf/0x390
5月 21 10:48:31 mi kernel:  ? finish_task_switch.isra.0+0xb1/0x2b0
5月 21 10:48:31 mi kernel:  hci_rx_work+0x164/0x400 [bluetooth 91de6cd5e8008c1d1b8bbe3f5c8462078a370a2a]
5月 21 10:48:31 mi kernel:  process_one_work+0x252/0x410
5月 21 10:48:31 mi kernel:  worker_thread+0x54/0x4d0
5月 21 10:48:31 mi kernel:  ? mod_delayed_work_on+0x120/0x120
5月 21 10:48:31 mi kernel:  kthread+0x138/0x160
5月 21 10:48:31 mi kernel:  ? kthread_complete_and_exit+0x20/0x20
5月 21 10:48:31 mi kernel:  ret_from_fork+0x1f/0x30
5月 21 10:48:31 mi kernel:  </TASK>
5月 21 10:48:31 mi kernel: Modules linked in: hid_nintendo ff_memless hidp snd_seq_dummy snd_hrtimer snd_seq snd_seq_device ccm rfcomm tun cmac algif_hash algif_skcipher af_alg bnep nls_iso8859_1 vfat fat hid_apple btusb btrtl btbcm btintel btmtk bluetooth ecdh_generic crc16 usbhid apple_mfi_fastcharge intel_rapl_msr intel_rapl_common edac_mce_amd joydev kvm_amd snd_acp3x_pdm_dma mousedev snd_acp3x_rn kvm snd_soc_dmic irqbypass hid_multitouch serio_raw wmi_bmof crct10dif_pclmul snd_sof_amd_renoir lzo_rle crc32_pclmul snd_acp_config snd_sof_amd_acp rtw88_8822ce ghash_clmulni_intel snd_sof_pci rtw88_8822c aesni_intel crypto_simd snd_sof cryptd snd_hda_codec_realtek rapl snd_soc_acpi rtw88_pci snd_hda_codec_generic ledtrig_audio snd_hda_codec_hdmi pcspkr rtw88_core snd_hda_intel snd_soc_core snd_intel_dspcfg snd_compress snd_intel_sdw_acpi ac97_bus mac80211 snd_pcm_dmaengine snd_hda_codec snd_pci_acp6x snd_hda_core snd_hwdep snd_pci_acp5x sp5100_tco snd_pcm k10temp snd_rn_pci_acp3x libarc4 i2c_piix4
5月 21 10:48:31 mi kernel:  snd_pci_acp3x snd_timer snd xhci_pci tpm_crb xhci_pci_renesas soundcore ccp cfg80211 ucsi_acpi typec_ucsi rfkill tpm_tis typec tpm_tis_core roles mac_hid i8042 video tpm i2c_hid_acpi wmi rng_core i2c_hid acpi_cpufreq pinctrl_amd amd_pmc pkcs8_key_parser dm_multipath dm_mod ledtrig_timer sg crypto_user fuse zram bpf_preload ip_tables x_tables amdgpu drm_ttm_helper ttm gpu_sched atkbd libps2 serio btrfs blake2b_generic libcrc32c crc32c_generic crc32c_intel xor raid6_pq
5月 21 10:48:31 mi kernel: CR2: ffffae304aee3ea8
5月 21 10:48:31 mi kernel: ---[ end trace 0000000000000000 ]---
5月 21 10:48:31 mi kernel: RIP: 0010:nintendo_hid_event+0x5ff/0xd20 [hid_nintendo]
5月 21 10:48:31 mi kernel: Code: 08 00 00 44 8b 83 04 08 00 00 89 c6 0f b7 04 24 8b bb 00 08 00 00 39 c8 0f 8e 51 04 00 00 29 c8 29 cf 89 c2 c1 e0 0f 29 d0 99 <f7> ff 44 8b 8b 10 08 00 00 8b bb 0c 08 00 00 ba 01 80 ff ff 0f b7
5月 21 10:48:31 mi kernel: RSP: 0018:ffffae304aee3d48 EFLAGS: 00010212
5月 21 10:48:31 mi kernel: RAX: 000000000403f7f8 RBX: ffff8ca346ea8028 RCX: 0000000000000000
5月 21 10:48:31 mi kernel: RDX: 0000000000000000 RSI: 0000000000000807 RDI: 0000000000000000
5月 21 10:48:31 mi kernel: RBP: ffff8ca35fd28184 R08: 0000000000000000 R09: 0000000000000001
5月 21 10:48:31 mi kernel: R10: 0000000000000001 R11: 0000000000000008 R12: ffff8ca346ea8790
5月 21 10:48:31 mi kernel: R13: 0000000000008000 R14: ffff8ca33bac1800 R15: ffff8ca346ea876c
5月 21 10:48:31 mi kernel: FS:  0000000000000000(0000) GS:ffff8ca43f6c0000(0000) knlGS:0000000000000000
5月 21 10:48:31 mi kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
5月 21 10:48:31 mi kernel: CR2: ffffae304aee3ea8 CR3: 0000000188204000 CR4: 0000000000350ee0
5月 21 10:48:31 mi kernel: note: kworker/u33:2[531] exited with preempt_count 1
5月 21 10:49:02 mi kernel: watchdog: BUG: soft lockup - CPU#1 stuck for 23s! [Xorg:609]
5月 21 10:49:02 mi kernel: Modules linked in: hid_nintendo ff_memless hidp snd_seq_dummy snd_hrtimer snd_seq snd_seq_device ccm rfcomm tun cmac algif_hash algif_skcipher af_alg bnep nls_iso8859_1 vfat fat hid_apple btusb btrtl btbcm btintel btmtk bluetooth ecdh_generic crc16 usbhid apple_mfi_fastcharge intel_rapl_msr intel_rapl_common edac_mce_amd joydev kvm_amd snd_acp3x_pdm_dma mousedev snd_acp3x_rn kvm snd_soc_dmic irqbypass hid_multitouch serio_raw wmi_bmof crct10dif_pclmul snd_sof_amd_renoir lzo_rle crc32_pclmul snd_acp_config snd_sof_amd_acp rtw88_8822ce ghash_clmulni_intel snd_sof_pci rtw88_8822c aesni_intel crypto_simd snd_sof cryptd snd_hda_codec_realtek rapl snd_soc_acpi rtw88_pci snd_hda_codec_generic ledtrig_audio snd_hda_codec_hdmi pcspkr rtw88_core snd_hda_intel snd_soc_core snd_intel_dspcfg snd_compress snd_intel_sdw_acpi ac97_bus mac80211 snd_pcm_dmaengine snd_hda_codec snd_pci_acp6x snd_hda_core snd_hwdep snd_pci_acp5x sp5100_tco snd_pcm k10temp snd_rn_pci_acp3x libarc4 i2c_piix4
5月 21 10:49:02 mi kernel:  snd_pci_acp3x snd_timer snd xhci_pci tpm_crb xhci_pci_renesas soundcore ccp cfg80211 ucsi_acpi typec_ucsi rfkill tpm_tis typec tpm_tis_core roles mac_hid i8042 video tpm i2c_hid_acpi wmi rng_core i2c_hid acpi_cpufreq pinctrl_amd amd_pmc pkcs8_key_parser dm_multipath dm_mod ledtrig_timer sg crypto_user fuse zram bpf_preload ip_tables x_tables amdgpu drm_ttm_helper ttm gpu_sched atkbd libps2 serio btrfs blake2b_generic libcrc32c crc32c_generic crc32c_intel xor raid6_pq
5月 21 10:49:02 mi kernel: CPU: 1 PID: 609 Comm: Xorg Tainted: G      D           5.17.9-zen1-1-zen #1 b447c96d85e73a9127528593906685354a7b7c5d
5月 21 10:49:02 mi kernel: Hardware name: TIMI RedmiBook 14 II/TM1951, BIOS RMARN4B0P0909 08/19/2020
5月 21 10:49:02 mi kernel: RIP: 0010:smp_call_function_many_cond+0xfb/0x2e0
5月 21 10:49:02 mi kernel: Code: 48 89 de e8 d7 06 50 00 3b 05 21 82 e8 01 89 c7 73 22 48 63 c7 49 8b 0c 24 48 03 0c c5 e0 5a 17 af 8b 41 08 a8 01 74 0a f3 90 <8b> 51 08 83 e2 01 75 f6 eb cc 48 83 c4 48 5b 5d 41 5c 41 5d 41 5e
5月 21 10:49:02 mi kernel: RSP: 0018:ffffae304255b860 EFLAGS: 00000202
5月 21 10:49:02 mi kernel: RAX: 0000000000000011 RBX: ffff8ca43f673b08 RCX: ffff8ca43f6f9760
5月 21 10:49:02 mi kernel: RDX: 0000000000000001 RSI: 0000000000000000 RDI: 0000000000000003
5月 21 10:49:02 mi kernel: RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
5月 21 10:49:02 mi kernel: R10: fffffffffffffff8 R11: 0000000000000005 R12: ffff8ca43f673b00
5月 21 10:49:02 mi kernel: R13: 0000000000000001 R14: ffff8ca43f673b00 R15: 0000000000000140
5月 21 10:49:02 mi kernel: FS:  00007f1c8eff7dc0(0000) GS:ffff8ca43f640000(0000) knlGS:0000000000000000
5月 21 10:49:02 mi kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
5月 21 10:49:02 mi kernel: CR2: 00007f1c6a18d000 CR3: 000000011640c000 CR4: 0000000000350ee0
5月 21 10:49:02 mi kernel: Call Trace:
5月 21 10:49:02 mi kernel:  <TASK>
5月 21 10:49:02 mi kernel:  ? __flush_tlb_all+0x30/0x30
5月 21 10:49:02 mi kernel:  on_each_cpu_cond_mask+0x20/0x40
5月 21 10:49:02 mi kernel:  __purge_vmap_area_lazy+0xd6/0x700
5月 21 10:49:02 mi kernel:  _vm_unmap_aliases.part.0+0xee/0x120
5月 21 10:49:02 mi kernel:  change_page_attr_set_clr.constprop.1+0x5a/0x110
5月 21 10:49:02 mi kernel:  _set_pages_array+0xde/0x110
5月 21 10:49:02 mi kernel:  ttm_pool_alloc+0x722/0x800 [ttm 5af2a99fe913383f97d7b602ab443d277e72609c]
5月 21 10:49:02 mi kernel:  amdgpu_ttm_tt_populate+0x32/0x90 [amdgpu e486192e9b274e9991fb0ceb6f0b787ade46e4fb]
5月 21 10:49:02 mi kernel:  ttm_tt_populate+0x9a/0x140 [ttm 5af2a99fe913383f97d7b602ab443d277e72609c]
5月 21 10:49:02 mi kernel:  ttm_bo_validate+0x1d7/0x350 [ttm 5af2a99fe913383f97d7b602ab443d277e72609c]
5月 21 10:49:02 mi kernel:  ttm_bo_init_reserved+0x1d5/0x3c0 [ttm 5af2a99fe913383f97d7b602ab443d277e72609c]
5月 21 10:49:02 mi kernel:  ? __kmalloc_node+0x1b3/0x450
5月 21 10:49:02 mi kernel:  amdgpu_bo_create+0x1ba/0x530 [amdgpu e486192e9b274e9991fb0ceb6f0b787ade46e4fb]
5月 21 10:49:02 mi kernel:  ? amdgpu_bo_destroy+0x70/0x70 [amdgpu e486192e9b274e9991fb0ceb6f0b787ade46e4fb]
5月 21 10:49:02 mi kernel:  amdgpu_bo_create_user+0x3c/0x70 [amdgpu e486192e9b274e9991fb0ceb6f0b787ade46e4fb]
5月 21 10:49:02 mi kernel:  amdgpu_gem_create_ioctl+0x146/0x3a0 [amdgpu e486192e9b274e9991fb0ceb6f0b787ade46e4fb]
5月 21 10:49:02 mi kernel:  ? amdgpu_bo_destroy+0x70/0x70 [amdgpu e486192e9b274e9991fb0ceb6f0b787ade46e4fb]
5月 21 10:49:02 mi kernel:  ? amdgpu_gem_force_release+0x160/0x160 [amdgpu e486192e9b274e9991fb0ceb6f0b787ade46e4fb]
5月 21 10:49:02 mi kernel:  drm_ioctl_kernel+0xc3/0x170
5月 21 10:49:02 mi kernel:  drm_ioctl+0x22a/0x410
5月 21 10:49:02 mi kernel:  ? amdgpu_gem_force_release+0x160/0x160 [amdgpu e486192e9b274e9991fb0ceb6f0b787ade46e4fb]
5月 21 10:49:02 mi kernel:  amdgpu_drm_ioctl+0x4a/0x80 [amdgpu e486192e9b274e9991fb0ceb6f0b787ade46e4fb]
5月 21 10:49:02 mi kernel:  __x64_sys_ioctl+0x8a/0xc0
5月 21 10:49:02 mi kernel:  do_syscall_64+0x58/0x80
5月 21 10:49:02 mi kernel:  ? syscall_exit_to_user_mode+0x23/0x50
5月 21 10:49:02 mi kernel:  ? do_syscall_64+0x67/0x80
5月 21 10:49:02 mi kernel:  ? syscall_exit_to_user_mode+0x23/0x50
5月 21 10:49:02 mi kernel:  ? do_syscall_64+0x67/0x80
5月 21 10:49:02 mi kernel:  ? do_syscall_64+0x67/0x80
5月 21 10:49:02 mi kernel:  ? do_syscall_64+0x67/0x80
5月 21 10:49:02 mi kernel:  entry_SYSCALL_64_after_hwframe+0x44/0xae
5月 21 10:49:02 mi kernel: RIP: 0033:0x7f1c8f96db1f
5月 21 10:49:02 mi kernel: Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 18 48 8b 44 24 18 64 48 2b 04 25 28 00 00
5月 21 10:49:02 mi kernel: RSP: 002b:00007ffcd22313c0 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
5月 21 10:49:02 mi kernel: RAX: ffffffffffffffda RBX: 00007ffcd2231460 RCX: 00007f1c8f96db1f
5月 21 10:49:02 mi kernel: RDX: 00007ffcd2231460 RSI: 00000000c0206440 RDI: 000000000000000e
5月 21 10:49:02 mi kernel: RBP: 00000000c0206440 R08: 0000000000000007 R09: 0000000000000005
5月 21 10:49:02 mi kernel: R10: 000055dec0cab010 R11: 0000000000000246 R12: 0000000000000002
5月 21 10:49:02 mi kernel: R13: 000000000000000e R14: 000000000011e000 R15: 0000000000000211
5月 21 10:49:02 mi kernel:  </TASK>
5月 21 10:49:30 mi kernel: watchdog: BUG: soft lockup - CPU#1 stuck for 49s! [Xorg:609]

Not sure if this is the correct place to report this since this is coming from hid_nintendo but this repository seemed to be joycond.

@pickfire
Copy link
Author

Mainline log `5.18.0-rc7-1-mainline`
...
5月 21 11:15:01 mi kernel: Bluetooth: hci0: AOSP extensions version v1.00
5月 21 11:15:01 mi kernel: Bluetooth: hci0: AOSP quality report is supported
5月 21 11:15:33 mi kernel: Bluetooth: HIDP (Human Interface Emulation) ver 1.2
5月 21 11:15:33 mi kernel: Bluetooth: HIDP socket layer initialized
5月 21 11:15:33 mi kernel: hid-generic 0005:057E:2009.0006: unknown main item tag 0x0
5月 21 11:15:33 mi kernel: input: Pro Controller as /devices/pci0000:00/0000:00:08.1/0000:02:00.3/usb1/1-4/1-4:1.0/bluetooth/hci0/hci0:1/0005:057E:2009.0006/input/input21
5月 21 11:15:33 mi kernel: hid-generic 0005:057E:2009.0006: input,hidraw5: BLUETOOTH HID v0.01 Gamepad [Pro Controller] on 80:30:49:10:6b:d0
5月 21 11:15:34 mi kernel: nintendo 0005:057E:2009.0006: unknown main item tag 0x0
5月 21 11:15:34 mi kernel: nintendo 0005:057E:2009.0006: hidraw5: BLUETOOTH HID v80.01 Gamepad [Pro Controller] on 80:30:49:10:6b:d0
5月 21 11:15:36 mi kernel: nintendo 0005:057E:2009.0006: using user cal for left stick
5月 21 11:15:36 mi kernel: nintendo 0005:057E:2009.0006: using user cal for right stick
5月 21 11:15:36 mi kernel: nintendo 0005:057E:2009.0006: using factory cal for IMU
5月 21 11:15:36 mi kernel: nintendo 0005:057E:2009.0006: controller MAC = 98:B6:E9:EC:11:08
5月 21 11:15:36 mi kernel: input: Nintendo Switch Pro Controller as /devices/pci0000:00/0000:00:08.1/0000:02:00.3/usb1/1-4/1-4:1.0/bluetooth/hci0/hci0:1/0005:057E:2009.0006/input/input22
5月 21 11:15:36 mi kernel: input: Nintendo Switch Pro Controller IMU as /devices/pci0000:00/0000:00:08.1/0000:02:00.3/usb1/1-4/1-4:1.0/bluetooth/hci0/hci0:1/0005:057E:2009.0006/input/input23
5月 21 11:15:36 mi kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI
5月 21 11:15:36 mi kernel: CPU: 5 PID: 10745 Comm: khidpd_057e2009 Not tainted 5.18.0-rc7-1-mainline #1 65eeb77e9a84a6e1178324052e8f048ee7baa6f3
5月 21 11:15:36 mi kernel: Hardware name: TIMI RedmiBook 14 II/TM1951, BIOS RMARN4B0P0909 08/19/2020
5月 21 11:15:36 mi kernel: RIP: 0010:nintendo_hid_event+0x61c/0xd34 [hid_nintendo]
5月 21 11:15:36 mi kernel: Code: 08 00 00 8b bb 00 08 00 00 89 c6 0f b7 04 24 44 8b 83 04 08 00 00 39 c8 0f 8e 78 04 00 00 29 c8 29 cf 89 c2 c1 e0 0f 29 d0 99 <f7> ff 8b bb 0c 08 00 00 44 8b 8b 10 08 00 00 ba 01 80 ff ff 0f b7
5月 21 11:15:36 mi kernel: RSP: 0018:ffffa9b842befd48 EFLAGS: 00010212
5月 21 11:15:36 mi kernel: RAX: 000000000403f7f8 RBX: ffff981fabd91028 RCX: 0000000000000000
5月 21 11:15:36 mi kernel: RDX: 0000000000000000 RSI: 0000000000000807 RDI: 0000000000000000
5月 21 11:15:36 mi kernel: RBP: ffff981e883d0184 R08: 0000000000000000 R09: 0000000000000000
5月 21 11:15:36 mi kernel: R10: 0000000000000001 R11: 0000000000000005 R12: ffff981fabd91790
5月 21 11:15:36 mi kernel: R13: 0000000000000000 R14: ffff981e04362800 R15: ffff981fabd9176c
5月 21 11:15:36 mi kernel: FS:  0000000000000000(0000) GS:ffff9820ff740000(0000) knlGS:0000000000000000
5月 21 11:15:36 mi kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
5月 21 11:15:36 mi kernel: CR2: 000055725f3e7c40 CR3: 0000000296e10000 CR4: 0000000000350ee0
5月 21 11:15:36 mi kernel: Call Trace:
5月 21 11:15:36 mi kernel:  <TASK>
5月 21 11:15:36 mi kernel:  ? schedule+0x4b/0xb0
5月 21 11:15:36 mi kernel:  hid_input_report+0x139/0x160
5月 21 11:15:36 mi kernel:  hidp_session_run+0x357/0x6b0 [hidp 911721784933713739de472684805f11203fb951]
5月 21 11:15:36 mi kernel:  ? _raw_spin_rq_lock_irqsave+0x20/0x20
5月 21 11:15:36 mi kernel:  ? hidp_session_run+0x6b0/0x6b0 [hidp 911721784933713739de472684805f11203fb951]
5月 21 11:15:36 mi kernel:  hidp_session_thread+0x11d/0x230 [hidp 911721784933713739de472684805f11203fb951]
5月 21 11:15:36 mi kernel:  ? hidp_close+0x10/0x10 [hidp 911721784933713739de472684805f11203fb951]
5月 21 11:15:36 mi kernel:  ? hidp_close+0x10/0x10 [hidp 911721784933713739de472684805f11203fb951]
5月 21 11:15:36 mi kernel:  kthread+0xd7/0x100
5月 21 11:15:36 mi kernel:  ? kthread_complete_and_exit+0x20/0x20
5月 21 11:15:36 mi kernel:  ret_from_fork+0x1f/0x30
5月 21 11:15:36 mi kernel:  </TASK>
5月 21 11:15:36 mi kernel: Modules linked in: hid_nintendo ff_memless hidp snd_seq_dummy snd_hrtimer snd_seq snd_seq_device ccm rfcomm tun cmac algif_hash algif_skcipher af_alg bnep nls_iso8859_1 vfat fat hid_apple btusb btrtl btbcm btintel btmtk apple_mfi_fastcharge bluetooth usbhid ecdh_generic crc16 intel_rapl_msr snd_acp3x_pdm_dma joydev snd_soc_dmic snd_acp3x_rn mousedev intel_rapl_common serio_raw hid_multitouch edac_mce_amd wmi_bmof kvm_amd lzo_rle kvm irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel crypto_simd cryptd rapl pcspkr rtw88_8822ce snd_sof_amd_renoir rtw88_8822c snd_sof_amd_acp snd_sof_pci snd_hda_codec_realtek snd_sof snd_hda_codec_generic snd_sof_utils rtw88_pci rtw88_core ledtrig_audio snd_soc_core snd_hda_codec_hdmi snd_compress snd_hda_intel mac80211 snd_intel_dspcfg ac97_bus snd_intel_sdw_acpi snd_pcm_dmaengine k10temp snd_hda_codec snd_pci_acp6x snd_pci_acp5x sp5100_tco snd_hda_core snd_rn_pci_acp3x snd_hwdep i2c_piix4 snd_acp_config snd_soc_acpi
5月 21 11:15:36 mi kernel:  libarc4 snd_pcm snd_pci_acp3x snd_timer snd xhci_pci ccp soundcore xhci_pci_renesas cfg80211 rfkill tpm_crb ucsi_acpi typec_ucsi tpm_tis tpm_tis_core typec roles i8042 mac_hid tpm i2c_hid_acpi video rng_core wmi i2c_hid acpi_cpufreq amd_pmc pinctrl_amd pkcs8_key_parser dm_multipath dm_mod ledtrig_timer sg crypto_user fuse zram bpf_preload ip_tables x_tables amdgpu drm_ttm_helper ttm gpu_sched drm_dp_helper atkbd libps2 serio vivaldi_fmap btrfs blake2b_generic libcrc32c crc32c_generic crc32c_intel xor raid6_pq
5月 21 11:15:36 mi kernel: ---[ end trace 0000000000000000 ]---
5月 21 11:15:36 mi kernel: RIP: 0010:nintendo_hid_event+0x61c/0xd34 [hid_nintendo]
5月 21 11:15:36 mi kernel: Code: 08 00 00 8b bb 00 08 00 00 89 c6 0f b7 04 24 44 8b 83 04 08 00 00 39 c8 0f 8e 78 04 00 00 29 c8 29 cf 89 c2 c1 e0 0f 29 d0 99 <f7> ff 8b bb 0c 08 00 00 44 8b 8b 10 08 00 00 ba 01 80 ff ff 0f b7
5月 21 11:15:36 mi kernel: RSP: 0018:ffffa9b842befd48 EFLAGS: 00010212
5月 21 11:15:36 mi kernel: RAX: 000000000403f7f8 RBX: ffff981fabd91028 RCX: 0000000000000000
5月 21 11:15:36 mi kernel: RDX: 0000000000000000 RSI: 0000000000000807 RDI: 0000000000000000
5月 21 11:15:36 mi kernel: RBP: ffff981e883d0184 R08: 0000000000000000 R09: 0000000000000000
5月 21 11:15:36 mi kernel: R10: 0000000000000001 R11: 0000000000000005 R12: ffff981fabd91790
5月 21 11:15:36 mi kernel: R13: 0000000000000000 R14: ffff981e04362800 R15: ffff981fabd9176c
5月 21 11:15:36 mi kernel: FS:  0000000000000000(0000) GS:ffff9820ff740000(0000) knlGS:0000000000000000
5月 21 11:15:36 mi kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
5月 21 11:15:36 mi kernel: CR2: 000055725f3e7c40 CR3: 0000000296e10000 CR4: 0000000000350ee0
5月 21 11:15:36 mi kernel: BUG: kernel NULL pointer dereference, address: 0000000000000000
5月 21 11:15:36 mi kernel: #PF: supervisor read access in kernel mode
5月 21 11:15:36 mi kernel: #PF: error_code(0x0000) - not-present page

@dogtopus
Copy link

Looks like there's a division-by-zero error somewhere near nintendo_hid_event. Wild guess: something is wrong in the calibration data?

@pickfire
Copy link
Author

pickfire commented May 21, 2022

Not sure, I never tweaked it myself.

But I thought it was null pointer dereference? I can't see how is it division by zero.

@dogtopus
Copy link

But I thought it was null pointer dereference? I can't see how is it division by zero.

Because

kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

@pickfire
Copy link
Author

pickfire commented Jul 16, 2022

I believe other people faced the same issue. https://bbs.archlinux.org/viewtopic.php?id=276196

Lately I could connect using bluetooth (wired still kernel panic), my mouse can still move but the computer does not seemed to respond to any other inputs like mouse buttons and keyboard presses after like few seconds.

Logs
[  128.409091] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[  128.409102] Bluetooth: HIDP socket layer initialized
[  128.410089] hid-generic 0005:057E:2009.0006: unknown main item tag 0x0
[  128.410190] input: Pro Controller as /devices/pci0000:00/0000:00:08.1/0000:02:00.3/usb1/1-4/1-4:1.0/bluetooth/hci0/hci0:1/0005:057E:2009.0006/input/input21
[  128.412699] hid-generic 0005:057E:2009.0006: input,hidraw5: BLUETOOTH HID v0.01 Gamepad [Pro Controller] on 80:30:49:10:6b:d0
[  128.441179] nintendo 0005:057E:2009.0006: unknown main item tag 0x0
[  128.441889] nintendo 0005:057E:2009.0006: hidraw5: BLUETOOTH HID v80.01 Gamepad [Pro Controller] on 80:30:49:10:6b:d0
[  130.509912] nintendo 0005:057E:2009.0006: using user cal for left stick
[  130.518730] nintendo 0005:057E:2009.0006: using user cal for right stick
[  130.552398] nintendo 0005:057E:2009.0006: using factory cal for IMU
[  130.615078] nintendo 0005:057E:2009.0006: controller MAC = 98:B6:E9:EC:11:08
[  130.639756] input: Nintendo Switch Pro Controller as /devices/pci0000:00/0000:00:08.1/0000:02:00.3/usb1/1-4/1-4:1.0/bluetooth/hci0/hci0:1/0005:057E:2009.0006/input/input22
[  130.639925] input: Nintendo Switch Pro Controller IMU as /devices/pci0000:00/0000:00:08.1/0000:02:00.3/usb1/1-4/1-4:1.0/bluetooth/hci0/hci0:1/0005:057E:2009.0006/input/input23
[  130.647017] divide error: 0000 [#1] PREEMPT SMP NOPTI
[  130.647028] CPU: 5 PID: 15789 Comm: khidpd_057e2009 Not tainted 5.18.10-zen1-1-zen #1 2201acb6046b045d639a72b5687772d48f1472c0
[  130.647035] Hardware name: TIMI RedmiBook 14 II/TM1951, BIOS RMARN4B0P0909 08/19/2020
[  130.647038] RIP: 0010:nintendo_hid_event+0x603/0xd20 [hid_nintendo]
[  130.647049] Code: 08 00 00 44 8b 83 04 08 00 00 89 c6 0f b7 04 24 8b bb 00 08 00 00 39 c8 0f 8e 51 04 00 00 29 c8 29 cf 89 c2 c1 e0 0f 29 d0 99 <f7> ff 44 8b 8b 10 08 00 00 8b bb 0c 08 00 00 ba 01 80 ff ff 0f b7
[  130.647053] RSP: 0018:ffff9fa54acbfd58 EFLAGS: 00010212
[  130.647058] RAX: 000000000403f7f8 RBX: ffff943b0d19d028 RCX: 0000000000000000
[  130.647061] RDX: 0000000000000000 RSI: 0000000000000807 RDI: 0000000000000000
[  130.647064] RBP: ffff943b10380184 R08: 0000000000000000 R09: 0000000000000001
[  130.647067] R10: 0000000000000001 R11: 0000000000000008 R12: ffff943b0d19d790
[  130.647069] R13: 0000000000000000 R14: ffff943ae8b10000 R15: ffff943b0d19d76c
[  130.647072] FS:  0000000000000000(0000) GS:ffff943bbf740000(0000) knlGS:0000000000000000
[  130.647076] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  130.647079] CR2: 000055652e3d0010 CR3: 000000010528e000 CR4: 0000000000350ee0
[  130.647082] Call Trace:
[  130.647086]  <TASK>
[  130.647090]  ? schedule+0x4f/0xb0
[  130.647100]  hid_input_report+0x12b/0x160
[  130.647107]  hidp_session_thread+0x4c3/0x960 [hidp eb2a816d837a4c96ebdd4cfa220bf484987fff92]
[  130.647116]  ? hidp_close+0x10/0x10 [hidp eb2a816d837a4c96ebdd4cfa220bf484987fff92]
[  130.647123]  ? hidp_close+0x10/0x10 [hidp eb2a816d837a4c96ebdd4cfa220bf484987fff92]
[  130.647129]  ? do_wait_intr_irq+0xb0/0xb0
[  130.647135]  ? hidp_session_remove+0x180/0x180 [hidp eb2a816d837a4c96ebdd4cfa220bf484987fff92]
[  130.647142]  kthread+0x13c/0x160
[  130.647149]  ? kthread_complete_and_exit+0x20/0x20
[  130.647155]  ret_from_fork+0x1f/0x30
[  130.647163]  </TASK>
[  130.647165] Modules linked in: hid_nintendo ff_memless hidp ccm snd_seq_dummy snd_hrtimer snd_seq snd_seq_device rfcomm cmac algif_hash algif_skcipher af_alg bnep nls_iso8859_1 vfat fat hid_apple btusb btrtl btbcm btintel btmtk bluetooth usbhid ecdh_generic apple_mfi_fastcharge crc16 tun joydev intel_rapl_msr intel_rapl_common mousedev snd_acp3x_rn snd_soc_dmic snd_acp3x_pdm_dma edac_mce_amd snd_sof_amd_renoir snd_sof_amd_acp kvm_amd snd_sof_pci kvm hid_multitouch serio_raw wmi_bmof irqbypass crct10dif_pclmul crc32_pclmul snd_sof snd_sof_utils snd_hda_codec_realtek snd_hda_codec_generic ghash_clmulni_intel snd_soc_core ledtrig_audio snd_hda_codec_hdmi aesni_intel snd_compress snd_hda_intel crypto_simd snd_intel_dspcfg ac97_bus snd_intel_sdw_acpi snd_pcm_dmaengine rtw88_8822ce cryptd snd_hda_codec snd_acp_pci rapl rtw88_8822c snd_pci_acp6x snd_hda_core pcspkr snd_pci_acp5x rtw88_pci snd_hwdep sp5100_tco rtw88_core snd_rn_pci_acp3x snd_pcm snd_acp_config k10temp i2c_piix4 xhci_pci
[  130.647249]  snd_timer mac80211 snd_soc_acpi snd xhci_pci_renesas snd_pci_acp3x ccp soundcore libarc4 ucsi_acpi cfg80211 tpm_crb typec_ucsi typec tpm_tis rfkill roles i8042 mac_hid tpm_tis_core video tpm i2c_hid_acpi i2c_hid wmi amd_pmc acpi_cpufreq rng_core pinctrl_amd lzo_rle pkcs8_key_parser dm_multipath dm_mod ledtrig_timer sg crypto_user fuse zram bpf_preload ip_tables x_tables amdgpu drm_ttm_helper ttm gpu_sched drm_dp_helper atkbd libps2 serio vivaldi_fmap btrfs blake2b_generic libcrc32c crc32c_generic crc32c_intel xor raid6_pq
[  130.647309] ---[ end trace 0000000000000000 ]---
[  130.647312] RIP: 0010:nintendo_hid_event+0x603/0xd20 [hid_nintendo]
[  130.647320] Code: 08 00 00 44 8b 83 04 08 00 00 89 c6 0f b7 04 24 8b bb 00 08 00 00 39 c8 0f 8e 51 04 00 00 29 c8 29 cf 89 c2 c1 e0 0f 29 d0 99 <f7> ff 44 8b 8b 10 08 00 00 8b bb 0c 08 00 00 ba 01 80 ff ff 0f b7
[  130.647323] RSP: 0018:ffff9fa54acbfd58 EFLAGS: 00010212
[  130.647327] RAX: 000000000403f7f8 RBX: ffff943b0d19d028 RCX: 0000000000000000
[  130.647330] RDX: 0000000000000000 RSI: 0000000000000807 RDI: 0000000000000000
[  130.647332] RBP: ffff943b10380184 R08: 0000000000000000 R09: 0000000000000001
[  130.647335] R10: 0000000000000001 R11: 0000000000000008 R12: ffff943b0d19d790
[  130.647337] R13: 0000000000000000 R14: ffff943ae8b10000 R15: ffff943b0d19d76c
[  130.647340] FS:  0000000000000000(0000) GS:ffff943bbf740000(0000) knlGS:0000000000000000
[  130.647343] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  130.647345] CR2: 000055652e3d0010 CR3: 000000010528e000 CR4: 0000000000350ee0
[  130.654495] general protection fault, probably for non-canonical address 0xa3828df22d52d700: 0000 [#2] PREEMPT SMP NOPTI
[  130.654505] CPU: 4 PID: 109 Comm: kworker/u33:0 Tainted: G      D           5.18.10-zen1-1-zen #1 2201acb6046b045d639a72b5687772d48f1472c0
[  130.654512] Hardware name: TIMI RedmiBook 14 II/TM1951, BIOS RMARN4B0P0909 08/19/2020
[  130.654516] Workqueue: hci0 hci_rx_work [bluetooth]
[  130.654577] RIP: 0010:__wake_up_common+0x78/0x1f0
[  130.654586] Code: 74 5a 49 8b 40 18 45 31 f6 4c 8d 78 e8 41 8b 28 40 f6 c5 04 0f 85 b3 00 00 00 49 8b 40 10 8b 34 24 4c 89 e9 44 89 e2 4c 89 c7 <ff> d0 0f 1f 00 85 c0 78 29 74 10 83 e5 01 74 0b 83 6c 24 04 01 0f
[  130.654590] RSP: 0018:ffff9fa54119bc58 EFLAGS: 00010046
[  130.654594] RAX: a3828df22d52d700 RBX: ffff943a62a1edc8 RCX: 00000000000000c3
[  130.654597] RDX: 0000000000000010 RSI: 0000000000000001 RDI: ffff9fa54acbfe90
[  130.654600] RBP: 000000000524b928 R08: ffff9fa54acbfe90 R09: ffff9fa54119bca8
[  130.654603] R10: ffff943a7c941310 R11: 0000000000000008 R12: 0000000000000010
[  130.654605] R13: 00000000000000c3 R14: 0000000000000001 R15: fffffffffffffffc
[  130.654608] FS:  0000000000000000(0000) GS:ffff943bbf700000(0000) knlGS:0000000000000000
[  130.654612] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  130.654615] CR2: 00007f552400b07c CR3: 0000000340410000 CR4: 0000000000350ee0
[  130.654618] Call Trace:
[  130.654621]  <TASK>
[  130.654625]  __wake_up_sync_key+0x84/0xc0
[  130.654632]  sock_def_readable+0x40/0x80
[  130.654638]  __sock_queue_rcv_skb+0x125/0x240
[  130.654644]  l2cap_sock_recv_cb+0x5e/0xa0 [bluetooth 3f3dcea80218049bf3f8d82a0eaff3e7e0bb30e2]
[  130.654710]  l2cap_recv_frame+0x564/0x26b0 [bluetooth 3f3dcea80218049bf3f8d82a0eaff3e7e0bb30e2]
[  130.654768]  ? psi_task_switch+0xd3/0x3a0
[  130.654773]  ? finish_task_switch.isra.0+0x88/0x2b0
[  130.654780]  hci_rx_work+0x168/0x410 [bluetooth 3f3dcea80218049bf3f8d82a0eaff3e7e0bb30e2]
[  130.654835]  process_one_work+0x252/0x410
[  130.654841]  worker_thread+0x55/0x4d0
[  130.654845]  ? process_one_work+0x410/0x410
[  130.654849]  kthread+0x13c/0x160
[  130.654854]  ? kthread_complete_and_exit+0x20/0x20
[  130.654860]  ret_from_fork+0x1f/0x30
[  130.654869]  </TASK>
[  130.654870] Modules linked in: hid_nintendo ff_memless hidp ccm snd_seq_dummy snd_hrtimer snd_seq snd_seq_device rfcomm cmac algif_hash algif_skcipher af_alg bnep nls_iso8859_1 vfat fat hid_apple btusb btrtl btbcm btintel btmtk bluetooth usbhid ecdh_generic apple_mfi_fastcharge crc16 tun joydev intel_rapl_msr intel_rapl_common mousedev snd_acp3x_rn snd_soc_dmic snd_acp3x_pdm_dma edac_mce_amd snd_sof_amd_renoir snd_sof_amd_acp kvm_amd snd_sof_pci kvm hid_multitouch serio_raw wmi_bmof irqbypass crct10dif_pclmul crc32_pclmul snd_sof snd_sof_utils snd_hda_codec_realtek snd_hda_codec_generic ghash_clmulni_intel snd_soc_core ledtrig_audio snd_hda_codec_hdmi aesni_intel snd_compress snd_hda_intel crypto_simd snd_intel_dspcfg ac97_bus snd_intel_sdw_acpi snd_pcm_dmaengine rtw88_8822ce cryptd snd_hda_codec snd_acp_pci rapl rtw88_8822c snd_pci_acp6x snd_hda_core pcspkr snd_pci_acp5x rtw88_pci snd_hwdep sp5100_tco rtw88_core snd_rn_pci_acp3x snd_pcm snd_acp_config k10temp i2c_piix4 xhci_pci
[  130.654953]  snd_timer mac80211 snd_soc_acpi snd xhci_pci_renesas snd_pci_acp3x ccp soundcore libarc4 ucsi_acpi cfg80211 tpm_crb typec_ucsi typec tpm_tis rfkill roles i8042 mac_hid tpm_tis_core video tpm i2c_hid_acpi i2c_hid wmi amd_pmc acpi_cpufreq rng_core pinctrl_amd lzo_rle pkcs8_key_parser dm_multipath dm_mod ledtrig_timer sg crypto_user fuse zram bpf_preload ip_tables x_tables amdgpu drm_ttm_helper ttm gpu_sched drm_dp_helper atkbd libps2 serio vivaldi_fmap btrfs blake2b_generic libcrc32c crc32c_generic crc32c_intel xor raid6_pq
[  130.655012] ---[ end trace 0000000000000000 ]---
[  130.655014] RIP: 0010:nintendo_hid_event+0x603/0xd20 [hid_nintendo]
[  130.655022] Code: 08 00 00 44 8b 83 04 08 00 00 89 c6 0f b7 04 24 8b bb 00 08 00 00 39 c8 0f 8e 51 04 00 00 29 c8 29 cf 89 c2 c1 e0 0f 29 d0 99 <f7> ff 44 8b 8b 10 08 00 00 8b bb 0c 08 00 00 ba 01 80 ff ff 0f b7
[  130.655026] RSP: 0018:ffff9fa54acbfd58 EFLAGS: 00010212
[  130.655029] RAX: 000000000403f7f8 RBX: ffff943b0d19d028 RCX: 0000000000000000
[  130.655032] RDX: 0000000000000000 RSI: 0000000000000807 RDI: 0000000000000000
[  130.655035] RBP: ffff943b10380184 R08: 0000000000000000 R09: 0000000000000001
[  130.655037] R10: 0000000000000001 R11: 0000000000000008 R12: ffff943b0d19d790
[  130.655040] R13: 0000000000000000 R14: ffff943ae8b10000 R15: ffff943b0d19d76c
[  130.655042] FS:  0000000000000000(0000) GS:ffff943bbf700000(0000) knlGS:0000000000000000
[  130.655046] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  130.655048] CR2: 00007f552400b07c CR3: 0000000340410000 CR4: 0000000000350ee0
[  130.655051] note: kworker/u33:0[109] exited with preempt_count 1

I tried blacklisting hid_nintendo with blacklist hid_nintendo in /etc/modprobe.d/hid_nintendo.conf and install hid-nintendo-dkms (from archlinuxcn repo) https://github.com/archlinuxcn/repo/blob/master/archlinuxcn/hid-nintendo-dkms/PKGBUILD, then it seemed to work now by using that along with joycond, still can't get joycond-cemuhook to work so no motion, but it didn't kernel panic this time with the dkms version, it also works with yuzu.

Looks like joycond-cemuhook is working, not sure why those files are missing but I guess because I power off too frequently due to kernel panics. But now it seemed to run although I haven't get it working for yuzu yet. Looks like it does work but a bit slow and laggy, but I have to configure it in yuzu to get it working.

@jorgelukas
Copy link

still happen, same here with gulikit kingkong 2 pro, I wonder if it happens with the official switch pro

Linux fedora 5.18.16-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 3 15:44:49 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

@pickfire
Copy link
Author

@jorgelukas you can try the method I suggested, blacklist hid_nintendo and use hid-nintendo-dkms instead, that one at least it won't hang, at least still usable.

@JohnoKing
Copy link

JohnoKing commented Aug 22, 2022

I have debugged this hang and have found out that the hid-nintendo-dkms driver works because it contains the changes from this commit: nicman23/dkms-hid-nintendo@7f984ed (cf. nicman23/dkms-hid-nintendo#25). For some reason the kernel version of the hid_nintendo driver lacks those changes, which results in the hang when the GuliKit controller is in Nintendo Switch mode. Thus, while the hang can be avoided by using hid-nintendo-dkms, it's also possible to patch the kernel driver to avoid the hang. Patch against Linux 5.19.3:

# This patches the kernel driver with the changes in https://github.com/nicman23/dkms-hid-nintendo/commit/7f984edd
diff -Naur linux-5.19.3/drivers/hid/hid-nintendo.c linux-5.19.3-fix/drivers/hid/hid-nintendo.c
--- linux-5.19.3/drivers/hid/hid-nintendo.c	2022-08-21 06:20:09.000000000 -0700
+++ linux-5.19.3-fix/drivers/hid/hid-nintendo.c	2022-08-22 14:44:11.876342940 -0700
@@ -794,7 +794,14 @@
 					    &ctlr->left_stick_cal_x,
 					    &ctlr->left_stick_cal_y,
 					    true);
-	if (ret) {
+
+	/* check whether read succeeded and perform plausibility check for retrieved values */
+	if (ret ||
+		ctlr->left_stick_cal_x.min >= ctlr->left_stick_cal_x.center ||
+		ctlr->left_stick_cal_x.center >= ctlr->left_stick_cal_x.max ||
+		ctlr->left_stick_cal_y.min >= ctlr->left_stick_cal_y.center ||
+		ctlr->left_stick_cal_y.center >= ctlr->left_stick_cal_y.max
+	) {
 		hid_warn(ctlr->hdev,
 			 "Failed to read left stick cal, using dflts; e=%d\n",
 			 ret);
@@ -813,7 +820,14 @@
 					    &ctlr->right_stick_cal_x,
 					    &ctlr->right_stick_cal_y,
 					    false);
-	if (ret) {
+
+	/* check whether read succeeded and perform plausibility check for retrieved values */
+	if (ret ||
+		ctlr->right_stick_cal_x.min >= ctlr->right_stick_cal_x.center ||
+		ctlr->right_stick_cal_x.center >= ctlr->right_stick_cal_x.max ||
+		ctlr->right_stick_cal_y.min >= ctlr->right_stick_cal_y.center ||
+		ctlr->right_stick_cal_y.center >= ctlr->right_stick_cal_y.max
+	) {
 		hid_warn(ctlr->hdev,
 			 "Failed to read right stick cal, using dflts; e=%d\n",
 			 ret);

Recompiling the kernel with the above patch allows the GuliKit controller to work without installing hid-nintendo-dkms.

@pickfire
Copy link
Author

@JohnoKing Interesting, if you are free, do you mind sharing you did you debug it and test it out? Did you recompile the linux kernel with that patch?

If it works, should I go and send a patch to linux kernel? I am not familiar with that.

@JohnoKing
Copy link

JohnoKing commented Aug 25, 2022

To debug the hang, I created a diff of the kernel and dkms versions of hid-nintendo.c with the following command:

diff -u hid-nintendo.c-kernel hid-nintendo.c-dkms

After that, I tried applying the various individual changes in the kernel version to the dkms version of hid-nintendo, seeing what worked and what would cause a crash. These changes would be tested by recompiling the dkms driver, unplugging the GuliKit controller, unloading hid-nintendo-dkms with modprobe -r hid-nintendo and reloading it with modprobe hid-nintendo. I used this script to aid in doing that (normally it's for using my Pro Controller with Steam, though in this case it's useful for debugging):

Script (dropdown):
# Hopefully this becomes unnecessary when Steam updates to support kernel 5.16+.
# Until then Steam itself cannot use hid-nintendo.

if [[ $(id -u) != 0 ]]; then
	echo "This script must be run as root!"
	exit 1
fi

if [[ -w /etc/modprobe.d/blacklist.conf.disablesteam ]] && [[ -w /usr/lib/udev/rules.d/89-joycond.rules.disablesteam ]]; then
	# Enable hid-nintendo and joycond-cemuhook
	mv /etc/modprobe.d/blacklist.conf /etc/modprobe.d/blacklist.conf.enablesteam
	mv /etc/modprobe.d/blacklist.conf.disablesteam /etc/modprobe.d/blacklist.conf
	modprobe hid-nintendo
	mv /usr/lib/udev/rules.d/89-joycond.rules /usr/lib/udev/rules.d/89-joycond.rules.enablesteam
	mv /usr/lib/udev/rules.d/89-joycond.rules.disablesteam /usr/lib/udev/rules.d/89-joycond.rules
	udevadm control --reload-rules
	udevadm trigger
	echo "Enabled hid-nintendo and joycond-cemuhook support"
elif [[ -w /etc/modprobe.d/blacklist.conf.enablesteam ]] && [[ -w /usr/lib/udev/rules.d/89-joycond.rules.enablesteam ]]; then
	# Enable Steam support
	mv /etc/modprobe.d/blacklist.conf /etc/modprobe.d/blacklist.conf.disablesteam
	mv /etc/modprobe.d/blacklist.conf.enablesteam /etc/modprobe.d/blacklist.conf
	modprobe -r hid-nintendo
	mv /usr/lib/udev/rules.d/89-joycond.rules /usr/lib/udev/rules.d/89-joycond.rules.disablesteam
	mv /usr/lib/udev/rules.d/89-joycond.rules.enablesteam /usr/lib/udev/rules.d/89-joycond.rules
	udevadm control --reload-rules
	udevadm trigger
	echo "Enabled Steam support"
else
	# Should not happen
	echo "INTERNAL ERROR"
	exit 128
fi

# Later addition: For debugging, sync the filesystem in case the compiled kernel module hangs
sync

After I determined which change in the kernel version caused the hang, I uninstalled hid-nintendo-dkms and applied the resulting patch to the Linux kernel. Then I compiled the patched kernel and installed it, then rebooted the system. I plugged in the GuliKit controller in Nintendo Switch mode and got no hang with the patched kernel driver (I tested the controller in yuzu with the patched kernel and it worked just fine).

If it works, should I go and send a patch to linux kernel? I am not familiar with that.

I'm not familiar with sending patches to the Linux kernel either. In the case of the patch (which is from nicman23/dkms-hid-nintendo#25), it looks like it was supposed to have been sent over a year ago, but it still hasn't been submitted :/.

intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue Sep 14, 2022
Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue Sep 20, 2022
Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Changes in v2:
 - Move the plausibility check to joycon_read_stick_calibration() and
   have that function return -EINVAL if the check fails.
 - In the plausibility check, change >= to ==. hid_field_extract() never
   returns a negative value, so a scenario involving min > center or
   center > max is impossible.
 - To reduce code duplication, move the code for setting default
   calibration values into a single function called
   joycon_use_default_calibration().

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue Sep 21, 2022
Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Changes in v2:
 - Move the plausibility check to joycon_read_stick_calibration() and
   have that function return -EINVAL if the check fails.
 - In the plausibility check, change >= to ==. hid_field_extract() never
   returns a negative value, so a scenario involving min > center or
   center > max is impossible.
 - To reduce code duplication, move the code for setting default
   calibration values into a single function called
   joycon_use_default_calibration().

Changes in v3:
 - Unbreak warning string to conform to coding style.
 - Change joycon_use_default_calibration() to accept a struct hid_device
   pointer instead of a struct joycon_ctlr pointer.

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue Sep 21, 2022
Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
@JohnoKing
Copy link

The bugfix for the GuliKit controller hang is now set to be included in Linux 6.1. See:
torvalds/linux@79d11de
torvalds/linux@50503e3

ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 17, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 17, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 17, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 17, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 17, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 17, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 17, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 17, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 20, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 20, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 21, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 21, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 21, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 21, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 21, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 21, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
woodsts pushed a commit to woodsts/linux-stable that referenced this issue Oct 21, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 21, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 21, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 21, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 21, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 21, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 21, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 21, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 21, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 21, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 21, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 21, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 22, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 22, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-block that referenced this issue Oct 23, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
woodsts pushed a commit to woodsts/linux-stable that referenced this issue Oct 24, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
js731ca pushed a commit to hexagon-geo-surv/linux-leica that referenced this issue Dec 15, 2022
[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
nvidia-bfigg pushed a commit to NVIDIA-BaseOS-6/linux-nvidia-5.19 that referenced this issue Jan 19, 2023
BugLink: https://bugs.launchpad.net/bugs/1994179

[ Upstream commit 50503e3 ]

Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Kamal Mostafa <[email protected]>
K9100ii pushed a commit to K9100ii/android_kernel_samsung_universal7904 that referenced this issue Oct 28, 2023
Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [SamarV-121#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
K9100ii pushed a commit to K9100ii/android_kernel_samsung_universal7904 that referenced this issue Oct 28, 2023
Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [SamarV-121#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
K9100ii pushed a commit to K9100ii/android_kernel_samsung_universal7904 that referenced this issue Oct 29, 2023
Arne Wendt writes:
  Cheap clone controllers may (falsely) report as having a user
  calibration for the analog sticks in place, but return
  wrong/impossible values for the actual calibration data.
  In the present case at mine, the controller reports having a
  user calibration in place and successfully executes the read
  commands. The reported user calibration however is
  min = center = max = 0.

  This pull request addresses problems of this kind by checking the
  provided user calibration-data for plausibility (min < center < max)
  and falling back to the default values if implausible.

I'll note that I was experiencing a crash because of this bug when using
the GuliKit KingKong 2 controller. The crash manifests as a divide by
zero error in the kernel logs:
kernel: divide error: 0000 [SamarV-121#1] PREEMPT SMP NOPTI

Link: nicman23/dkms-hid-nintendo#25
Link: DanielOgorchock/linux#36
Co-authored-by: Arne Wendt <[email protected]>
Signed-off-by: Johnothan King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants