public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Paul Menzel <paulepanter@users.sourceforge.net>
To: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/2 v2] hda - delayed ELD repoll
Date: Wed, 16 Nov 2011 08:02:32 +0100	[thread overview]
Message-ID: <1321426952.3398.5.camel@mattotaupa> (raw)
In-Reply-To: <20111115165708.GA5224@localhost>


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

Dear Fengguang,


Am Mittwoch, den 16.11.2011, 00:57 +0800 schrieb Wu Fengguang:
> The Intel HDMI chips (ironlake at least) are found to have ~250ms delay
> between the ELD_Valid=1 hotplug event is send and the ELD buffer becomes
> actually readable. During the time the ELD buffer is mysteriously all 0.
> 
> Fix it by scheduling a delayed work to re-read ELD buffer after 300ms.
> 
> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>

other then my comment at the end, please note that it is very confusing
for European (and other folks) what your first name is.

If it is Fengguang then you should use

Fengguang Wu or Wu, Fengguang

where I prefer the first one.

> ---
>  sound/pci/hda/hda_local.h  |    2 +
>  sound/pci/hda/patch_hdmi.c |   49 ++++++++++++++++++++++++++++++-----
>  2 files changed, 44 insertions(+), 7 deletions(-)
> 
> --- linux.orig/sound/pci/hda/hda_local.h	2011-11-15 21:29:53.000000000 +0800
> +++ linux/sound/pci/hda/hda_local.h	2011-11-15 21:29:54.000000000 +0800
> @@ -655,6 +655,8 @@ struct hdmi_eld {
>  #ifdef CONFIG_PROC_FS
>  	struct snd_info_entry *proc_entry;
>  #endif
> +	struct hda_codec *codec;
> +	struct delayed_work work;
>  };
>  
>  int snd_hdmi_get_eld_size(struct hda_codec *codec, hda_nid_t nid);
> --- linux.orig/sound/pci/hda/patch_hdmi.c	2011-11-15 21:29:53.000000000 +0800
> +++ linux/sound/pci/hda/patch_hdmi.c	2011-11-16 00:50:50.000000000 +0800
> @@ -746,7 +746,7 @@ static void hdmi_setup_audio_infoframe(s
>   */
>  
>  static void hdmi_present_sense(struct hda_codec *codec, hda_nid_t pin_nid,
> -			       struct hdmi_eld *eld);
> +			       struct hdmi_eld *eld, bool retry);
>  
>  static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res)
>  {
> @@ -766,7 +766,7 @@ static void hdmi_intrinsic_event(struct 
>  		return;
>  	eld = &spec->pins[pin_idx].sink_eld;
>  
> -	hdmi_present_sense(codec, pin_nid, eld);
> +	hdmi_present_sense(codec, pin_nid, eld, true);
>  
>  	/*
>  	 * HDMI sink's ELD info cannot always be retrieved for now, e.g.
> @@ -969,7 +969,7 @@ static int hdmi_read_pin_conn(struct hda
>  }
>  
>  static void hdmi_present_sense(struct hda_codec *codec, hda_nid_t pin_nid,
> -			       struct hdmi_eld *eld)
> +			       struct hdmi_eld *eld, bool retry)
>  {
>  	/*
>  	 * Always execute a GetPinSense verb here, even when called from
> @@ -992,13 +992,31 @@ static void hdmi_present_sense(struct hd
>  		"HDMI status: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n",
>  		codec->addr, pin_nid, eld->monitor_present, eld_valid);
>  
> -	if (eld_valid)
> +	if (eld_valid) {
>  		if (!snd_hdmi_get_eld(eld, codec, pin_nid))
>  			snd_hdmi_show_eld(eld);
> +		else if (retry) {
> +			queue_delayed_work(codec->bus->workq,
> +					   &eld->work,
> +					   msecs_to_jiffies(300));
> +		}

Would adding a comment referring to the discussion thread be beneficial
for code readers asking why a delay is needed?

> +	}
>  
>  	snd_hda_input_jack_report(codec, pin_nid);
>  }

[…]


Thanks,

Paul

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2011-11-16 10:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-15 14:31 [PATCH 1/2] hda - fix ELD memory leak Wu Fengguang
2011-11-15 14:33 ` [PATCH 2/2] hda - delayed ELD repoll Wu Fengguang
2011-11-15 16:56   ` Wu Fengguang
2011-11-15 16:57     ` [PATCH 2/2 v2] " Wu Fengguang
2011-11-15 17:10       ` Takashi Iwai
2011-11-16  2:35         ` Wu Fengguang
2011-11-16  7:02       ` Paul Menzel [this message]
2011-11-15 18:25   ` [PATCH 2/2] " Stephen Warren
2011-11-16  2:48     ` [alsa-devel] " Wu Fengguang
2011-11-16 15:51       ` Stephen Warren
2011-11-16 15:57         ` Takashi Iwai
2011-11-16 16:12           ` Stephen Warren
2011-11-16 16:16             ` [alsa-devel] " Takashi Iwai
2011-11-16 22:46         ` Wu Fengguang
2011-11-16 23:12           ` Wu Fengguang
2011-11-15 14:35 ` [PATCH 1/2] hda - fix ELD memory leak Takashi Iwai
2011-11-15 14:41   ` Wu Fengguang
2011-11-15 14:45     ` Takashi Iwai
2011-11-15 16:56       ` Wu Fengguang
2011-11-15 18:19 ` Stephen Warren

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=1321426952.3398.5.camel@mattotaupa \
    --to=paulepanter@users.sourceforge.net \
    --cc=intel-gfx@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox