Mario Limonciello
2022-Aug-23 18:51 UTC
[Nouveau] [PATCH 0/4] Remove Linux specific _OSI strings
3 _OSI strings were introduced in recent years that were intended to workaround very specific problems found on specific systems. The idea was supposed to be that these quirks were only used on those systems, but this proved to be a bad assumption. I've found at least one system in the wild where the vendor using the _OSI string doesn't match the _OSI string and the neither does the use. So this brings a good time to review keeping those strings in the kernel. In an RFC discussion of removing the strings it was clarified that all 3 uses in the kernel now have been fixed. As they're fixed, this series removes those strings and the documentation encouraging their future use. Link: https://lore.kernel.org/linux-acpi/54f3e05187c4e923b3a746beff3be4071ed0f2e1.camel at redhat.com/T/#m38f84a467f7f13302add169cbe0df8135ef15c62 Mario Limonciello (4): ACPI: OSI: Remove Linux-Dell-Video _OSI string ACPI: OSI: Remove Linux-Lenovo-NV-HDMI-Audio _OSI string ACPI: OSI: Remove Linux-HPI-Hybrid-Graphics _OSI string ACPI: OSI: Update Documentation on custom _OSI strings Documentation/firmware-guide/acpi/osi.rst | 25 ++++++++++------------- drivers/acpi/osi.c | 24 ---------------------- 2 files changed, 11 insertions(+), 38 deletions(-) -- 2.34.1
Mario Limonciello
2022-Aug-23 18:51 UTC
[Nouveau] [PATCH 1/4] ACPI: OSI: Remove Linux-Dell-Video _OSI string
This string was introduced because drivers for NVIDIA hardware had bugs supporting RTD3 in the past. Thoes bugs have been fixed by commit 5775b843a619 ("PCI: Restore config space on runtime resume despite being unbound"). so vendors shouldn't be using this string to modify ASL anymore. Reviewed-by: Lyude Paul <lyude at redhat.com> Signed-off-by: Mario Limonciello <mario.limonciello at amd.com> --- drivers/acpi/osi.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/acpi/osi.c b/drivers/acpi/osi.c index 9f6853809138..c2f6b2f553d9 100644 --- a/drivers/acpi/osi.c +++ b/drivers/acpi/osi.c @@ -44,15 +44,6 @@ osi_setup_entries[OSI_STRING_ENTRIES_MAX] __initdata = { {"Processor Device", true}, {"3.0 _SCP Extensions", true}, {"Processor Aggregator Device", true}, - /* - * Linux-Dell-Video is used by BIOS to disable RTD3 for NVidia graphics - * cards as RTD3 is not supported by drivers now. Systems with NVidia - * cards will hang without RTD3 disabled. - * - * Once NVidia drivers officially support RTD3, this _OSI strings can - * be removed if both new and old graphics cards are supported. - */ - {"Linux-Dell-Video", true}, /* * Linux-Lenovo-NV-HDMI-Audio is used by BIOS to power on NVidia's HDMI * audio device which is turned off for power-saving in Windows OS. -- 2.34.1
Mario Limonciello
2022-Aug-23 18:51 UTC
[Nouveau] [PATCH 2/4] ACPI: OSI: Remove Linux-Lenovo-NV-HDMI-Audio _OSI string
This string was introduced because drivers for NVIDIA hardware didn't handle HDMI properly. This was fixed by commit b516ea586d71 ("PCI: Enable NVIDIA HDA controllers"). So vendors shouldn't be using this string to modify ASL anymore. Suggested-by: Kai-Heng Feng <kai.heng.feng at canonical.com> Reviewed-by: Lyude Paul <lyude at redhat.com> Signed-off-by: Mario Limonciello <mario.limonciello at amd.com> --- drivers/acpi/osi.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/acpi/osi.c b/drivers/acpi/osi.c index c2f6b2f553d9..0d635eec87c4 100644 --- a/drivers/acpi/osi.c +++ b/drivers/acpi/osi.c @@ -44,14 +44,6 @@ osi_setup_entries[OSI_STRING_ENTRIES_MAX] __initdata = { {"Processor Device", true}, {"3.0 _SCP Extensions", true}, {"Processor Aggregator Device", true}, - /* - * Linux-Lenovo-NV-HDMI-Audio is used by BIOS to power on NVidia's HDMI - * audio device which is turned off for power-saving in Windows OS. - * This power management feature observed on some Lenovo Thinkpad - * systems which will not be able to output audio via HDMI without - * a BIOS workaround. - */ - {"Linux-Lenovo-NV-HDMI-Audio", true}, /* * Linux-HPI-Hybrid-Graphics is used by BIOS to enable dGPU to * output video directly to external monitors on HP Inc. mobile -- 2.34.1
Mario Limonciello
2022-Aug-23 18:51 UTC
[Nouveau] [PATCH 3/4] ACPI: OSI: Remove Linux-HPI-Hybrid-Graphics _OSI string
This string was introduced because drivers for NVIDIA hardware didn't handle mux control properly. This was fixed by commit 8e55f99c510f ("drm/i915: Invoke another _DSM to enable MUX on HP Workstation laptops"). So vendors shouldn't be using this string to modify ASL anymore. Suggested-by: Kai-Heng Feng <kai.heng.feng at canonical.com> Reviewed-by: Lyude Paul <lyude at redhat.com> Signed-off-by: Mario Limonciello <mario.limonciello at amd.com> --- drivers/acpi/osi.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/acpi/osi.c b/drivers/acpi/osi.c index 0d635eec87c4..d4405e1ca9b9 100644 --- a/drivers/acpi/osi.c +++ b/drivers/acpi/osi.c @@ -44,13 +44,6 @@ osi_setup_entries[OSI_STRING_ENTRIES_MAX] __initdata = { {"Processor Device", true}, {"3.0 _SCP Extensions", true}, {"Processor Aggregator Device", true}, - /* - * Linux-HPI-Hybrid-Graphics is used by BIOS to enable dGPU to - * output video directly to external monitors on HP Inc. mobile - * workstations as Nvidia and AMD VGA drivers provide limited - * hybrid graphics supports. - */ - {"Linux-HPI-Hybrid-Graphics", true}, }; static u32 acpi_osi_handler(acpi_string interface, u32 supported) -- 2.34.1
Mario Limonciello
2022-Aug-23 18:51 UTC
[Nouveau] [PATCH 4/4] ACPI: OSI: Update Documentation on custom _OSI strings
Originally when there was some custom ASL needed for Linux the guidance for Linux friendly OEMs was to introduced a new string in APCI tables and discuss it on the kernel mailing lists. This lead to 3 strings being introduced. Those strings now have the original problems fixed in the kernel and have since been removed. The kernel no longer advertises any custom Linux-* _OSI strings for OEM use. It was discovered that these removed strings were actually being abused to detect Linux for unrelated reasons. So drop the encouragement for new ones to be added. Signed-off-by: Mario Limonciello <mario.limonciello at amd.com> --- Documentation/firmware-guide/acpi/osi.rst | 25 ++++++++++------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/Documentation/firmware-guide/acpi/osi.rst b/Documentation/firmware-guide/acpi/osi.rst index 05869c0045d7..c9d508ba2ec7 100644 --- a/Documentation/firmware-guide/acpi/osi.rst +++ b/Documentation/firmware-guide/acpi/osi.rst @@ -41,26 +41,23 @@ But it is likely that they will all eventually be added. What should an OEM do if they want to support Linux and Windows using the same BIOS image? Often they need to do something different for Linux to deal with how Linux is different from Windows. -Here the BIOS should ask exactly what it wants to know: +In this case, the OEM should create custom ASL to be executed by the +Linux kernel and changes to Linux kernel drivers to execute this custom +ASL. The easiest way to accomplish this is to introduce a device specific +method (_DSM) that is called from the Linux kernel. + +In the past the kernel used to support something like: _OSI("Linux-OEM-my_interface_name") where 'OEM' is needed if this is an OEM-specific hook, and 'my_interface_name' describes the hook, which could be a quirk, a bug, or a bug-fix. -In addition, the OEM should send a patch to upstream Linux -via the linux-acpi at vger.kernel.org mailing list. When that patch -is checked into Linux, the OS will answer "YES" when the BIOS -on the OEM's system uses _OSI to ask if the interface is supported -by the OS. Linux distributors can back-port that patch for Linux -pre-installs, and it will be included by all distributions that -re-base to upstream. If the distribution can not update the kernel binary, -they can also add an acpi_osi=Linux-OEM-my_interface_name -cmdline parameter to the boot loader, as needed. - -If the string refers to a feature where the upstream kernel -eventually grows support, a patch should be sent to remove -the string when that support is added to the kernel. +However this was discovered to be abused by other BIOS vendors to change +completely unrelated code on completely unrelated systems. This prompted +an evaluation of all of it's uses. This uncovered that they aren't needed +for any of the original reasons. As such, the kernel will not respond to +any custom Linux-* strings by default. That was easy. Read on, to find out how to do it wrong. -- 2.34.1