ALSA: hda - block HDMI jack reports while repolling
This fixes a race condition in case several monitors are being repolled in parallel. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
committed by
Takashi Iwai
parent
0f568959de
commit
464837a7bc
@@ -1477,6 +1477,7 @@ static int hdmi_read_pin_conn(struct hda_codec *codec, int pin_idx)
|
|||||||
|
|
||||||
static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
|
static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
|
||||||
{
|
{
|
||||||
|
struct hda_jack_tbl *jack;
|
||||||
struct hda_codec *codec = per_pin->codec;
|
struct hda_codec *codec = per_pin->codec;
|
||||||
struct hdmi_spec *spec = codec->spec;
|
struct hdmi_spec *spec = codec->spec;
|
||||||
struct hdmi_eld *eld = &spec->temp_eld;
|
struct hdmi_eld *eld = &spec->temp_eld;
|
||||||
@@ -1564,6 +1565,11 @@ static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
|
|||||||
ret = true; /* AMD codecs create ELD by itself */
|
ret = true; /* AMD codecs create ELD by itself */
|
||||||
else
|
else
|
||||||
ret = !repoll || !pin_eld->monitor_present || pin_eld->eld_valid;
|
ret = !repoll || !pin_eld->monitor_present || pin_eld->eld_valid;
|
||||||
|
|
||||||
|
jack = snd_hda_jack_tbl_get(codec, pin_nid);
|
||||||
|
if (jack)
|
||||||
|
jack->block_report = !ret;
|
||||||
|
|
||||||
mutex_unlock(&per_pin->lock);
|
mutex_unlock(&per_pin->lock);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user