https://bugzilla.kernel.org/show_bug.cgi?id=212951

--- Comment #13 from Chris Chiu (chris.c...@canonical.com) ---
I got this problem fixed with the following hacky code and I think it should be
a finding that could help.

```
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -1399,6 +1399,15 @@ static int i915_pm_poweroff_late(struct device *kdev)
        return i915_drm_suspend_late(&i915->drm, true);
 }

+static int i915_pm_resume_noirq(struct device *kdev)
+{
+       struct drm_i915_private *i915 = kdev_to_i915(kdev);
+
+       if (!IS_VALLEYVIEW(i915) && !IS_CHERRYVIEW(i915))
+               intel_hpd_init(i915);
+       return 0;
+}
+
 static int i915_pm_resume_early(struct device *kdev)
 {
        struct drm_i915_private *i915 = kdev_to_i915(kdev);
@@ -1626,6 +1635,7 @@ const struct dev_pm_ops i915_pm_ops = {
        .prepare = i915_pm_prepare,
        .suspend = i915_pm_suspend,
        .suspend_late = i915_pm_suspend_late,
+       .resume_noirq = i915_pm_resume_noirq,
        .resume_early = i915_pm_resume_early,
        .resume = i915_pm_resume,

```

Because this APCI method IPCS lockup only happens when we remove the dock with
external display connected(or the USB-C dongle with external display connected)
when suspended and then exit s2idle. It should be related to either graphic
drivers or hpd events handling. I did lots of experiments and found if the
\_SB.PC00.PEG1.PG01._ON exeutes after i915_pm_resume_early, the IPCS will not
be locked by the IBSY and IERR.

Since the \_SB.PC00.PEG1.PG01._ON is invoked by pci_power_up() in
pci_pm_resume_noirq and it's in the context of dpm_resume_noirq(). The
i915_pm_resume_early is in dpm_resume_early() context and that's why the
Sleep(One) in the IPCS lasts for >30 seconds but i915 still has no chance to
early resume to free the IPCS lock.

I assume that it's due to the unplug action is not handled properly during
resume, so I add the .resume_noirq() in i915 driver to let the hpd have chance
to do something during in the same dpm_resume_noirq context. It seems to work
fine and pci 0000:01:00.0 (PEG1) can transition to D0 w/o problem. However,
it's a dirty hack because I'll hit the kernel WARN in hpd_init(). Please refer
to the attached hpd_init_dmesg.log.

Can anyone from Intel help on this? I'll be glad to collect logs or test any
PATCH. Thanks

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

_______________________________________________
acpi-bugzilla mailing list
acpi-bugzilla@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/acpi-bugzilla

Reply via email to