From: Lukas Wunner <lukas@wunner.de>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, Henning Kuehn <prg@cooco.de>
Subject: HDA controller w/o CLKSTOP and EPSS support
Date: Wed, 20 Jun 2018 11:34:52 +0200 [thread overview]
Message-ID: <20180620093452.GA25280@wunner.de> (raw)
Hi Takashi,
Henning Kühn reports that due to my commit 07f4f97d7b4b ("vga_switcheroo:
Use device link for HDA controller"), the discrete GPU on his hybrid
graphics laptop no longer runtime suspends.
The root cause is that the single codec of the GPU's HDA controller
doesn't support CLKSTOP and EPSS. (The "Supported Power States" are
0x00000009, i.e. CLKSTOP and EPSS bits are not set, cf. page 209 of
the HDA spec.)
This means that in hda_codec_runtime_suspend() we do not call
snd_hdac_codec_link_down():
if (codec_has_clkstop(codec) && codec_has_epss(codec) &&
(state & AC_PWRST_CLK_STOP_OK))
snd_hdac_codec_link_down(&codec->core);
If snd_hdac_codec_link_down() isn't called, the bit in the codec_powered
bitmask isn't cleared, which in turn prevents the controller from going
to PCI_D3hot in azx_runtime_idle():
if (!power_save_controller || !azx_has_pm_runtime(chip) ||
azx_bus(chip)->codec_powered || !chip->running)
return -EBUSY;
The codec does runtime suspend to D3, but the PS-ClkStopOk bit in the
response to "Get Power State" is not set. (Response is 0x00000033,
cf. page 151 of the HD Audio spec.) Hence the check above
"state & AC_PWRST_CLK_STOP_OK" also results in "false".
I'm not familiar enough with the intricacies of the HD Audio spec to
fully comprehend the implications of missing EPSS and CLKSTOP support
and to come up with a fix. We could quirk any HDA controller in a
vga_switcheroo setup to ignore missing EPSS and CLKSTOP support, but
would that be safe? E.g. the spec says that if the bus clock does stop,
"a full reset shall be performed" when the clock is reenabled. Are we
handling this correctly?
Any help in coming up with a proper fix would be greatly appreciated.
dmesg output is available here:
https://bugs.freedesktop.org/show_bug.cgi?id=106957
It's a muxed hybrid graphics machine, the HDA controller has PCI ID
1002:aa60.
Thanks!
Lukas
next reply other threads:[~2018-06-20 9:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-20 9:34 Lukas Wunner [this message]
2018-06-20 10:14 ` HDA controller w/o CLKSTOP and EPSS support Takashi Iwai
2018-06-20 22:28 ` prg
2018-06-21 5:31 ` Takashi Iwai
2018-06-21 12:49 ` Muxed ATPX graphics (was: Re: HDA controller w/o CLKSTOP and EPSS support) Lukas Wunner
2018-06-21 9:18 ` HDA controller w/o CLKSTOP and EPSS support Lukas Wunner
2018-06-21 9:24 ` Takashi Iwai
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=20180620093452.GA25280@wunner.de \
--to=lukas@wunner.de \
--cc=alsa-devel@alsa-project.org \
--cc=prg@cooco.de \
--cc=tiwai@suse.de \
/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.