samsung-galaxybook-extras icon indicating copy to clipboard operation
samsung-galaxybook-extras copied to clipboard

Driver functionality fails after resuming from hibernate

Open bhargavg1 opened this issue 9 months ago • 1 comments

Hello,

My device is a galaxy book 2 360 running debian 12, and overall this driver has been working, but I noticed that it completely stops working after I resume from hibernation. None of the features work until i manually rmmod the module and modprobe it to reload it again, and then it starts working.

I thought this was strange and have been looking at the source code for a while and running a few tests (just throwing a bunch of println statements everywhere), I noticed that you had some TODO comments about reading the acpi function's return buffer after every call. I implemented this and found a few strange things.

  1. The return does match perfectly when the driver is working, but doesnt match when it stops working (i.e. when I resume from hibernation) -> The return buffer has 0x43, 0x58, 0x78, 0x00, 0xaa, 0xff, 0x00, etc etc. The 0xff there is weird, and also the 7th position is 0x00 when it should have brightness + 0x80. The long line of 0x00's at the end are all there as normal.
  2. The return buffer is actually 48 bytes for some reason, the first 24 bytes are mostly 0x00's though, but there are some changing numbers there that change without any noticable pattern (at least one I cant figure out). The second set of 24 bytes is where the expected reply from the TODO lives. Those first 24 bytes generally conform to 0x03, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, X1, X2, Y1, Y2, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, where X1 and X2 can change after every backlight change, and Y1 and Y2 only seem to change after a full system reboot and stay the same no matter how many times the module is reloaded.

In my experimenting with the driver code, I only fiddled with the keyboard backlight part, as I am not that experienced with C nor am I experienced with writing kernal modules. This whole problem could just also be a problem with my setup though. I have not entirely ruled out that I am just configuring something wrong. I guess I could just continue unloading and reloading the module everytime I turn on my computer after a hibernate if thats the case.

bhargavg1 avatar May 25 '24 04:05 bhargavg1