All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Lofstedt, Marta" <marta.lofstedt@intel.com>
To: "Saarinen, Jani" <jani.saarinen@intel.com>,
	"Kumar, Abhijeet" <abhijeet.kumar@intel.com>,
	Takashi Iwai <tiwai@suse.de>,
	Chris Wilson <chris@chris-wilson.co.uk>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] AWOOGA: Revert "ALSA: hda: Make use of core codec functions to sync power state"
Date: Tue, 13 Feb 2018 07:40:37 +0000	[thread overview]
Message-ID: <CA5F6A4B62957246A95956419746064382B3090E@IRSMSX106.ger.corp.intel.com> (raw)
In-Reply-To: <43D4F724E12AB6478FC1572B3FBE89D075E034EE@IRSMSX106.ger.corp.intel.com>

See bug: https://bugs.freedesktop.org/show_bug.cgi?id=105069

> -----Original Message-----
> From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Behalf
> Of Saarinen, Jani
> Sent: Tuesday, February 13, 2018 9:35 AM
> To: Kumar, Abhijeet <abhijeet.kumar@intel.com>; Takashi Iwai
> <tiwai@suse.de>; Chris Wilson <chris@chris-wilson.co.uk>
> Cc: intel-gfx@lists.freedesktop.org
> Subject: Re: [Intel-gfx] [PATCH] AWOOGA: Revert "ALSA: hda: Make use of
> core codec functions to sync power state"
> 
> Hi,
> > -----Original Message-----
> > From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On
> > Behalf Of Kumar, Abhijeet
> > Sent: tiistai 13. helmikuuta 2018 7.18
> > To: Takashi Iwai <tiwai@suse.de>; Chris Wilson
> > <chris@chris-wilson.co.uk>
> > Cc: intel-gfx@lists.freedesktop.org
> > Subject: Re: [Intel-gfx] [PATCH] AWOOGA: Revert "ALSA: hda: Make use
> > of core codec functions to sync power state"
> >
> >
> >
> > On 2/13/2018 10:41 AM, Takashi Iwai wrote:
> > > On Mon, 12 Feb 2018 18:29:53 +0100,
> > > Chris Wilson wrote:
> > >> This reverts commit 3b5b899ca67db07a4c4825911072221f99e157e2.
> > >>
> > >> Fixes: 3b5b899ca67d ("ALSA: hda: Make use of core codec functions
> > >> to sync power state")
> > >> Cc: Abhijeet Kumar <abhijeet.kumar@intel.com>
> > >> Cc: Takashi Iwai <tiwai@suse.de>
> > > Did the patch break anything?
> > Not sure, why it would break anything. As there was literally no
> > functional change.
> You can also doing so by yourself just looking at resutls from revert, but I also
> sent mail to explain.
> 
> >
> > Chris,
> > Can you help us in understanding the issue caused by this patch ?
> >
> > Warm Regards,
> > Abhijeet
> > > I don't understand it without any real context...
> > >
> > >
> > > thanks,
> > >
> > > Takashi
> > >
> > >> ---
> > >>   sound/pci/hda/hda_codec.c | 28 +++++++++++++++++++++++++++-
> > >>   sound/pci/hda/hda_local.h |  6 +-----
> > >>   2 files changed, 28 insertions(+), 6 deletions(-)
> > >>
> > >> diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
> > >> index 5bc3a7468e17..e018ecbf78a8 100644
> > >> --- a/sound/pci/hda/hda_codec.c
> > >> +++ b/sound/pci/hda/hda_codec.c
> > >> @@ -2702,6 +2702,32 @@ void
> snd_hda_codec_set_power_to_all(struct
> > hda_codec *codec, hda_nid_t fg,
> > >>   }
> > >>   EXPORT_SYMBOL_GPL(snd_hda_codec_set_power_to_all);
> > >>
> > >> +/*
> > >> + * wait until the state is reached, returns the current state  */
> > >> +static unsigned int hda_sync_power_state(struct hda_codec *codec,
> > >> +
> hda_nid_t fg,
> > >> +
> unsigned int power_state)
> > >> +{
> > >> +	unsigned long end_time = jiffies + msecs_to_jiffies(500);
> > >> +	unsigned int state, actual_state;
> > >> +
> > >> +	for (;;) {
> > >> +		state = snd_hda_codec_read(codec, fg, 0,
> > >> +
> AC_VERB_GET_POWER_STATE, 0);
> > >> +		if (state & AC_PWRST_ERROR)
> > >> +			break;
> > >> +		actual_state = (state >> 4) & 0x0f;
> > >> +		if (actual_state == power_state)
> > >> +			break;
> > >> +		if (time_after_eq(jiffies, end_time))
> > >> +			break;
> > >> +		/* wait until the codec reachs to the target state
> */
> > >> +		msleep(1);
> > >> +	}
> > >> +	return state;
> > >> +}
> > >> +
> > >>   /**
> > >>    * snd_hda_codec_eapd_power_filter - A power filter callback for
> EAPD
> > >>    * @codec: the HDA codec
> > >> @@ -2764,7 +2790,7 @@ static unsigned int
> > >> hda_set_power_state(struct
> > hda_codec *codec,
> > >>
> 	   state);
> > >>
> 	snd_hda_codec_set_power_to_all(codec, fg,
> > power_state);
> > >>   		}
> > >> -		state = snd_hda_sync_power_state(codec, fg,
> power_state);
> > >> +		state = hda_sync_power_state(codec, fg,
> power_state);
> > >>   		if (!(state & AC_PWRST_ERROR))
> > >>   			break;
> > >>   	}
> > >> diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h
> > >> index 321e78baa63c..5b5c324c99b9 100644
> > >> --- a/sound/pci/hda/hda_local.h
> > >> +++ b/sound/pci/hda/hda_local.h
> > >> @@ -622,11 +622,7 @@ snd_hda_check_power_state(struct
> hda_codec
> > *codec, hda_nid_t nid,
> > >>   {
> > >>   	return snd_hdac_check_power_state(&codec->core, nid,
> target_state);
> > >>   }
> > >> -static inline bool snd_hda_sync_power_state(struct hda_codec
> *codec,
> > >> -			   hda_nid_t nid, unsigned int
> target_state)
> > >> -{
> > >> -	return snd_hdac_sync_power_state(&codec->core, nid,
> target_state);
> > >> -}
> > >> +
> > >>   unsigned int snd_hda_codec_eapd_power_filter(struct hda_codec
> *codec,
> > >>
> hda_nid_t nid,
> > >>
> unsigned int power_state);
> > >> --
> > >> 2.16.1
> > >>
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-02-13  7:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-12 17:29 [PATCH] AWOOGA: Revert "ALSA: hda: Make use of core codec functions to sync power state" Chris Wilson
2018-02-12 18:28 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-02-12 22:19 ` ✓ Fi.CI.IGT: " Patchwork
2018-02-13  5:11 ` [PATCH] " Takashi Iwai
2018-02-13  5:18   ` Kumar, Abhijeet
2018-02-13  7:35     ` Saarinen, Jani
2018-02-13  7:40       ` Lofstedt, Marta [this message]
2018-02-13  8:06         ` Kumar, Abhijeet
2018-02-13  7:34   ` Saarinen, Jani
2018-02-13  8:14     ` Takashi Iwai
2018-02-13  8:26       ` Saarinen, Jani
2018-02-13  8:30         ` Takashi Iwai
2018-02-13  8:32           ` Kumar, Abhijeet
2018-02-13  8:37           ` Chris Wilson
2018-02-13  8:27       ` Kumar, Abhijeet

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=CA5F6A4B62957246A95956419746064382B3090E@IRSMSX106.ger.corp.intel.com \
    --to=marta.lofstedt@intel.com \
    --cc=abhijeet.kumar@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.saarinen@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.