-
Notifications
You must be signed in to change notification settings - Fork 34
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
Scrolling non-functional after suspend/resume on a USB keyboard #28
Comments
That seems plausible, I don't think this is something I've tested. The Bluetooth keyboard reconnects completely afresh after suspend/resume, and this is what I use ~99% of the time. What sort of suspend is this? To-RAM or Hibernate? Does running the following fix things up:
|
That did not resolve the problem. Also, to find the device I did have to change the HID_NAME to: |
@rcj4747 sorry, that was stupid of me. The USB keyboard needs the commands sent via. an ioctl, so that bash script can't do it. I do have a hacked-up C utility I don't think I've shared yet, will commit that this evening which should hopefully make life more bearable. Does |
Yes, the fn_lock file is there in both cases (prior to suspend with scroll working and after suspend/resume with scroll non-functional). |
Try https://github.com/lentinj/tp-compact-keyboard/tree/master/tp-compact-usb-keyboard --- it should help you work around this for now. But the kernel patch to fix this properly should be easy, would you be willing to test patches? |
I ran against the correct device but scrolling did not work.
|
Also, I can test kernel patches, I'm happy to compile a test kernel when we get to that point. |
Okay, can you try Regardless, I'm willing to bet that the following patch will fix things for you: I'm not going to get around to testing this for the next few days, but if you can try yourself and report back that'd be really useful. |
I tried suspend/resume fix with tp-compact-keyboard @ 0358baf and that worked. I'll test the kernel patch and leave a comment when I have that tested. Thank you. |
@lentinj I tried the kernel patch on a 4.3 mainline kernel and with the keyboard plugged in during resume the system hangs hard; I don't even get to video. I'm not versed in pm debugging but if there's something you'd like me to do to debug I certainly can do it; I've done a fair bit of kernel development. |
Hrm, PM debugging seems to be quite a tricky business. hid-rmi.c does pretty much the same to handle resume, so seems unlikely that the USB device isn't ready for the commands to be sent at this point (although there's no guarantees that this driver is bug-free). Just to be sure, suspend/resume works okay with the patch applied but the keyboard disconnected? Clutching at straws now, but you could remove |
Removing lenovo_resume didn't alleviate the hang. I tried keeping lenovo_resume and removing lenovo_reset_resume and that eliminates the hang (yea!) but we're back to a trackpoint without scroll after resume. |
Have a look at rcj4747/linux@f89eb059, this commit will eliminate the hang on resume and restore middle mouse scrolling. Stylistically I'm not sure it's 100%. |
Interesting! Problem is it won't restore fn-lock / sensitivity status, which could be just as annoying to some. Do the sensitivity / fn_lock /sys nodes still work after a resume? I'm going to try and get suspend/resume working in QEMU so this is slightly easier to debug. |
I have the same problem. Usb keyboard, middle mousebutton is gone after suspend. If I understand correctly it has been fixed in rcj4747/linux@f89eb05, or has this been integrated anywhere by now? I guess the only way for me to test this is to pull the sources, patch them, and compile that module. Is that correct? |
@arnuschky Review the comment from @lentinj on 4 Nov, 2015 which outlines what won't work with the patch of mine. With the code in the kernel today it would work to detach and re-attach the keyboard after resume. I found that to be an acceptable inconvenience as the keyboard has a very accessible mini-USB connection. Separately, and completely unrelated, I bought a new keyboard to improve ergonomics and I don't know what the state of support is today. |
Thanks for your reply. Yes, the detach-reattach workaround is what I am doing as well. :) I'll have a look at your patch; maybe I can fix the issues raised by @lentinj |
I never managed to reproduce this meself, neither in a VM or on my laptop (which presumably keeps USB devices powered over suspend). Probably worth taking the conversation to |
I can confirm, that this issue exists. I have a USB Keboard and it is connected to the USB Port of the Dockingstation.
But the occurrence of the phenomenon is not reliably happening every time.
Sometimes I undock the laptop, so I can't say if it only happens after suspend, undock and redock or if it also happens on suspend and resume, while the laptop is docked.
Am 29. November 2016 10:13:04 MEZ, schrieb Jamie Lentin <[email protected]>:
…I never managed to reproduce this meself, neither in a VM or on my
laptop (which presumably keeps USB devices powered over suspend).
Probably worth taking the conversation to
***@***.***`` to see if anything is suggested (please
CC me if you do, I don't subscribe).
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#28 (comment)
--
Diese Nachricht wurde von meinem Mobiltelefon mit Linux Kernel und JVM Userland von K-9 Mail gesendet.
|
Hrm, I didn't think of the dock. The dock for my X230 definitely keeps the USB ports powered whilst the laptop is suspended, then powers off on undock. I would have tried the keyboard on my X201s, but I imagine it's the same. |
I think it shouldn't depend on, which laptop you are using, since it is the driver for the Thinkpad-USB-Keyboards. |
I am seeing this also with the dock. Keyboard connected to Mini Dock 3, with a x230 as well. I think I can reproduce it every time I suspend while in the dock. |
I can still reproduce this on Ubuntu 17.04. / Kernel 4.10., any solution here? |
A software solution I've found is to reload the module sudo rmmod --force usbhid ; sleep 1; sudo modprobe usbhid Maybe putting this in a udev rule linked to the resume could fix it (I know I did something similar for a sound problem (reloading kernel module on resume) on an Asus laptop). Any of you guys have some more insight since? |
@saveman71: Thanks, this seems to work on Ubuntu 18.10..
|
Just be aware that this will "break" your keyboard after a kernel update, since it'll fail reloading the module :/ Maybe there is a way to "simulate" the unplugging/plugging of the kb? |
To anyone reading this, i found a way to softreset the usb port of the keyboard. https://askubuntu.com/a/61165/275102 The first answer, with the C program (USBDEVFS_RESET ioctl method) didn't seem to work. However, the second answer (linked above) with the "authorized" method did work for me. I'm no expert so I didn't look up exactly the meaning, but it works.
Quoting the instructions to find you device path:
|
I just had the issue again. And tried your trick. With the loop I found the device, I also added
However, I had:
and first did:
which made the keyboard not working anymore, so I had to proceed with the laptop keyboard. The I did:
which made the trackpoint completely stop working. Finally:
broad everything back to live and even scrolling works now. |
I finally got around to finding hardware that reproduces this. There is a patch for the kernel to sort this out here if anyone wants to try: However, I'm experiencing occasional timeouts when any property is set (e.g. turning on/off fn_lock). It's unrelated to the above, and could just be my ropey USB keyboard and/or cable. However, the above turns it from a benign problem to something that causes resume delays / failures. If others are suffering from similar (setting |
@rcj4747 says: I had problems with you kernel patch. After a suspend/resume cycle the scrolling did not work until I disconnected and re-connected the USB keyboard. Have you seen/heard of this happening with the patches?
The text was updated successfully, but these errors were encountered: