[alsa-devel] [PATCH] ALSA: hda - Fix runtime PM accounting
Lin, Mengdong
mengdong.lin at intel.com
Sun Sep 2 17:51:33 CEST 2012
> -----Original Message-----
> From: Takashi Iwai [mailto:tiwai at suse.de]
> Sent: Saturday, September 01, 2012 12:17 AM
> > I think 'codec->d3_stop_clk_ok' flag is more suitable than
> 'codec->power_on' for this check:
> > if (!codec->d3_stop_clk_ok) ... either not suspended or
> d3_stop_clk_ok is not set for last suspending
> > hda_call_pm_notify(codec->bus, false);
>
> Right, this should be something like that.
>
> It's overall confusing to check codec->d3_stop_clk_ok at that point, though.
> And the confusion comes from the fact that we are using this flag for
> multiple purposes -- the flag indicating the hardware status and the flag
> indicating whether the pm-notification has been done.
>
> So I did a few clean ups in my tree now. Essentially I replaced
> codec->d3_stop_clk_ok with codec->pm_down_notified to make the
> meaning
> clearer. Also the check of D3_STOP_CLK_OK bit was moved to the
> hda_power_down_work() so that it's performed only in the power save.
>
Yeah, the flag's new name is more direct and make code easy to understand.
Thanks
Mengdong
More information about the Alsa-devel
mailing list