All of lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@freedesktop.org
To: dri-devel@lists.freedesktop.org
Subject: [Bug 106597] [vga_switcheroo] commit 07f4f97d7b4bf325d9f558c5b58230387e4e57e0 breaks dpm on Alienware 15R3
Date: Thu, 24 May 2018 08:56:44 +0000	[thread overview]
Message-ID: <bug-106597-502-0q2LzZhgQ3@http.bugs.freedesktop.org/> (raw)
In-Reply-To: <bug-106597-502@http.bugs.freedesktop.org/>


[-- Attachment #1.1: Type: text/plain, Size: 2072 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=106597

--- Comment #21 from Lukas Wunner <lukas@wunner.de> ---
Okay so the reason the HDA controller doesn't suspend is because the
codec_powered bitmask is not null:

snd_hda_intel 0000:01:00.1: azx_runtime_idle: !power_save_controller = 0,
!azx_has_pm_runtime(chip) = 0, azx_bus(chip)->codec_powered = 0x1,
!chip->running = 0

The lowest bit is set. In other words, the single codec on that HDA bus is
considered powered on, so the HDA controller is prevented from suspending.

Bits in the codec_powered bitmask are set or cleared using
snd_hdac_codec_link_up() and snd_hdac_codec_link_down(), which are only called
during runtime suspend and resume of the codec.

Looking at hda_codec_runtime_suspend(), we can see that the bit is only cleared
conditionally:

https://elixir.bootlin.com/linux/latest/source/sound/pci/hda/hda_codec.c#L2906

        if (codec_has_clkstop(codec) && codec_has_epss(codec) &&
            (state & AC_PWRST_CLK_STOP_OK))
                snd_hdac_codec_link_down(&codec->core);

The codec_has_clkstop() and codec_has_epss() macros just query bits in the
power_caps bitmask. That bitmask can also be retrieved from sysfs, could you
please post the output of:
grep . /sys/bus/hdaudio/devices/hdaudioC1D0/widgets/*/power_caps

I'll prepare another debug patch so that we get a better understanding why the
codec isn't powered down.

We've either got a bug in the HDA code here or we're missing a quirk for this
specific HDA controller. Sooner or later we'll have to pull in Takashi Iwai
(hda maintainer) and/or AMD engineers responsible for the HDA portion of their
GPUs.

Previously we just papered over such issues by forcing the HDA controller off
when the GPU runtime suspends, but since my commit 07f4f97d7b4b such bugs are
now exposed as we deliberately keep the GPU awake as long as the HDA controller
is in use. Thanks for helping identify and tracking down this issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 3066 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2018-05-24  8:56 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-21 20:36 [Bug 106597] [vga_switcheroo] commit 07f4f97d7b4bf325d9f558c5b58230387e4e57e0 breaks dpm on Alienware 15R3 bugzilla-daemon
2018-05-21 20:59 ` bugzilla-daemon
2018-05-21 21:17 ` bugzilla-daemon
2018-05-21 21:26 ` bugzilla-daemon
2018-05-21 21:34 ` bugzilla-daemon
2018-05-21 21:47 ` bugzilla-daemon
2018-05-21 22:03 ` bugzilla-daemon
2018-05-21 22:43 ` bugzilla-daemon
2018-05-22  8:16 ` bugzilla-daemon
2018-05-22  8:18 ` bugzilla-daemon
2018-05-22  8:19 ` bugzilla-daemon
2018-05-22  8:22 ` bugzilla-daemon
2018-05-22  9:03 ` bugzilla-daemon
2018-05-22 20:40 ` bugzilla-daemon
2018-05-22 21:18 ` bugzilla-daemon
2018-05-22 21:49 ` bugzilla-daemon
2018-05-23  6:54 ` bugzilla-daemon
2018-05-23  9:59 ` bugzilla-daemon
2018-05-23 10:21 ` bugzilla-daemon
2018-05-23 12:19 ` bugzilla-daemon
2018-05-23 23:12 ` bugzilla-daemon
2018-05-24  8:56 ` bugzilla-daemon [this message]
2018-05-24 10:01 ` bugzilla-daemon
2018-05-24 10:04 ` bugzilla-daemon
2018-05-24 10:13 ` bugzilla-daemon
2018-05-24 10:28 ` bugzilla-daemon
2018-05-24 13:07 ` bugzilla-daemon
2018-05-24 15:34 ` bugzilla-daemon
2018-05-24 15:43 ` bugzilla-daemon
2018-05-24 16:15 ` bugzilla-daemon
2018-05-24 16:40 ` bugzilla-daemon
2018-05-24 16:40 ` bugzilla-daemon
2018-05-24 17:18 ` bugzilla-daemon
2018-05-24 17:42 ` bugzilla-daemon
2018-05-24 21:08 ` bugzilla-daemon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-106597-502-0q2LzZhgQ3@http.bugs.freedesktop.org/ \
    --to=bugzilla-daemon@freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.