2022-08-19 14:29:31

by Mario Limonciello

[permalink] [raw]
Subject: [RFC 0/2] Stop the abuse of Linux-* _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.
There are 3 strings that were introduced:

Linux-Dell-Video
-> Intended for systems with NVIDIA cards that didn't support RTD3
Linux-Lenovo-NV-HDMI-Audio
-> Intended for powering on NVIDIA HDMI device
Linux-HPI-Hybrid-Graphics
-> Intended for changing dGPU output

AFAIK the first string is no longer relevant as nouveau now supports
RTD3. If that's wrong, this can be changed for the series.

The second two strings appear to be non-scalable workarounds. For
accomplishing these tasks, registers can be written from kernel drivers
or custom ASL can be put behind a _DSM. By forcing either of these two
solutions it will better let the Linux kernel control the behavior.

Based on the above this series drops the first string and marks the second
two strings to only apply to older systems.

Link: https://lore.kernel.org/all/[email protected]/T/

Mario Limonciello (2):
ACPI: OSI: Remove Linux-Dell-Video _OSI string
ACPI: OSI: Deprecate some abused _OSI strings

Documentation/firmware-guide/acpi/osi.rst | 24 ++++++++----------
drivers/acpi/osi.c | 31 ++++++++++++-----------
2 files changed, 26 insertions(+), 29 deletions(-)

--
2.34.1


2022-08-19 14:41:26

by Mario Limonciello

[permalink] [raw]
Subject: [RFC 1/2] ACPI: OSI: Remove Linux-Dell-Video _OSI string

This string was introduced because drivers for NVIDIA hardware
didn't support RTD3 in the past. This is no longer the case, and
so vendors shouldn't be using this string to modify ASL anymore.

Signed-off-by: Mario Limonciello <[email protected]>
---
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

2022-08-19 17:38:11

by Karol Herbst

[permalink] [raw]
Subject: Re: [RFC 0/2] Stop the abuse of Linux-* _OSI strings

On Fri, Aug 19, 2022 at 4:25 PM Mario Limonciello
<[email protected]> wrote:
>
> 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.
> There are 3 strings that were introduced:
>
> Linux-Dell-Video
> -> Intended for systems with NVIDIA cards that didn't support RTD3
> Linux-Lenovo-NV-HDMI-Audio
> -> Intended for powering on NVIDIA HDMI device
> Linux-HPI-Hybrid-Graphics
> -> Intended for changing dGPU output
>
> AFAIK the first string is no longer relevant as nouveau now supports
> RTD3. If that's wrong, this can be changed for the series.
>

Nouveau always supported RTD3, because that's mainly a kernel feature.
When those were introduced we simply had a bug only hit on a few
systems. And instead of helping us to debug this, this workaround was
added :( We were not even asked about this.

I am a bit curious about the other two though as I am not even sure
they are needed at all as we put other work arounds in place. @Lyude
Paul might know more about these.

2022-08-22 21:38:09

by Lyude Paul

[permalink] [raw]
Subject: Re: [RFC 0/2] Stop the abuse of Linux-* _OSI strings

On Fri, 2022-08-19 at 17:44 +0200, Karol Herbst wrote:
> On Fri, Aug 19, 2022 at 4:25 PM Mario Limonciello
> <[email protected]> wrote:
> >
> > 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.
> > There are 3 strings that were introduced:
> >
> > Linux-Dell-Video
> > -> Intended for systems with NVIDIA cards that didn't support RTD3
> > Linux-Lenovo-NV-HDMI-Audio
> > -> Intended for powering on NVIDIA HDMI device
> > Linux-HPI-Hybrid-Graphics
> > -> Intended for changing dGPU output
> >
> > AFAIK the first string is no longer relevant as nouveau now supports
> > RTD3. If that's wrong, this can be changed for the series.
> >
>
> Nouveau always supported RTD3, because that's mainly a kernel feature.
> When those were introduced we simply had a bug only hit on a few
> systems. And instead of helping us to debug this, this workaround was
> added :( We were not even asked about this.
>
> I am a bit curious about the other two though as I am not even sure
> they are needed at all as we put other work arounds in place. @Lyude
> Paul might know more about these.

Some of the _OSI strings are totally fine. From my recollection:

[ 0.242993] ACPI: Added _OSI(Linux-Lenovo-NV-HDMI-Audio)
^ this one is needed to do a couple of ACPI tricks at startup to get the PCIe
device for audio on nvidia's GPU to be detected properly

[ 0.242993] ACPI: Added _OSI(Linux-HPI-Hybrid-Graphics)

I don't actually know how necessary this is, but I'm hesistant to call this
one bad as it may be related to the funny mux configurations that I'm learning
may exist on HP machines.

>

--
Cheers,
Lyude Paul (she/her)
Software Engineer at Red Hat

2022-08-23 04:13:35

by Kai-Heng Feng

[permalink] [raw]
Subject: Re: [RFC 0/2] Stop the abuse of Linux-* _OSI strings

[+Cc Aaron]

On Tue, Aug 23, 2022 at 5:18 AM Lyude Paul <[email protected]> wrote:
>
> On Fri, 2022-08-19 at 17:44 +0200, Karol Herbst wrote:
> > On Fri, Aug 19, 2022 at 4:25 PM Mario Limonciello
> > <[email protected]> wrote:
> > >
> > > 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.
> > > There are 3 strings that were introduced:
> > >
> > > Linux-Dell-Video
> > > -> Intended for systems with NVIDIA cards that didn't support RTD3
> > > Linux-Lenovo-NV-HDMI-Audio
> > > -> Intended for powering on NVIDIA HDMI device
> > > Linux-HPI-Hybrid-Graphics
> > > -> Intended for changing dGPU output
> > >
> > > AFAIK the first string is no longer relevant as nouveau now supports
> > > RTD3. If that's wrong, this can be changed for the series.
> > >
> >
> > Nouveau always supported RTD3, because that's mainly a kernel feature.
> > When those were introduced we simply had a bug only hit on a few
> > systems. And instead of helping us to debug this, this workaround was
> > added :( We were not even asked about this.
> >
> > I am a bit curious about the other two though as I am not even sure
> > they are needed at all as we put other work arounds in place. @Lyude
> > Paul might know more about these.
>
> Some of the _OSI strings are totally fine. From my recollection:
>
> [ 0.242993] ACPI: Added _OSI(Linux-Lenovo-NV-HDMI-Audio)
> ^ this one is needed to do a couple of ACPI tricks at startup to get the PCIe
> device for audio on nvidia's GPU to be detected properly

This should be fixed by commit b516ea586d71 ("PCI: Enable NVIDIA HDA
controllers").
Aaron worked on more Lenovo systems than me, so he may be more sure of it.

>
> [ 0.242993] ACPI: Added _OSI(Linux-HPI-Hybrid-Graphics)
>
> I don't actually know how necessary this is, but I'm hesistant to call this
> one bad as it may be related to the funny mux configurations that I'm learning
> may exist on HP machines.

Should be fixed by commit 8e55f99c510f ("drm/i915: Invoke another _DSM
to enable MUX on HP Workstation laptops").

And for "Linux-Dell-Video", it should be fixed by 5775b843a619 ("PCI:
Restore config space on runtime resume despite being unbound").

So actually I am in favor of removing them all.

Kai-Heng

>
> >
>
> --
> Cheers,
> Lyude Paul (she/her)
> Software Engineer at Red Hat
>

2022-08-23 19:06:05

by Lyude Paul

[permalink] [raw]
Subject: Re: [RFC 0/2] Stop the abuse of Linux-* _OSI strings

On Tue, 2022-08-23 at 11:47 +0800, Kai-Heng Feng wrote:
> [+Cc Aaron]
>
> On Tue, Aug 23, 2022 at 5:18 AM Lyude Paul <[email protected]> wrote:
> >
> > On Fri, 2022-08-19 at 17:44 +0200, Karol Herbst wrote:
> > > On Fri, Aug 19, 2022 at 4:25 PM Mario Limonciello
> > > <[email protected]> wrote:
> > > >
> > > > 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.
> > > > There are 3 strings that were introduced:
> > > >
> > > > Linux-Dell-Video
> > > > -> Intended for systems with NVIDIA cards that didn't support RTD3
> > > > Linux-Lenovo-NV-HDMI-Audio
> > > > -> Intended for powering on NVIDIA HDMI device
> > > > Linux-HPI-Hybrid-Graphics
> > > > -> Intended for changing dGPU output
> > > >
> > > > AFAIK the first string is no longer relevant as nouveau now supports
> > > > RTD3. If that's wrong, this can be changed for the series.
> > > >
> > >
> > > Nouveau always supported RTD3, because that's mainly a kernel feature.
> > > When those were introduced we simply had a bug only hit on a few
> > > systems. And instead of helping us to debug this, this workaround was
> > > added :( We were not even asked about this.
> > >
> > > I am a bit curious about the other two though as I am not even sure
> > > they are needed at all as we put other work arounds in place. @Lyude
> > > Paul might know more about these.
> >
> > Some of the _OSI strings are totally fine. From my recollection:
> >
> > [ 0.242993] ACPI: Added _OSI(Linux-Lenovo-NV-HDMI-Audio)
> > ^ this one is needed to do a couple of ACPI tricks at startup to get the PCIe
> > device for audio on nvidia's GPU to be detected properly
>
> This should be fixed by commit b516ea586d71 ("PCI: Enable NVIDIA HDA
> controllers").
> Aaron worked on more Lenovo systems than me, so he may be more sure of it.
>
> >
> > [ 0.242993] ACPI: Added _OSI(Linux-HPI-Hybrid-Graphics)
> >
> > I don't actually know how necessary this is, but I'm hesistant to call this
> > one bad as it may be related to the funny mux configurations that I'm learning
> > may exist on HP machines.
>
> Should be fixed by commit 8e55f99c510f ("drm/i915: Invoke another _DSM
> to enable MUX on HP Workstation laptops").
>
> And for "Linux-Dell-Video", it should be fixed by 5775b843a619 ("PCI:
> Restore config space on runtime resume despite being unbound").
>
> So actually I am in favor of removing them all.

Woo! Thank you for the help with this :3. Since this all seems to be in order:

Reviewed-by: Lyude Paul <[email protected]>

>
> Kai-Heng
>
> >
> > >
> >
> > --
> > Cheers,
> > Lyude Paul (she/her)
> > Software Engineer at Red Hat
> >
>

--
Cheers,
Lyude Paul (she/her)
Software Engineer at Red Hat