Date: Wed, 20 May 2026 00:44:52 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 295251] Power button does not work on HP Laptop 15s (new module to poll GPIO and raise ACPI event) Message-ID: <bug-295251-227-oBgvHNbB7r@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-295251-227@https.bugs.freebsd.org/bugzilla/>
index | next in thread | previous in thread | raw e-mail
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295251 --- Comment #2 from Ruslan Zalata <rz@fabmicro.ru> --- Hello Ahmad and thank you for your review. Well, yes, a libgpio daemon (or even a shell script calling gpioctl/acpiconf periodically) can be used to quick-solve this problem, but let me explain why a user-space process does not look like a good solution: 1. System may be booted in modes without daemons running (Single User mode) which breaks the button. A module can be made to load earlier from bootloader making the button work. 2. Currently there's no way of sending arbitrary ACPI event (to call named method) from user-space unless a third-party module like "acpi_call" is loaded. So, daemon is limited in sending a fixed number of Sx states, which is not what expected from Power Button state change. Some GUI software may want to catch button press events (through devd or evdev) and use it to show a menu instead of immediate poweroff/suspend/reboot, such software will not work in case of daemon. 3. There are cases where kernel may start killing user-space processes intentionally (i.e. lack of RAM), which can break Power Button functionality if daemon is killed. 4. User-space process has a way bigger memory footprint, it does innumerous switching between user and kernel while polling GPIO, i.e. overhead it produces is much bigger than of a tiny kthread in module that just sleeps. :-) 5. Proposed module can be easily extended for polling more GPIOs for other features that may appear on Hardware-Reduced ACPI machines. There are laptops with Sleep Button as well. Anyways, I made this module stand-alone and published on Github, anyone in need can just "git clone && make && sudo make install" it. Thanks. Regards, Ruslan. -- You are receiving this mail because: You are the assignee for the bug.home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-295251-227-oBgvHNbB7r>
