ALSA: hda/hdmi - Read the pin sense from register when repolling
authorHui Wang <hui.wang@canonical.com>
Mon, 6 May 2019 14:09:31 +0000 (22:09 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 May 2019 16:48:57 +0000 (18:48 +0200)
commit5c767fc6a9623f97c141b8e164bafc0dfe8c13e3
tree8e626c85b693908b079d7f0408642788b23e075e
parentf934bf3f57769282c371c978eb9bbe3930f6ed35
ALSA: hda/hdmi - Read the pin sense from register when repolling

commit 8c2e6728c2bf95765b724e07d0278ae97cd1ee0d upstream.

The driver will check the monitor presence when resuming from suspend,
starting poll or interrupt triggers. In these 3 situations, the
jack_dirty will be set to 1 first, then the hda_jack.c reads the
pin_sense from register, after reading the register, the jack_dirty
will be set to 0. But hdmi_repoll_work() is enabled in these 3
situations, It will read the pin_sense a couple of times subsequently,
since the jack_dirty is 0 now, It does not read the register anymore,
instead it uses the shadow pin_sense which is read at the first time.

It is meaningless to check the shadow pin_sense a couple of times,
we need to read the register to check the real plugging state, so
we set the jack_dirty to 1 in the hdmi_repoll_work().

Signed-off-by: Hui Wang <hui.wang@canonical.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/pci/hda/patch_hdmi.c