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

Connecting joycons don't work #1070

Closed
Spidy123222 opened this issue Jul 4, 2023 · 37 comments
Closed

Connecting joycons don't work #1070

Spidy123222 opened this issue Jul 4, 2023 · 37 comments

Comments

@Spidy123222
Copy link

On main branch 3.5 you cannot connect joycons unlike stable. It's inconsistent but when you connect every so often it crashes steamOS and restarts.

@adubberly
Copy link

Having the same issue with the NES Classic controllers (Which are treated as joycons for the switch).

SD immediately crashes after connecting via Bluetooth and then restarts to "verifying instillation"

@Gamr13
Copy link

Gamr13 commented Nov 24, 2023

Same issue as @adubberly

Wanted to use my NES controllers (for Nintendo Switch) on my Deck for some retro collections, they pair successfully, but after pairing and the connection process occurs, the Steam Deck crashes BOTH in Desktop Mode and Game Mode.

After a restart, when trying to connect the controllers via a button press to turn them on, the Steam Deck will crash yet again.

@Spidy123222
Copy link
Author

Same issue as @adubberly

Wanted to use my NES controllers (for Nintendo Switch) on my Deck for some retro collections, they pair successfully, but after pairing and the connection process occurs, the Steam Deck crashes BOTH in Desktop Mode and Game Mode.

After a restart, when trying to connect the controllers via a button press to turn them on, the Steam Deck will crash yet again.

Oh wow that's nasty and I haven't even tried desktop mode because I was just trying to play with my family on worms WMD and since it crashed had to hunt for some Xbox controllers then it worked.

@jedin1ght
Copy link

Still happening for me on SD. When I connect just one joycon it seems to be fine. It is usually only when I attempt to pair two joycons and it tries to map as L/R that causes the SD to crash and reboot.

@guilhermepiccoli
Copy link

Hi folks, thanks for the report! To my full understanding: Steam Deck crashes means a full reboot? Goes thorough the BIOS initialization, etc?

If so, this could a kernel panic. If any of you could reproduce and collect the output of journalctl -b | grep kdumpst, I'd appreciate.

Thanks!

@adubberly
Copy link

Here you go @guilhermepiccoli . I hope this is what you were looking for.

kdumpst-202311290048.zip

@guilhermepiccoli
Copy link

Here you go @guilhermepiccoli . I hope this is what you were looking for.

That's exactly it, thanks a bunch! It confirms that it was a kernel panic, caused by a divide by zero issue on hid-nintendo. As per why it didn't happen on SteamOS 3.4/stable, that version runs kernel 5.13, and the upstream hid-nintendo driver was added in 5.16 it seems ... I'm not sure what was the alternative version for SteamOS 3.4, maybe downstream or another driver?!

Anyway, I manage to spot some possible places in which such divide-by-0 could happen and I patched the driver to prevent it . Could you folks help me to check if that fixes the issue? I don't have this joycon device, so can't test myself.

In case you are interested in testing, what is the way you prefer? Should I send a full kernel tarball, or could we just try with the driver itself (a .ko file that would replace the stock driver)?

@kisak-valve
Copy link
Member

Hello @guilhermepiccoli, if the changes are isolated to a single kernel module, I'd recommend sharing the work-in-progress patch so that the more adventurous have the option to build the module themselves, and a convenience .ko.zst with the usual warnings to not trust random binaries from the internet to swap out /usr/lib/modules/<kernel version>/kernel/drivers/hid/hid-nintendo.ko.zst.

@guilhermepiccoli
Copy link

guilhermepiccoli commented Nov 30, 2023

Thanks @kisak-valve , that makes sense. So here it goes:

I've worked a potential fix plus some debug information in case the fix doesn't work. Both patches are attached here, as well as a module, that was built for kernel version 6.1.52-valve9-1-neptune-61 - check the kernel version (uname -r) and only perform the module installation if it matches exactly that version, or it won't work.

Given the usual disclaimer of "unknown" internet binaries (you should be careful and probably not install, etc), if anybody here wants to try the module, here are the steps - run all the commands below as root user and reboot the Deck:

steamos-readonly disable
cd /lib/modules/6.1.52-valve9-1-neptune-61/kernel/drivers/hid/
mv hid-nintendo.ko.zst .hid-nintendo.ko.zst-original
wget https://github.com/ValveSoftware/SteamOS/files/13507198/hid-nintendo.ko.zst.txt
mv hid-nintendo.ko.zst.txt hid-nintendo.ko.zst # github won't allow zst attachments ¬¬
steamos-readonly enable

After the reboot, please try to reproduce. One can check that the proper module is running by grep'ing dmesg and check for the follow message: debug module (hid-nintendo) for github #1070

So, two possible outcomes:

(a) If things work fine and the bug doesn't repro anymore, please attach a dmesg after some time trying to reproduce, I'd like to see if any of my warn messages were triggered;

(b) Patches don't help and the Deck crashes again - if so, please attach the kdumpst logs again here.

Thanks in advance!

0002-HID-nintendo-DEBUG.patch.txt
0001-HID-nintendo-Prevent-divide-by-zero-on-code.patch.txt

hid-nintendo.ko.zst.txt

@Mythris29
Copy link

Reboots seems to be fixed! However, now I can't get them to reconnect after a reboot. I have to forget the NES controllers and then re-pair them to get them to connect again.

@guilhermepiccoli
Copy link

This is nice, thank you @Mythris29 .

So just let me validate some stuff with you:

(a) You did have a reliable reproducer. Them you tested my patches (did you build them or tested the .ko file?), and reboot is gone?

If so, could please share a dmesg with me so I can understand what happened, i.e., which divide-by-zero was being triggered?

(b) This reboot thing is new? Did you sleep/resume the Deck in-between reboots? I'm not seeing how my code change could possibly affect that, since it's restricted to some math in the driver...

Thanks!

@Mythris29
Copy link

Sorry work has been busy so I haven't had time to come back to this until now.

a) Yes very reliable reproducer. My steamdesk would crash every time I connected my NES switch controller. After your patch it does not crash/reboot at all. I used the ko file. The reboot problem is gone for me after applying your ko file. It still works after rebooting the steamdeck.

b) I'm not sure if the controllers struggling to pair after a reboot was happening before or not. I unfortunately paired them the first time during this reboot issue so I couldn't have known if they worked before or not. It's very possible this has nothing to do with your code.

I'm going to keep testing but so far the issue seems to also be affected my 8bitdo controllers. Both in xbox mode and switch pro mode. I'll try rolling back the .ko and see if that changes anything.

@guilhermepiccoli
Copy link

Sorry work has been busy so I haven't had time to come back to this until now.

a) Yes very reliable reproducer. My steamdesk would crash every time I connected my NES switch controller. After your patch it does not crash/reboot at all. I used the ko file. The reboot problem is gone for me after applying your ko file. It still works after rebooting the steamdeck.

Thanks a lot for you tests, no need for apologies =)

Can you please collect a dmesg for me, using my .ko module? One way is to just SSH into the deck and collect it by running the dmesg command. The other (if you don't have SSH access) is switching to desktop mode, using the terminal to save a dmesg same way as the SSH case, and share the file here.

Thanks!

@Mythris29
Copy link

@teaspoonie
Copy link

Same problem here, even up to latest update. New joycons, the first one always conects perfectly but upon the second connecting and triggering the pairing sequence the Deck crashes, presumably also kernel panic based on previous posts. It doesn’t matter which one I connect first, or whether I’m connecting them from a new or existing bluetooth connection.

Additionally, I’ve noticed the 2-3/10 times they connect without a crash (usually after 2-3 failed attempts) that when they DO connect they do this really odd thing where they don’t actually pair. They pair according to the system, but not in use. In the controllers menu they display as one paired (L&R) set of joycons, and one singular unpaired joycon, either (L) or (R) reflective of whichever was connected second, as one often ends up with the second player light turned in on the physical controller. This is easily fixed with a Steam restart, but i thought it was important to mention nonetheless.

@guilhermepiccoli
Copy link

[ 0.000000] Linux version 6.1.52.txt

Thank you! Before running my module did you manage to reproduce the issue with this same joycon attached? I'm asking because, from your logs, it seems the new code to prevent divide-by-zero wasn't executed...

@guilhermepiccoli
Copy link

Same problem here, even up to latest update. New joycons, the first one always conects perfectly but upon the second connecting and triggering the pairing sequence the Deck crashes, presumably also kernel panic based on previous posts. It doesn’t matter which one I connect first, or whether I’m connecting them from a new or existing bluetooth connection.

OK, thanks for the info. And did you manage to test with the debug/fix module I've attached here? It's not clear for me if you still crashes using that, or if the issue only happens in the stock kernel.

Cheers!

@teaspoonie
Copy link

OK, thanks for the info. And did you manage to test with the debug/fix module I've attached here? It's not clear for me if you still crashes using that, or if the issue only happens in the stock kernel.

Cheers!

Unfortunately it is without the fix module, as for some reason when I try applying it I get a permission denied error. I enabled read only, but it seems to still be unable to write to the appropriate folder.

“Cannot write to ‘hid-nintendo-ko-zst.txt’ (Permission Denied)”

I would have manually replaced the file using the file you attached, but I wasn’t sure if the command was necessary for it to trigger correctly.

@guilhermepiccoli
Copy link

guilhermepiccoli commented Dec 18, 2023

Replying to #1070 (comment)

I guess you need to disable the read-only, as per in steamos-readonly disable <- this will allow writes to rootfs.

If you could overwrite the original file with mine, just a matter of rebooting the Deck and the changes will be in place

srcres258 pushed a commit to srcres258/linux-doc that referenced this issue Dec 19, 2023
It was reported [0] that adding a generic joycon to the system caused
a kernel crash on Steam Deck, with the below panic spew:

divide error: 0000 [#1] PREEMPT SMP NOPTI
[...]
Hardware name: Valve Jupiter/Jupiter, BIOS F7A0119 10/24/2023
RIP: 0010:nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
[...]
Call Trace:
 [...]
 ? exc_divide_error+0x38/0x50
 ? nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
 ? asm_exc_divide_error+0x1a/0x20
 ? nintendo_hid_event+0x307/0xcc1 [hid_nintendo]
 hid_input_report+0x143/0x160
 hidp_session_run+0x1ce/0x700 [hidp]

Since it's a divide-by-0 error, by tracking the code for potential
denominator issues, we've spotted 2 places in which this could happen;
so let's guard against the possibility and log in the kernel if the
condition happens. This is specially useful since some data that
fills some denominators are read from the joycon HW in some cases,
increasing the potential for flaws.

[0] ValveSoftware/SteamOS#1070

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Tested-by: Sam Lantinga <slouken@libsdl.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
@RiggyRoly
Copy link

RiggyRoly commented Dec 20, 2023

Replying to #1070 (comment)

I have tried the module and it has stopped the crashes. I can’t use both joycons as one controller but they will both now connect as individual controllers (although i am not sure if they would have before the 3.5 update).

@guilhermepiccoli
Copy link

Replying to #1070 (comment)

I have tried the module and it has stopped the crashes. I can’t use both joycons as one controller but they will both now connect as individual controllers (although i am not sure if they would have before the 3.5 update).

Great, thanks for testing. Could you please collect a dmesg for me, while running the custom hid-nintendo module? I put some debug messages there, would be really useful to understand which ones are triggering...

@RiggyRoly
Copy link

RiggyRoly commented Dec 21, 2023

Replying to #1070 (comment)

I have tried the module and it has stopped the crashes. I can’t use both joycons as one controller but they will both now connect as individual controllers (although i am not sure if they would have before the 3.5 update).

Great, thanks for testing. Could you please collect a dmesg for me, while running the custom hid-nintendo module? I put some debug messages there, would be really useful to understand which ones are triggering...

The result is here

@guilhermepiccoli
Copy link

The result is here

Thanks a lot! Unfortunately seems this instance didn't trigger my debug messages...but I'm glad that the patch fixed that for everybody.

It is already merged on Deck's kernel and mainline.

Feel free to close this one @kisak-valve as resolved =)

@TrentDPT
Copy link

What is the process for a newb to run this process? Are they planning on doing an official patch to fix this? or is this the only way to actually resolve this issue?

@TrentDPT
Copy link

@guilhermepiccoli , where do the files have to exist when we run that command? Do i have to put the files you have attached into a particular place first?

@guilhermepiccoli
Copy link

Hi @TrentDPT , there is no need to worry about that anymore - the only thing required is to upgrade the Deck for latest 3.5.x images. I just updated mine to test, it's running now SteamOS version 3.5.12 (BUILD ID 20231226.1) and the kernel there contains the fix - its version is 6.1.52-valve12-1-neptune-61.

By checking the kernel tree, all kernels starting on 6.1.52-valve11 include the fix.

Lemme know if after the update the problem somehow persists for you. Cheers!

@TrentDPT
Copy link

@guilhermepiccoli , when you say contains the fix, you mean the controllers should work with it?

@guilhermepiccoli
Copy link

@guilhermepiccoli , when you say contains the fix, you mean the controllers should work with it?

I mean that the fix pointed in the comment #1070 (comment) is present, hence these steps aren't necessary and the kernel will not eventually crash anymore.

As per my understanding, some ppl seem to be facing a different issue, like connecting 2 controllers and they don't work (though kernel does not crash!) - this is not addressed in this github issue, I'd suggest opening a new one with more information, like a dmesg (preferably) and the model of the controllers you're trying to connect.

@sebastiansto
Copy link

I have the latest version (changelog is listing the fix), but I still get crashes as soon I reconnect the second controller of a pair.

@guilhermepiccoli
Copy link

I have the latest version (changelog is listing the fix), but I still get crashes as soon I reconnect the second controller of a pair.

OK, so could you please attach the kdumpst logs, as per comment #1070 (comment) ?

Basically after this crash, I assume the Deck reboots right? After this new reboot, idea is to collect the kdumpst zip blob mentioned in journalctl and attach it here.

Thanks in advance!

@sebastiansto
Copy link

sebastiansto commented Dec 28, 2023

Ok, I found the issue: when I checked the version again, the changelog entry with the latest fix was gone (I don't know why it was there in the first place, because I was on the stable channel). Now I changed to the preview channel and got the new version for good.

It works now for me too. Thanks!

@adubberly
Copy link

I have the latest version (changelog is listing the fix), but I still get crashes as soon I reconnect the second controller of a pair.

OK, so could you please attach the kdumpst logs, as per comment #1070 (comment) ?

Basically after this crash, I assume the Deck reboots right? After this new reboot, idea is to collect the kdumpst zip blob mentioned in journalctl and attach it here.

Thanks in advance!

So using the preview build, the crash no longer occurs. But the deck is not recognizing inputs from the NES Classic Joycons.

Even when I try to assign inputs, nothing comes of it.

@TrentDPT
Copy link

@guilhermepiccoli, So i've run the stable version of the software and the Preview version. Both have an issue with joycons. Anytime you get a 2nd joycon connected via bluetooth the whole thing resets.

Also, i just got a new TV, and the official Steamdeck dock now has an issue where i have to have it unplugged from the wall and HDMI and on prior to then hooking in the HDMI coord for the screen to work. This wasnt an issue before the new TV and the new Driver patch.

@kisak-valve
Copy link
Member

Hello @TrentDPT, please open a separate issue report so that your issue can be tracked properly.

@realchrisolin
Copy link

@guilhermepiccoli In addition to the issue @TrentDPT reported, I'm also seeing that the joycons will occasionally pair successfully but they will either not identify as a single controller or the joystick on one or both controllers is not calibrated (as seen in the test inputs screen).

I've noticed that if I turn them on issuing the recessed pairing button, the odds of them being recognized as a single controller increases, but I'll either run into the joystick calibration issue or one of the controllers will turn off or reboot in the middle in the game.

I tell you all this to get your advice on how you want that reported in separate report or reports? Or can I just pull the logs you need and put them in this ticket or Trent's?

@guilhermepiccoli
Copy link

Hi @realchrisolin / @TrentDPT , thanks for the reports. I think it could be a single new issue, in which all reports of connected-but-not-working joycons go.

@TrentDPT , as per my understanding, Anytime you get a 2nd joycon connected via bluetooth the whole thing resets doesn't mean the Deck crashes and reboots, correct? What do you mean by reset?

Also, the HDMI thing is completely unrelated to joycons, please open a different issue.

Cheers!

@realchrisolin
Copy link

Works for me. I'll reproduce my issue later today, pull the logs, and open a separate issue. Thanks.

johnny-mnemonic pushed a commit to linux-ia64/linux-stable-rc that referenced this issue Jan 17, 2024
[ Upstream commit 6eb04ca ]

It was reported [0] that adding a generic joycon to the system caused
a kernel crash on Steam Deck, with the below panic spew:

divide error: 0000 [#1] PREEMPT SMP NOPTI
[...]
Hardware name: Valve Jupiter/Jupiter, BIOS F7A0119 10/24/2023
RIP: 0010:nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
[...]
Call Trace:
 [...]
 ? exc_divide_error+0x38/0x50
 ? nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
 ? asm_exc_divide_error+0x1a/0x20
 ? nintendo_hid_event+0x307/0xcc1 [hid_nintendo]
 hid_input_report+0x143/0x160
 hidp_session_run+0x1ce/0x700 [hidp]

Since it's a divide-by-0 error, by tracking the code for potential
denominator issues, we've spotted 2 places in which this could happen;
so let's guard against the possibility and log in the kernel if the
condition happens. This is specially useful since some data that
fills some denominators are read from the joycon HW in some cases,
increasing the potential for flaws.

[0] ValveSoftware/SteamOS#1070

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Tested-by: Sam Lantinga <slouken@libsdl.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
johnny-mnemonic pushed a commit to linux-ia64/linux-stable-rc that referenced this issue Jan 17, 2024
[ Upstream commit 6eb04ca ]

It was reported [0] that adding a generic joycon to the system caused
a kernel crash on Steam Deck, with the below panic spew:

divide error: 0000 [#1] PREEMPT SMP NOPTI
[...]
Hardware name: Valve Jupiter/Jupiter, BIOS F7A0119 10/24/2023
RIP: 0010:nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
[...]
Call Trace:
 [...]
 ? exc_divide_error+0x38/0x50
 ? nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
 ? asm_exc_divide_error+0x1a/0x20
 ? nintendo_hid_event+0x307/0xcc1 [hid_nintendo]
 hid_input_report+0x143/0x160
 hidp_session_run+0x1ce/0x700 [hidp]

Since it's a divide-by-0 error, by tracking the code for potential
denominator issues, we've spotted 2 places in which this could happen;
so let's guard against the possibility and log in the kernel if the
condition happens. This is specially useful since some data that
fills some denominators are read from the joycon HW in some cases,
increasing the potential for flaws.

[0] ValveSoftware/SteamOS#1070

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Tested-by: Sam Lantinga <slouken@libsdl.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
johnny-mnemonic pushed a commit to linux-ia64/linux-stable-rc that referenced this issue Jan 18, 2024
[ Upstream commit 6eb04ca ]

It was reported [0] that adding a generic joycon to the system caused
a kernel crash on Steam Deck, with the below panic spew:

divide error: 0000 [#1] PREEMPT SMP NOPTI
[...]
Hardware name: Valve Jupiter/Jupiter, BIOS F7A0119 10/24/2023
RIP: 0010:nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
[...]
Call Trace:
 [...]
 ? exc_divide_error+0x38/0x50
 ? nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
 ? asm_exc_divide_error+0x1a/0x20
 ? nintendo_hid_event+0x307/0xcc1 [hid_nintendo]
 hid_input_report+0x143/0x160
 hidp_session_run+0x1ce/0x700 [hidp]

Since it's a divide-by-0 error, by tracking the code for potential
denominator issues, we've spotted 2 places in which this could happen;
so let's guard against the possibility and log in the kernel if the
condition happens. This is specially useful since some data that
fills some denominators are read from the joycon HW in some cases,
increasing the potential for flaws.

[0] ValveSoftware/SteamOS#1070

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Tested-by: Sam Lantinga <slouken@libsdl.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
johnny-mnemonic pushed a commit to linux-ia64/linux-stable-rc that referenced this issue Jan 18, 2024
[ Upstream commit 6eb04ca ]

It was reported [0] that adding a generic joycon to the system caused
a kernel crash on Steam Deck, with the below panic spew:

divide error: 0000 [#1] PREEMPT SMP NOPTI
[...]
Hardware name: Valve Jupiter/Jupiter, BIOS F7A0119 10/24/2023
RIP: 0010:nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
[...]
Call Trace:
 [...]
 ? exc_divide_error+0x38/0x50
 ? nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
 ? asm_exc_divide_error+0x1a/0x20
 ? nintendo_hid_event+0x307/0xcc1 [hid_nintendo]
 hid_input_report+0x143/0x160
 hidp_session_run+0x1ce/0x700 [hidp]

Since it's a divide-by-0 error, by tracking the code for potential
denominator issues, we've spotted 2 places in which this could happen;
so let's guard against the possibility and log in the kernel if the
condition happens. This is specially useful since some data that
fills some denominators are read from the joycon HW in some cases,
increasing the potential for flaws.

[0] ValveSoftware/SteamOS#1070

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Tested-by: Sam Lantinga <slouken@libsdl.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
johnny-mnemonic pushed a commit to linux-ia64/linux-stable-rc that referenced this issue Jan 18, 2024
[ Upstream commit 6eb04ca ]

It was reported [0] that adding a generic joycon to the system caused
a kernel crash on Steam Deck, with the below panic spew:

divide error: 0000 [#1] PREEMPT SMP NOPTI
[...]
Hardware name: Valve Jupiter/Jupiter, BIOS F7A0119 10/24/2023
RIP: 0010:nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
[...]
Call Trace:
 [...]
 ? exc_divide_error+0x38/0x50
 ? nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
 ? asm_exc_divide_error+0x1a/0x20
 ? nintendo_hid_event+0x307/0xcc1 [hid_nintendo]
 hid_input_report+0x143/0x160
 hidp_session_run+0x1ce/0x700 [hidp]

Since it's a divide-by-0 error, by tracking the code for potential
denominator issues, we've spotted 2 places in which this could happen;
so let's guard against the possibility and log in the kernel if the
condition happens. This is specially useful since some data that
fills some denominators are read from the joycon HW in some cases,
increasing the potential for flaws.

[0] ValveSoftware/SteamOS#1070

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Tested-by: Sam Lantinga <slouken@libsdl.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
johnny-mnemonic pushed a commit to linux-ia64/linux-stable-rc that referenced this issue Jan 18, 2024
[ Upstream commit 6eb04ca ]

It was reported [0] that adding a generic joycon to the system caused
a kernel crash on Steam Deck, with the below panic spew:

divide error: 0000 [#1] PREEMPT SMP NOPTI
[...]
Hardware name: Valve Jupiter/Jupiter, BIOS F7A0119 10/24/2023
RIP: 0010:nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
[...]
Call Trace:
 [...]
 ? exc_divide_error+0x38/0x50
 ? nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
 ? asm_exc_divide_error+0x1a/0x20
 ? nintendo_hid_event+0x307/0xcc1 [hid_nintendo]
 hid_input_report+0x143/0x160
 hidp_session_run+0x1ce/0x700 [hidp]

Since it's a divide-by-0 error, by tracking the code for potential
denominator issues, we've spotted 2 places in which this could happen;
so let's guard against the possibility and log in the kernel if the
condition happens. This is specially useful since some data that
fills some denominators are read from the joycon HW in some cases,
increasing the potential for flaws.

[0] ValveSoftware/SteamOS#1070

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Tested-by: Sam Lantinga <slouken@libsdl.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
mj22226 pushed a commit to mj22226/linux that referenced this issue Jan 18, 2024
[ Upstream commit 6eb04ca ]

It was reported [0] that adding a generic joycon to the system caused
a kernel crash on Steam Deck, with the below panic spew:

divide error: 0000 [#1] PREEMPT SMP NOPTI
[...]
Hardware name: Valve Jupiter/Jupiter, BIOS F7A0119 10/24/2023
RIP: 0010:nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
[...]
Call Trace:
 [...]
 ? exc_divide_error+0x38/0x50
 ? nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
 ? asm_exc_divide_error+0x1a/0x20
 ? nintendo_hid_event+0x307/0xcc1 [hid_nintendo]
 hid_input_report+0x143/0x160
 hidp_session_run+0x1ce/0x700 [hidp]

Since it's a divide-by-0 error, by tracking the code for potential
denominator issues, we've spotted 2 places in which this could happen;
so let's guard against the possibility and log in the kernel if the
condition happens. This is specially useful since some data that
fills some denominators are read from the joycon HW in some cases,
increasing the potential for flaws.

[0] ValveSoftware/SteamOS#1070

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Tested-by: Sam Lantinga <slouken@libsdl.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
johnny-mnemonic pushed a commit to linux-ia64/linux-stable-rc that referenced this issue Jan 19, 2024
[ Upstream commit 6eb04ca ]

It was reported [0] that adding a generic joycon to the system caused
a kernel crash on Steam Deck, with the below panic spew:

divide error: 0000 [#1] PREEMPT SMP NOPTI
[...]
Hardware name: Valve Jupiter/Jupiter, BIOS F7A0119 10/24/2023
RIP: 0010:nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
[...]
Call Trace:
 [...]
 ? exc_divide_error+0x38/0x50
 ? nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
 ? asm_exc_divide_error+0x1a/0x20
 ? nintendo_hid_event+0x307/0xcc1 [hid_nintendo]
 hid_input_report+0x143/0x160
 hidp_session_run+0x1ce/0x700 [hidp]

Since it's a divide-by-0 error, by tracking the code for potential
denominator issues, we've spotted 2 places in which this could happen;
so let's guard against the possibility and log in the kernel if the
condition happens. This is specially useful since some data that
fills some denominators are read from the joycon HW in some cases,
increasing the potential for flaws.

[0] ValveSoftware/SteamOS#1070

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Tested-by: Sam Lantinga <slouken@libsdl.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
johnny-mnemonic pushed a commit to linux-ia64/linux-stable-rc that referenced this issue Jan 19, 2024
[ Upstream commit 6eb04ca ]

It was reported [0] that adding a generic joycon to the system caused
a kernel crash on Steam Deck, with the below panic spew:

divide error: 0000 [#1] PREEMPT SMP NOPTI
[...]
Hardware name: Valve Jupiter/Jupiter, BIOS F7A0119 10/24/2023
RIP: 0010:nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
[...]
Call Trace:
 [...]
 ? exc_divide_error+0x38/0x50
 ? nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
 ? asm_exc_divide_error+0x1a/0x20
 ? nintendo_hid_event+0x307/0xcc1 [hid_nintendo]
 hid_input_report+0x143/0x160
 hidp_session_run+0x1ce/0x700 [hidp]

Since it's a divide-by-0 error, by tracking the code for potential
denominator issues, we've spotted 2 places in which this could happen;
so let's guard against the possibility and log in the kernel if the
condition happens. This is specially useful since some data that
fills some denominators are read from the joycon HW in some cases,
increasing the potential for flaws.

[0] ValveSoftware/SteamOS#1070

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Tested-by: Sam Lantinga <slouken@libsdl.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
johnny-mnemonic pushed a commit to linux-ia64/linux-stable-rc that referenced this issue Jan 19, 2024
[ Upstream commit 6eb04ca ]

It was reported [0] that adding a generic joycon to the system caused
a kernel crash on Steam Deck, with the below panic spew:

divide error: 0000 [#1] PREEMPT SMP NOPTI
[...]
Hardware name: Valve Jupiter/Jupiter, BIOS F7A0119 10/24/2023
RIP: 0010:nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
[...]
Call Trace:
 [...]
 ? exc_divide_error+0x38/0x50
 ? nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
 ? asm_exc_divide_error+0x1a/0x20
 ? nintendo_hid_event+0x307/0xcc1 [hid_nintendo]
 hid_input_report+0x143/0x160
 hidp_session_run+0x1ce/0x700 [hidp]

Since it's a divide-by-0 error, by tracking the code for potential
denominator issues, we've spotted 2 places in which this could happen;
so let's guard against the possibility and log in the kernel if the
condition happens. This is specially useful since some data that
fills some denominators are read from the joycon HW in some cases,
increasing the potential for flaws.

[0] ValveSoftware/SteamOS#1070

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Tested-by: Sam Lantinga <slouken@libsdl.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
gregkh pushed a commit to gregkh/linux that referenced this issue Jan 20, 2024
[ Upstream commit 6eb04ca ]

It was reported [0] that adding a generic joycon to the system caused
a kernel crash on Steam Deck, with the below panic spew:

divide error: 0000 [#1] PREEMPT SMP NOPTI
[...]
Hardware name: Valve Jupiter/Jupiter, BIOS F7A0119 10/24/2023
RIP: 0010:nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
[...]
Call Trace:
 [...]
 ? exc_divide_error+0x38/0x50
 ? nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
 ? asm_exc_divide_error+0x1a/0x20
 ? nintendo_hid_event+0x307/0xcc1 [hid_nintendo]
 hid_input_report+0x143/0x160
 hidp_session_run+0x1ce/0x700 [hidp]

Since it's a divide-by-0 error, by tracking the code for potential
denominator issues, we've spotted 2 places in which this could happen;
so let's guard against the possibility and log in the kernel if the
condition happens. This is specially useful since some data that
fills some denominators are read from the joycon HW in some cases,
increasing the potential for flaws.

[0] ValveSoftware/SteamOS#1070

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Tested-by: Sam Lantinga <slouken@libsdl.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
gregkh pushed a commit to gregkh/linux that referenced this issue Jan 20, 2024
[ Upstream commit 6eb04ca ]

It was reported [0] that adding a generic joycon to the system caused
a kernel crash on Steam Deck, with the below panic spew:

divide error: 0000 [#1] PREEMPT SMP NOPTI
[...]
Hardware name: Valve Jupiter/Jupiter, BIOS F7A0119 10/24/2023
RIP: 0010:nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
[...]
Call Trace:
 [...]
 ? exc_divide_error+0x38/0x50
 ? nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
 ? asm_exc_divide_error+0x1a/0x20
 ? nintendo_hid_event+0x307/0xcc1 [hid_nintendo]
 hid_input_report+0x143/0x160
 hidp_session_run+0x1ce/0x700 [hidp]

Since it's a divide-by-0 error, by tracking the code for potential
denominator issues, we've spotted 2 places in which this could happen;
so let's guard against the possibility and log in the kernel if the
condition happens. This is specially useful since some data that
fills some denominators are read from the joycon HW in some cases,
increasing the potential for flaws.

[0] ValveSoftware/SteamOS#1070

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Tested-by: Sam Lantinga <slouken@libsdl.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
K9100ii pushed a commit to K9100ii/android_kernel_samsung_universal7904 that referenced this issue Jan 29, 2024
It was reported [0] that adding a generic joycon to the system caused
a kernel crash on Steam Deck, with the below panic spew:

divide error: 0000 [SamarV-121#1] PREEMPT SMP NOPTI
[...]
Hardware name: Valve Jupiter/Jupiter, BIOS F7A0119 10/24/2023
RIP: 0010:nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
[...]
Call Trace:
 [...]
 ? exc_divide_error+0x38/0x50
 ? nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
 ? asm_exc_divide_error+0x1a/0x20
 ? nintendo_hid_event+0x307/0xcc1 [hid_nintendo]
 hid_input_report+0x143/0x160
 hidp_session_run+0x1ce/0x700 [hidp]

Since it's a divide-by-0 error, by tracking the code for potential
denominator issues, we've spotted 2 places in which this could happen;
so let's guard against the possibility and log in the kernel if the
condition happens. This is specially useful since some data that
fills some denominators are read from the joycon HW in some cases,
increasing the potential for flaws.

[0] ValveSoftware/SteamOS#1070

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Tested-by: Sam Lantinga <slouken@libsdl.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
K9100ii pushed a commit to K9100ii/android_kernel_samsung_universal7904 that referenced this issue Jan 30, 2024
It was reported [0] that adding a generic joycon to the system caused
a kernel crash on Steam Deck, with the below panic spew:

divide error: 0000 [SamarV-121#1] PREEMPT SMP NOPTI
[...]
Hardware name: Valve Jupiter/Jupiter, BIOS F7A0119 10/24/2023
RIP: 0010:nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
[...]
Call Trace:
 [...]
 ? exc_divide_error+0x38/0x50
 ? nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
 ? asm_exc_divide_error+0x1a/0x20
 ? nintendo_hid_event+0x307/0xcc1 [hid_nintendo]
 hid_input_report+0x143/0x160
 hidp_session_run+0x1ce/0x700 [hidp]

Since it's a divide-by-0 error, by tracking the code for potential
denominator issues, we've spotted 2 places in which this could happen;
so let's guard against the possibility and log in the kernel if the
condition happens. This is specially useful since some data that
fills some denominators are read from the joycon HW in some cases,
increasing the potential for flaws.

[0] ValveSoftware/SteamOS#1070

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Tested-by: Sam Lantinga <slouken@libsdl.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
rohanmclure pushed a commit to rohanmclure/linux-ci that referenced this issue Feb 5, 2024
It was reported [0] that adding a generic joycon to the system caused
a kernel crash on Steam Deck, with the below panic spew:

divide error: 0000 [linuxppc#1] PREEMPT SMP NOPTI
[...]
Hardware name: Valve Jupiter/Jupiter, BIOS F7A0119 10/24/2023
RIP: 0010:nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
[...]
Call Trace:
 [...]
 ? exc_divide_error+0x38/0x50
 ? nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
 ? asm_exc_divide_error+0x1a/0x20
 ? nintendo_hid_event+0x307/0xcc1 [hid_nintendo]
 hid_input_report+0x143/0x160
 hidp_session_run+0x1ce/0x700 [hidp]

Since it's a divide-by-0 error, by tracking the code for potential
denominator issues, we've spotted 2 places in which this could happen;
so let's guard against the possibility and log in the kernel if the
condition happens. This is specially useful since some data that
fills some denominators are read from the joycon HW in some cases,
increasing the potential for flaws.

[0] ValveSoftware/SteamOS#1070

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Tested-by: Sam Lantinga <slouken@libsdl.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
tuxedo-bot pushed a commit to tuxedocomputers/linux that referenced this issue Mar 22, 2024
BugLink: https://bugs.launchpad.net/bugs/2055199

[ Upstream commit 6eb04ca ]

It was reported [0] that adding a generic joycon to the system caused
a kernel crash on Steam Deck, with the below panic spew:

divide error: 0000 [#1] PREEMPT SMP NOPTI
[...]
Hardware name: Valve Jupiter/Jupiter, BIOS F7A0119 10/24/2023
RIP: 0010:nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
[...]
Call Trace:
 [...]
 ? exc_divide_error+0x38/0x50
 ? nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
 ? asm_exc_divide_error+0x1a/0x20
 ? nintendo_hid_event+0x307/0xcc1 [hid_nintendo]
 hid_input_report+0x143/0x160
 hidp_session_run+0x1ce/0x700 [hidp]

Since it's a divide-by-0 error, by tracking the code for potential
denominator issues, we've spotted 2 places in which this could happen;
so let's guard against the possibility and log in the kernel if the
condition happens. This is specially useful since some data that
fills some denominators are read from the joycon HW in some cases,
increasing the potential for flaws.

[0] ValveSoftware/SteamOS#1070

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Tested-by: Sam Lantinga <slouken@libsdl.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
paralin pushed a commit to skiffos/linux that referenced this issue Apr 14, 2024
It was reported [0] that adding a generic joycon to the system caused
a kernel crash on Steam Deck, with the below panic spew:

divide error: 0000 [#1] PREEMPT SMP NOPTI
[...]
Hardware name: Valve Jupiter/Jupiter, BIOS F7A0119 10/24/2023
RIP: 0010:nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
[...]
Call Trace:
 [...]
 ? exc_divide_error+0x38/0x50
 ? nintendo_hid_event+0x340/0xcc1 [hid_nintendo]
 ? asm_exc_divide_error+0x1a/0x20
 ? nintendo_hid_event+0x307/0xcc1 [hid_nintendo]
 hid_input_report+0x143/0x160
 hidp_session_run+0x1ce/0x700 [hidp]

Since it's a divide-by-0 error, by tracking the code for potential
denominator issues, we've spotted 2 places in which this could happen;
so let's guard against the possibility and log in the kernel if the
condition happens. This is specially useful since some data that
fills some denominators are read from the joycon HW in some cases,
increasing the potential for flaws.

[0] ValveSoftware/SteamOS#1070

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Tested-by: Sam Lantinga <slouken@libsdl.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
(cherry picked from commit 6eb04ca)
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