7 ms·
We see that kind of issue frequently and in the majority of cases it is not a Linux fault, but manufacturer firmware. It is such a frequent issue I wrote an ar
by iam-TJ 6y ago
We see that kind of issue frequently and in the majority of cases it is not a Linux fault, but manufacturer firmware.
It is such a frequent issue I wrote an article 10 years ago that is still extremely relevant with simple instructions to enable a kernel work-around [0].
Specifically the problem is the ACPI DSDT (Differentiated System Description Table) - which is actually byte-code installed by the device manufacturer (but executed by the host OS) that handles device power states and enablement.
The problem is almost always DSDT methods are written to conditionally configure system hardware optimally ONLY when the host OS is a version of Windows as declared by the host OS's ACPI OSI (Operating System Identification).
When Linux boots only a minimal configuration is applied which very often has never been tested and thus devices fail to work reliably, especially for suspend/resume, in interesting ways.
Fortunately, Linux has a WORKAROUND that allows passing a 'fake' OSI on the kernel command-line in the form:
acpi_osi=! "acpi_osi=Windows XXXX"
The first instance (=!) clears all built-in kernel OSIs to avoid confusion. The second string sets the 'best' and only OSI value which has been found in the DSDT of that PC.
That can be discovered from a Linux boot using:
sudo strings /sys/firmware/acpi/tables/DSDT | grep -i 'windows ' | sort
E.g: on my Lenovo E495 (AMD Ryzen 7 3700U) I have:
Microsoft Windows NT
Windows 2001
Windows 2001.1
Windows 2001 SP1
Windows 2001 SP2
Windows 2001 SP3
Windows 2006
Windows 2006 SP1
Windows 2009
Windows 2009
Windows 2012
Windows 2013
Windows 2015
Windows 2015
Windows 2016
So, on the basis that "Windows 2016" is the 'latest' and likely the OSI expected to enable all features optimally I use that. On Debian/Ubuntu I therefore have:
/etc/default/grub.d/local.cfg
GRUB_CMDLINE_LINUX="acpi_osi=! \"acpi_osi=Windows 2016\" "
Notice the escaped quote-marks inside the shell string since the argument contains a space.
(some folks might prefer to edit the package-shipped /etc/default/grub but I prefer to leave that virgin to avoid package-upgrade prompts when that file is replaced.)
After:
sudo update-grub
/boot/grub/grub.cfg
will have the acpi_osi= entries added to all the "linux ..." command lines
E.g:
$ grep acpi_osi= /boot/grub/grub.cfg
linux /vmlinuz-5.12.0-rc5+ root=/dev/mapper/ELLOE000-rootfs ro acpi_osi=! "acpi_osi=Windows 2016" systemd.unified_cgroup_hierarchy=1 nosplash
[0] https://iam.tj/prototype/enhancements/Windows-acpi_osi.html https://iam.tj/prototype/enhancements/Windows-acpi_osi.html
- 2muchcoffeeman 6y agoPop OS doesn’t use grub :(
- ylyn 6y agoThis is a kernel parameter, so just set it in whatever bootloader Pop OS uses..
- 2muchcoffeeman 6y agoOk. Linux 5.10 actually seemed to improve the power issue but my sound and mic breaks which I need for meetings.
- AnssiH 6y agoThat sounds out of date. Linux has reported itself as Windows via ACPI OSI and actually reports FALSE for "Linux" OSI query for well over a decade now. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/acpi/acpica/utosi.c#n41 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin... https://www.kernel.org/doc/Documentation/firmware-guide/acpi/osi.rst https://www.kernel.org/doc/Documentation/firmware-guide/acpi...
- jcelerier 6y agomost features of my laptop don't work reliably (MSI GS65) if I don't use the acpi_osi line, why would that be in that case ? I'm on archlinux with pretty much always the latest kernel
- deleted 6y ago[deleted]
- mjg59 6y agoAs mentioned by AnssiH, this hasn't been true for a long time - https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f507654d450d329c81a70eec0096d5dfe67802ec https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin... was merged in 2007. I wrote up the reasoning back in 2008 at https://mjg59.livejournal.com/85923.html https://mjg59.livejournal.com/85923.html, but since then Linux should always have been behaving identically to the most recent version of Windows as far as OSI responses go.