Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenCore DeviceProperties is unable to overwrite properties for unnamed devices #2211

Closed
TonyC5 opened this issue Feb 4, 2023 · 3 comments
Closed
Labels
invalid This doesn't seem right project:oc

Comments

@TonyC5
Copy link

TonyC5 commented Feb 4, 2023

"DeviceProperties > Add" in the OpenCore config.plist can be used to define new properties for devices, regardless of whether the devices have an ACPI name. However, if a "DeviceProperties > Add" entry is defined for a device that does not have an ACPI name and that property already exists, OpenCore will not overwrite the existing property. Shouldn't OpenCore be able to create new properties AND overwrite existing properties via DeviceProperties in the config.plist? According to Vit9696 here, OC cannot inject device properties for a device without a name; however, this isn't entirely accurate: OC can inject new device properties but it cannot overwrite existing device properties for a device without a name.

Example
I needed to overwrite the class-code property for my dGPU audio device at pci10de,be3 (Device Path PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x1) ). This device is not named in the original, unpatched ACPI. I first attempted to overwrite the class-code property with an entry in "DeviceProperties > Add" (OC config.plist). When that didn't work, I entered a "DeviceProperties > Delete" rule for the class-code property I wanted to overwrite, but OC still refused to overwrite the existing class-code property. I created an SSDT with the updated class-code and injected the SSDT via "ACPI > Add" in my OC config.plist. The SSDT overwrites the existing class-code without any problems. Further, I confirmed that I can create new properties for the unnamed device at pci10de,be3 by creating "DeviceProperties > Add" entries with Device Path PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x1) (e.g., I can create a new property "test" for the unnamed device and I confirm that my new property "test" appears in IORegistry for device pci10de,be3). The fact that the device is unnamed does not preclude definition of new properties that are not already defined.

If I can overwrite the existing class-code property with an SSDT and I can define new properties via DeviceProperties in config.plist, shouldn't I be able to overwrite the existing class-code property with an entry in DeviceProperties?

I am using OpenCore 0.8.8 and have observed this OC DeviceProperties limitation in Big Sur, Monterey and Ventura.

@Andrey1970AppleLife
Copy link
Contributor

For change of DeviceProperties - the Device shall be in ACPI.
For an example: https://github.com/acidanthera/OpenCorePkg/blob/master/Docs/AcpiSamples/Source/SSDT-IMEI.dsl

@TonyC5
Copy link
Author

TonyC5 commented Feb 4, 2023

@Andrey1970AppleLife Thank you for the quick reply and for identifying the inconsistency in OpenCore's DeviceProperties implementation. If indeed OC only supports the addition of DeviceProperties for ACPI-named devices, then why doesn't OC permit identification of the DeviceProperties by their ACPI device name? For example, if I want to define a "DeviceProperties > Add" rule for ACPI Device HDAU, I have to reference the device by its device path PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x1). I can't reference the device by its ACPI name in DeviceProperties.

Either OC can only define DeviceProperties for devices by their Device Path (which does not require an ACPI name) or OC can define device properties for devices by their ACPI name (which does not require the device path).

If OC is truly limited to defining device properties for ACPI-named devices, then OC's DeviceProperties should recognize the device's ACPI name without requiring the device path for identification.

OC's "Device Properties > Add" has no problem defining new properties for unnamed devices, because the device in DeviceProperties is referenced by its device path and not by its ACPI name.

Thanks for listening.

@Andrey1970AppleLife
Copy link
Contributor

#2212 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right project:oc
Development

No branches or pull requests

2 participants