drm/i915: opregion: set opregion chpd value to indicate the driver handles hotplug
Subsystems (3)
PATCH 1/1 drm/i915: opregion: set opregion chpd value to indicate the driver handles hotplug
According to both the old acpi_igd_opregion_spec_0.pdf and the newer skl_opregion_rev0p5.pdf opregion specification documents, if a driver handles hotplug events itself, it should set the opregion CHPD field to 1 to indicate this and the firmware should respond to this by no longer sending ACPI 0x00 notification events on e.g. lid-state changes.
Specifically skl_opregion_rev0p5.pdf states thid in the documentation of the CHPD word: "Re-enumeration trigger logic in System BIOS MUST be disabled for all the Operating Systems supporting Hot-Plug (e.g., Windows* Longhorn and above)." Note the MUST in there.
We ignore these notifications, so this should not be a problem but many recent DSTDs seem to all have the same copy-pasted bug in the GNOT() AML function which is used to send these notifications. Windows likely does not hit this bug as it presumably correcty sets CHPD to 1.
Here is an example of the broken GNOT() method:
Method (GNOT, 2, NotSerialized)
{
...
CEVT = Arg0
CSTS = 0x03
If (((CHPD == Zero) && (Arg1 == Zero)))
{
If (((OSYS > 0x07D0) || (OSYS < 0x07D6)))
{
Notify (PCI0, Arg1)
}
Else
{
Notify (GFX0, Arg1)
}
}
...Notice that the condition for the If is always true I believe that the || like needs to be an &&, but there is nothing we can do about this and in my own DSDT archive 55 of the 93 DSDTs have this issue.
When the if is true the notification gets send to the PCI root instead of only to the GFX0 device. This causes Linux to re-enumerate PCI devices whenever the LID opens / closes, leading to unexpected messages in dmesg:
Suspend through lid close:
[ 313.598199] intel_atomisp2_pm 0000:00:03.0: Refused to change power state, currently in D3 [ 313.664453] intel_atomisp2_pm 0000:00:03.0: Refused to change power state, currently in D3 [ 313.737982] pci_bus 0000:01: Allocating resources [ 313.738036] pcieport 0000:00:1c.0: bridge window [io 0x1000-0x0fff] to [bus 01] add_size 1000 [ 313.738051] pcieport 0000:00:1c.0: bridge window [mem 0x00100000-0x000fffff 64bit pref] to [bus 01] add_size 200000 add_align 100000 [ 313.738111] pcieport 0000:00:1c.0: BAR 15: assigned [mem 0x91000000-0x911fffff 64bit pref] [ 313.738128] pcieport 0000:00:1c.0: BAR 13: assigned [io 0x1000-0x1fff]
Resume:
[ 813.623894] pci 0000:00:03.0: [8086:22b8] type 00 class 0x048000 [ 813.623955] pci 0000:00:03.0: reg 0x10: [mem 0x00000000-0x003fffff] [ 813.630477] pci 0000:00:03.0: BAR 0: assigned [mem 0x91c00000-0x91ffffff] [ 854.579101] intel_atomisp2_pm 0000:00:03.0: Refused to change power state, currently in D3
And more importantly this re-enumeration races with suspend/resume causing enumeration to not be complete when assert_isp_power_gated() from drivers/gpu/drm/i915/display/intel_display_power.c runs. This causes the !pci_dev_present(isp_ids) check in assert_isp_power_gated() to fail making the condition for the WARN true, leading to:
[ 813.327886] ------------[ cut here ]------------ [ 813.327898] ISP not power gated [ 813.328028] WARNING: CPU: 2 PID: 2317 at drivers/gpu/drm/i915/display/intel_display_power.c:4870 intel_display_print_error_state+0x2b98/0x3a80 [i915] ... [ 813.328599] ---[ end trace f01e81b599596774 ]---
This commit fixes the unwanted ACPI notification on the PCI root device by setting CHPD to 1, so that the broken if condition in the AML never gets checked as notifications of type 0x00 are disabled altogether.
--- drivers/gpu/drm/i915/display/intel_opregion.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/i915/display/intel_opregion.c +7 -0
@@ -941,6 +941,13 @@ int intel_opregion_setup(struct drm_i915_private *dev_priv)if (mboxes &MBOX_ACPI ) {DRM_DEBUG_DRIVER ("Public ACPI methods supported\n" ); opregion->acpi = base +OPREGION_ACPI_OFFSET ; +/* +* Indicate we handle monitor hotplug events ourselves so we do +* not need ACPI notifications for them. Disabling these avoids +* triggering the AML code doing the notifation, which may be +* broken as Windows also seems to disable these. +*/ + opregion->acpi->chpd =1 ; }if (mboxes &MBOX_SWSCI ) {
Signature · 6 lines
2.23.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 10 lines · Hans de Goede
According to both the old acpi_igd_opregion_spec_0.pdf and the newer skl_opregion_rev0p5.pdf opregion specification documents, if a driver handles hotplug events itself, it should set the opregion CHPD field to 1 to indicate this and the firmware should respond to this by no longer sending ACPI
0x00notification events on e.g. lid-state changes.Specifically skl_opregion_rev0p5.pdf states thid in the documentation of the CHPD word: "Re-enumeration trigger logic in System BIOS MUST be disabled for all the Operating Systems supporting Hot-Plug (e.g., Windows* Longhorn and above)." Note the MUST in there.
Feels like the spec was written by a politician. It's left to the reader to interpret each statement either one way or the other. But I can get behind your interpretation, especially if it makes the firmware stop doing silly things.
BTW at some point I was looking for other ways to get the firmware to stop messing things. I found a bunch of scratch registers which supposedly might do something like that:
git://github.com/vsyrjala/linux.git vbios_swf
but in the end I don't think that fixed the issue I was trying to sort out, which IIRC was the fact that some old laptops don't survive S4 if we put the GPU into D3.
Quoted 90 lines
We ignore these notifications, so this should not be a problem but many recent DSTDs seem to all have the same copy-pasted bug in the
GNOT()AML function which is used to send these notifications. Windows likely does not hit this bug as it presumably correcty sets CHPD to 1.Here is an example of the broken
GNOT()method:Method (GNOT, 2, NotSerialized) { ... CEVT = Arg0 CSTS = 0x03 If (((CHPD == Zero) && (Arg1 == Zero))) { If (((OSYS > 0x07D0) || (OSYS < 0x07D6))) { Notify (PCI0, Arg1) } Else { Notify (GFX0, Arg1) } } ...Notice that the condition for the If is always true I believe that the || like needs to be an &&, but there is nothing we can do about this and in my own DSDT archive 55 of the 93 DSDTs have this issue.
When the if is true the notification gets send to the PCI root instead of only to the GFX0 device. This causes Linux to re-enumerate PCI devices whenever the LID opens / closes, leading to unexpected messages in dmesg:
Suspend through lid close:
[ 313.598199] intel_atomisp2_pm 0000:00:03.0: Refused to change power state, currently in D3 [ 313.664453] intel_atomisp2_pm 0000:00:03.0: Refused to change power state, currently in D3 [ 313.737982] pci_bus 0000:01: Allocating resources [ 313.738036] pcieport 0000:00:1c.0: bridge window [io 0x1000-0x0fff] to [bus 01] add_size 1000 [ 313.738051] pcieport 0000:00:1c.0: bridge window [mem 0x00100000-0x000fffff 64bit pref] to [bus 01] add_size 200000 add_align 100000 [ 313.738111] pcieport 0000:00:1c.0: BAR 15: assigned [mem 0x91000000-0x911fffff 64bit pref] [ 313.738128] pcieport 0000:00:1c.0: BAR 13: assigned [io 0x1000-0x1fff]Resume:
[ 813.623894] pci 0000:00:03.0: [8086:22b8] type 00 class 0x048000 [ 813.623955] pci 0000:00:03.0: reg 0x10: [mem 0x00000000-0x003fffff] [ 813.630477] pci 0000:00:03.0: BAR 0: assigned [mem 0x91c00000-0x91ffffff] [ 854.579101] intel_atomisp2_pm 0000:00:03.0: Refused to change power state, currently in D3And more importantly this re-enumeration races with suspend/resume causing enumeration to not be complete when
assert_isp_power_gated()fromdrivers/gpu/drm/i915/display/intel_display_power.cruns. This causes the !pci_dev_present(isp_ids) check inassert_isp_power_gated()to fail making the condition for the WARN true, leading to:[ 813.327886] ------------[ cut here ]------------ [ 813.327898] ISP not power gated [ 813.328028] WARNING: CPU: 2 PID: 2317 at drivers/gpu/drm/i915/display/intel_display_power.c:4870 intel_display_print_error_state+0x2b98/0x3a80 [i915] ... [ 813.328599] ---[ end trace f01e81b599596774 ]---This commit fixes the unwanted ACPI notification on the PCI root device by setting CHPD to 1, so that the broken if condition in the AML never gets checked as notifications of type
0x00are disabled altogether.Signed-off-by Hans de Goede <[email protected]>--- drivers/gpu/drm/i915/display/intel_opregion.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/gpu/drm/i915/display/intel_opregion.c +7
-0@@ -941,6 +941,13 @@ int intel_opregion_setup(struct drm_i915_private *dev_priv)if (mboxes &MBOX_ACPI ) {DRM_DEBUG_DRIVER ("Public ACPI methods supported\n" ); opregion->acpi = base +OPREGION_ACPI_OFFSET ; +/* +* Indicate we handle monitor hotplug events ourselves so we do +* not need ACPI notifications for them. Disabling these avoids +* triggering the AML code doing the notifation, which may be +* broken as Windows also seems to disable these. +*/ + opregion->acpi->chpd =1 ; }if (mboxes &MBOX_SWSCI ) {Signature · 1 line
2.23.0
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for drm/i915: opregion: set opregion chpd value to indicate the driver handles hotplug
In reply to Hans de Goede== Series Details ==
== Series Details ==
Series: drm/i915: opregion: set opregion chpd value to indicate the driver handles hotplug
URL : https://patchwork.freedesktop.org/series/69902/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_7409 -> Patchwork_15401
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_15401 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_15401, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15401/index.html
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_15401:
### IGT changes ###
#### Possible regressions ####
* igt@gem_exec_suspend@basic-s0:
- fi-skl-lmem: [PASS][1] -> [DMESG-WARN][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7409/fi-skl-lmem/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15401/fi-skl-lmem/igt@[email protected]
Known issues
------------
Here are the changes found in Patchwork_15401 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_module_load@reload-with-fault-injection:
- fi-skl-6770hq: [PASS][3] -> [DMESG-WARN][4] ([fdo#105541])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7409/fi-skl-6770hq/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15401/fi-skl-6770hq/igt@[email protected]
* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u: [PASS][5] -> [FAIL][6] ([fdo#111045] / [fdo#111096])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7409/fi-kbl-7500u/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15401/fi-kbl-7500u/igt@[email protected]
#### Possible fixes ####
* igt@i915_module_load@reload-no-display:
- fi-skl-lmem: [DMESG-WARN][7] ([fdo#112261]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7409/fi-skl-lmem/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15401/fi-skl-lmem/igt@[email protected]
* igt@kms_addfb_basic@addfb25-y-tiled:
- fi-icl-dsi: [DMESG-WARN][9] ([fdo#106107]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7409/fi-icl-dsi/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15401/fi-icl-dsi/igt@[email protected]
#### Warnings ####
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
- fi-kbl-x1275: [DMESG-WARN][11] ([fdo#103558] / [fdo#105602] / [fdo#105763]) -> [DMESG-WARN][12] ([fdo#103558] / [fdo#105602]) +4 similar issues
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7409/fi-kbl-x1275/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15401/fi-kbl-x1275/igt@[email protected]
* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
- fi-kbl-x1275: [DMESG-WARN][13] ([fdo#103558] / [fdo#105602]) -> [DMESG-WARN][14] ([fdo#103558] / [fdo#105602] / [fdo#105763]) +6 similar issues
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7409/fi-kbl-x1275/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15401/fi-kbl-x1275/igt@[email protected]
[fdo#103558]: https://bugs.freedesktop.org/show_bug.cgi?id=103558
[fdo#105541]: https://bugs.freedesktop.org/show_bug.cgi?id=105541
[fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
[fdo#105763]: https://bugs.freedesktop.org/show_bug.cgi?id=105763
[fdo#106107]: https://bugs.freedesktop.org/show_bug.cgi?id=106107
[fdo#111045]: https://bugs.freedesktop.org/show_bug.cgi?id=111045
[fdo#111096]: https://bugs.freedesktop.org/show_bug.cgi?id=111096
[fdo#112261]: https://bugs.freedesktop.org/show_bug.cgi?id=112261
Participating hosts (50 -> 42)
------------------------------
Missing (8): fi-hsw-4770r fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-bwr-2160 fi-ctg-p8600 fi-bdw-samus
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_7409 -> Patchwork_15401
CI-20190529: 20190529
CI_DRM_7409: a00b5b72443d01a635ab02f55c589aa42ca04bcc @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5301: 3fa72891269b16943e6511166aeebee094206791 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_15401: 1955a9b51ba0495a8c598a7d50e4867e47b5bce7 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
1955a9b51ba0 drm/i915: opregion: set opregion chpd value to indicate the driver handles hotplug
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15401/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: ✗ Fi.CI.BAT: failure for drm/i915: opregion: set opregion chpd value to indicate the driver handles hotplug
Hi all,
Quoted 30 lines · Patchwork
== Series Details ==
Series: drm/i915: opregion: set opregion chpd value to indicate the driver handles hotplug
URL : https://patchwork.freedesktop.org/series/69902/
State : failure== Summary ==
CI Bug Log - changes from
CI_DRM_7409->Patchwork_15401
====================================================Summary
-------**FAILURE**
Serious unknown changes coming with
Patchwork_15401absolutely need to be verified manually.If you think the reported changes have nothing to do with the changes introduced in
Patchwork_15401, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15401/index.htmlPossible new issues
-------------------Here are the unknown changes that may have been introduced in
Patchwork_15401:
Quoted 8 lines
### IGT changes ###
#### Possible regressions ####
* igt@gem_exec_suspend@basic-s0:
- fi-skl-lmem: [PASS][1] -> [DMESG-WARN][2] [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7409/fi-skl-lmem/igt@[email protected] [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15401/fi-skl-lmem/igt@[email protected]
Can someone requeue the tests please? I have a feeling that this is a glitch / false-positive.
Regards,
Hans
Quoted 76 lines
Known issues
------------Here are the changes found in
Patchwork_15401that come from known issues:### IGT changes ###
#### Issues hit ####
* igt@i915_module_load@reload-with-fault-injection:
- fi-skl-6770hq: [PASS][3] -> [DMESG-WARN][4] ([fdo#105541]) [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7409/fi-skl-6770hq/igt@[email protected] [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15401/fi-skl-6770hq/igt@[email protected]* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u: [PASS][5] -> [FAIL][6] ([fdo#111045] / [fdo#111096]) [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7409/fi-kbl-7500u/igt@[email protected] [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15401/fi-kbl-7500u/igt@[email protected]#### Possible fixes ####
* igt@i915_module_load@reload-no-display:
- fi-skl-lmem: [DMESG-WARN][7] ([fdo#112261]) -> [PASS][8] [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7409/fi-skl-lmem/igt@[email protected] [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15401/fi-skl-lmem/igt@[email protected]* igt@kms_addfb_basic@addfb25-y-tiled:
- fi-icl-dsi: [DMESG-WARN][9] ([fdo#106107]) -> [PASS][10] [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7409/fi-icl-dsi/igt@[email protected] [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15401/fi-icl-dsi/igt@[email protected]#### Warnings ####
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy: - fi-kbl-x1275: [DMESG-WARN][11] ([fdo#103558] / [fdo#105602] / [fdo#105763]) -> [DMESG-WARN][12] ([fdo#103558] / [fdo#105602]) +4 similar issues [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7409/fi-kbl-x1275/igt@[email protected] [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15401/fi-kbl-x1275/igt@[email protected] * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a: - fi-kbl-x1275: [DMESG-WARN][13] ([fdo#103558] / [fdo#105602]) -> [DMESG-WARN][14] ([fdo#103558] / [fdo#105602] / [fdo#105763]) +6 similar issues [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7409/fi-kbl-x1275/igt@[email protected] [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15401/fi-kbl-x1275/igt@[email protected] [fdo#103558]: https://bugs.freedesktop.org/show_bug.cgi?id=103558 [fdo#105541]: https://bugs.freedesktop.org/show_bug.cgi?id=105541 [fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602 [fdo#105763]: https://bugs.freedesktop.org/show_bug.cgi?id=105763 [fdo#106107]: https://bugs.freedesktop.org/show_bug.cgi?id=106107 [fdo#111045]: https://bugs.freedesktop.org/show_bug.cgi?id=111045 [fdo#111096]: https://bugs.freedesktop.org/show_bug.cgi?id=111096 [fdo#112261]: https://bugs.freedesktop.org/show_bug.cgi?id=112261Participating hosts (50 -> 42)
------------------------------Missing (8): fi-hsw-4770r fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-bwr-2160 fi-ctg-p8600 fi-bdw-samusBuild changes
-------------* CI: CI-20190529 -> None * Linux: CI_DRM_7409 -> Patchwork_15401 CI-20190529: 20190529 CI_DRM_7409: a00b5b72443d01a635ab02f55c589aa42ca04bcc @ git://anongit.freedesktop.org/gfx-ci/linux IGT_5301: 3fa72891269b16943e6511166aeebee094206791 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools Patchwork_15401: 1955a9b51ba0495a8c598a7d50e4867e47b5bce7 @ git://anongit.freedesktop.org/gfx-ci/linux
Quoted 8 lines
== Linux commits ==
1955a9b51ba0drm/i915: opregion: set opregion chpd value to indicate the driver handles hotplug== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15401/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx