Bug 1212469

Summary: keyboard gets disconnmected in suspend
Product: [openSUSE] openSUSE Tumbleweed Reporter: Michal Suchanek <msuchanek>
Component: KernelAssignee: Oliver Neukum <oneukum>
Status: RESOLVED WONTFIX QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: msuchanek, oneukum, tiwai
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: kernel messages
lshw
X log
set quirk HIS_ALWAYS_POLL for device

Description Michal Suchanek 2023-06-17 08:14:46 UTC
Created attachment 867641 [details]
kernel messages

In suspend to RAM keyboard gets disconnected, and as a result the keyboard layout gets lost
Comment 1 Michal Suchanek 2023-06-17 08:15:13 UTC
Created attachment 867642 [details]
lshw
Comment 2 Michal Suchanek 2023-06-17 08:15:55 UTC
Created attachment 867643 [details]
X log
Comment 3 Michal Suchanek 2023-06-17 08:16:22 UTC
Linux localhost.localdomain 6.3.8-lp154.2.g627a49e-default #1 SMP PREEMPT_DYNAMIC Wed Jun 14 10:30:38 UTC 2023 (627a49e) x86_64 x86_64 x86_64 GNU/Linux
Comment 4 Michal Suchanek 2023-06-17 08:28:05 UTC
Also on 5.14.21-150500.53-default
Comment 5 Takashi Iwai 2023-06-17 10:30:41 UTC
Smells like a usual autosuspend issue.  Adding Oliver to Cc.
Comment 6 Oliver Neukum 2023-06-19 13:32:50 UTC
No,

this is unlikely to be autosuspend, as then we have absolutely no explanation why it fails only wen the system suspends. This looks like the keyboard is sharing a firmware bug where it cannot operate without enabling remote wakeup. Patch coming up.
Comment 7 Michal Suchanek 2023-06-19 18:25:28 UTC
Indeed, this works with another keyboard.

I will try to look for an updated firmware.
Comment 8 Oliver Neukum 2023-06-20 13:34:51 UTC
Created attachment 867691 [details]
set quirk HIS_ALWAYS_POLL for device

Please test this patch
Comment 9 Michal Suchanek 2023-06-21 07:23:17 UTC
Does the hardware ID really correspond to an Apple product?

I am pretty sure this is not an Apple keyboard.

While lsusb shows 

Bus 003 Device 032: ID 05ac:024f Apple, Inc. Aluminium Keyboard (ANSI)

lshw shows

                  input72       input          SONiX USB DEVICE
                  input73       input          SONiX USB DEVICE

                 *-usb:0
                      description: Keyboard
                      product: SONiX USB DEVICE
                      vendor: SONiX
                      physical id: 1
                      bus info: usb@3:3.1
                      logical name: input33
                      logical name: /dev/input/event9
                      logical name: input33::capslock
                      logical name: input33::compose
                      logical name: input33::kana
                      logical name: input33::numlock
                      logical name: input33::scrolllock
                      logical name: input34
                      logical name: /dev/input/event10
                      logical name: /dev/input/mouse3
                      version: 1.21
                      capabilities: usb-2.00 usb
                      configuration: driver=usbhid maxpower=100mA speed=12Mbit/s

The software for changing settings on Royal Kludge keyboards identifies it as RK-G68 

With this brand name I suppose it's unreasonable to expect smooth operation.
Comment 10 Oliver Neukum 2023-06-21 10:52:21 UTC
(In reply to Michal Suchanek from comment #9)

> With this brand name I suppose it's unreasonable to expect smooth operation.

The ID says Apple. Now you have a point in saying that they are highjacking an ID and we should not penalize true Apple products. However, unless the quirk works, the point is moot.
Comment 11 Michal Suchanek 2023-06-24 09:41:55 UTC
No change with the patch applied.

With two keyboards connected in suspend

- broken keyboard flashes backlight every 10s or so, working is dark
- pressing key on broken keyboard does nothing, working keyboard wakes system
- after resume working keyboard has correct keymap, broken keyboard has default keymap (there is no way to permanently set keymap in openSUSE I am aware of)
Comment 12 Michal Suchanek 2023-11-27 18:44:14 UTC
No fix has been found.

Clearly this is a problem with specific piece of hardware, let it RIP.