All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Sridharan, Ranjani" <ranjani.sridharan@intel.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: "Takashi Iwai" <tiwai@suse.de>,
	Linux-ALSA <alsa-devel@alsa-project.org>,
	"Mark Brown" <broonie@kernel.org>,
	"Ranjani Sridharan" <ranjani.sridharan@linux.intel.com>,
	"Amadeusz Sławiński" <amadeuszx.slawinski@linux.intel.com>
Subject: Re: [alsa-devel] [PATCH 5/9] ASoC: SOF: Move DSP power state transitions to platform-specific ops
Date: Thu, 30 Jan 2020 07:33:07 -0800	[thread overview]
Message-ID: <CAFQqKeV5grgKvObGf-9vYb-9M4ddq+vK=VCrPjbV9kKc1s_-Cg@mail.gmail.com> (raw)
In-Reply-To: <615262ec-2515-ef6f-1ed4-8c42170490c4@linux.intel.com>

On Thu, Jan 30, 2020 at 7:07 AM Pierre-Louis Bossart <
pierre-louis.bossart@linux.intel.com> wrote:

>
> >> @@ -495,13 +645,27 @@ int hda_dsp_resume(struct snd_sof_dev *sdev)
> >>       }
> >>       /* init hda controller. DSP cores will be powered up during fw
> >> boot */
> >> -    return hda_resume(sdev, false);
> >> +    ret = hda_resume(sdev, false);
> >> +    if (ret < 0)
> >> +        return ret;
> >> +
> >> +    hda_dsp_set_power_state(sdev, &target_state);
> >
> > Return value  of hda_dsp_set_power_state() seems to be checked or
> > directly returned in other functions, any reason to not do it here?
>
> Good point Amadeusz, not sure why. And looking at the code, I am not
> sure either why we don't use the abstraction w/ .set_power_state() ?
>
> intel/apl.c:    .set_power_state        = hda_dsp_set_power_state,
> intel/cnl.c:    .set_power_state        = hda_dsp_set_power_state,
>
>
> git grep snd_sof_dsp_set_power_state
> sof/ipc.c:      ret = snd_sof_dsp_set_power_state(ipc->sdev,
> &target_state);
> sof/ops.h:snd_sof_dsp_set_power_state(struct snd_sof_dev *sdev,
>
> If the code can be platform-specific, we shouldn't make a direct call
> but go through the platform indirection. it's fine for now since the
> same routine is used in all cases but it's not scalable/future-proof.
>
> Ranjani?
>
Hi Amadeusz/Pierre,

This seems like a miss. We should have returned the value of
hda_set_power_state() directly here.

And to address your point, Pierre. This is the platform-specific code, so
the use of hda_dsp_set_power_state() should be permitted no? Whereas, the
part that uses this function in ipc.c is not platform-specific.
Thanks,
Ranjani
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2020-01-30 15:34 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-29 22:07 [alsa-devel] [PATCH 0/9] ASoC: SOF: update S0ix/D0ix support Pierre-Louis Bossart
2020-01-29 22:07 ` [alsa-devel] [PATCH 1/9] ASoC: SOF: Do not reset hw_params for streams that ignored suspend Pierre-Louis Bossart
2020-02-11 15:48   ` [alsa-devel] Applied "ASoC: SOF: Do not reset hw_params for streams that ignored suspend" to the asoc tree Mark Brown
2020-01-29 22:07 ` [alsa-devel] [PATCH 2/9] ASoC: SOF: pm: Unify suspend/resume routines Pierre-Louis Bossart
2020-02-11 15:48   ` [alsa-devel] Applied "ASoC: SOF: pm: Unify suspend/resume routines" to the asoc tree Mark Brown
2020-01-29 22:07 ` [alsa-devel] [PATCH 3/9] ASoC: SOF: Add system_suspend_target field to struct snd_sof_dev Pierre-Louis Bossart
2020-02-11 15:48   ` [alsa-devel] Applied "ASoC: SOF: Add system_suspend_target field to struct snd_sof_dev" to the asoc tree Mark Brown
2020-01-29 22:07 ` [alsa-devel] [PATCH 4/9] ASoC: SOF: pm: Introduce DSP power states Pierre-Louis Bossart
2020-02-11 15:48   ` [alsa-devel] Applied "ASoC: SOF: pm: Introduce DSP power states" to the asoc tree Mark Brown
2020-01-29 22:07 ` [alsa-devel] [PATCH 5/9] ASoC: SOF: Move DSP power state transitions to platform-specific ops Pierre-Louis Bossart
2020-01-30  7:47   ` Amadeusz Sławiński
2020-01-30 13:03     ` Mark Brown
2020-01-30 13:34     ` Pierre-Louis Bossart
2020-01-30 15:33       ` Sridharan, Ranjani [this message]
2020-01-30 18:35         ` Pierre-Louis Bossart
2020-02-11 15:48   ` [alsa-devel] Applied "ASoC: SOF: Move DSP power state transitions to platform-specific ops" to the asoc tree Mark Brown
2020-01-29 22:07 ` [alsa-devel] [PATCH 6/9] ASoC: SOF: audio: Add helper to check if only D0i3 streams are active Pierre-Louis Bossart
2020-02-11 15:48   ` [alsa-devel] Applied "ASoC: SOF: audio: Add helper to check if only D0i3 streams are active" to the asoc tree Mark Brown
2020-01-29 22:07 ` [alsa-devel] [PATCH 7/9] ASoC: SOF: Intel: hda: Amend the DSP state transition diagram Pierre-Louis Bossart
2020-02-11 15:48   ` [alsa-devel] Applied "ASoC: SOF: Intel: hda: Amend the DSP state transition diagram" to the asoc tree Mark Brown
2020-01-29 22:07 ` [alsa-devel] [PATCH 8/9] ASoC: SOF: Intel: cnl: Implement feature to support DSP D0i3 in S0 Pierre-Louis Bossart
2020-02-11 15:48   ` [alsa-devel] Applied "ASoC: SOF: Intel: cnl: Implement feature to support DSP D0i3 in S0" to the asoc tree Mark Brown
2020-01-29 22:07 ` [alsa-devel] [PATCH 9/9] ASoC: SOF: Intel: hda: Allow trace DMA in S0 when DSP is in D0I3 for debug Pierre-Louis Bossart
2020-02-11 15:48   ` [alsa-devel] Applied "ASoC: SOF: Intel: hda: Allow trace DMA in S0 when DSP is in D0I3 for debug" to the asoc tree Mark Brown

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='CAFQqKeV5grgKvObGf-9vYb-9M4ddq+vK=VCrPjbV9kKc1s_-Cg@mail.gmail.com' \
    --to=ranjani.sridharan@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=amadeuszx.slawinski@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    --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.