Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp230796yba; Mon, 20 May 2019 07:48:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqzp6VtKa32X8weSJVtvO+rnnD1lLDJLWish3FWtSytFrxvevVVduO6YdtSKCyppqG6GB/JY X-Received: by 2002:a63:6c87:: with SMTP id h129mr15789120pgc.427.1558363727150; Mon, 20 May 2019 07:48:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558363727; cv=none; d=google.com; s=arc-20160816; b=JeEOhdrrZu/HSqLoCXzn7wxGsCqq0fsSZqUhMHGOUxXu4HpqWQhKsaE44YjAZPUU2r WyZVzLgCti9suA1PF+KWPa5b+FQ1v4DJSQT/gpIJxJUzh4lSODaPrNAlRhW22aJXMLYU a2YW/Q26Rdp6Ggj4QqXwg1oqjeRs25jZSyBecpgVkitpsogrigHxM6cnIQIdmNghwdDW yRleF0hoGSN9otYw9KAbQebBW9AkYhNKhtP0kjr9ek4VW4ETOAvR+d+n3MKRleHcyYO1 BABFfB8e8WxODMbghj/algxrVZg5DuZr+JX2YDoM8DOKfQXBQ/j5W0b95zUmDL1KVJ17 bRCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hdPguwPw0uBL51zaqIRUSOjM0HCblyQZKSbQJhT1CrM=; b=ojdNKY1YX+i/jqLNlIqid2CO/XV7ahHEXG6nYMcCPOwJuBW4FzeJsdKn/Aacn3vk0Q xQZkWgvdMo9BfocExgirI3NSy6Cdxub5wp2d6FxpF5ZpFzLaxxExMnqrUjV/3YPRZQ9y lq74ocY5bZ9zUv3QgmTh+vlTo9K+/eB/osKagdw7YWjVsELH46Lz2IJqyDeSr2wqXgky 8Ln2FUm8cCGxlZnRTEQgCHqUt07ZfiJqLOoZVyaFSizfvEXEBH/aDo2DeBJvt6IFt+YU 9qqBTu4fu3i59/FnyIdV1aeY2+rAvILUv81+uCoagCCM7keXwsLJ/lCICI+miYWvOKME alFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jihcRKoU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i12si2026976plt.287.2019.05.20.07.48.32; Mon, 20 May 2019 07:48:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jihcRKoU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733057AbfETMQb (ORCPT + 99 others); Mon, 20 May 2019 08:16:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:57258 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732014AbfETMQ3 (ORCPT ); Mon, 20 May 2019 08:16:29 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3BEC220815; Mon, 20 May 2019 12:16:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558354588; bh=QPen5dc4z6+/Ex//o4jzsQcbNwXBIUaraidNXvcF9uw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jihcRKoU2U53/hGsoG+vtiJOhy6W2L4UCOrpuzScH9Sca5zsIEfo7cUBDxT5oOn1m r18xHrwFgbV0b631xZw//IOHiUFUvYfMmMeqkN3OBafAw3vbPY7rxdl0M0YPU7/zyZ F31Qb+UrveNboaRC+RzZLgcNzkIsdC+rwlK9QTUA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hui Wang , Takashi Iwai Subject: [PATCH 4.9 17/44] ALSA: hda/hdmi - Read the pin sense from register when repolling Date: Mon, 20 May 2019 14:14:06 +0200 Message-Id: <20190520115232.964766940@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190520115230.720347034@linuxfoundation.org> References: <20190520115230.720347034@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hui Wang 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 Cc: Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/pci/hda/patch_hdmi.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -1554,6 +1554,11 @@ static void hdmi_repoll_eld(struct work_ container_of(to_delayed_work(work), struct hdmi_spec_per_pin, work); struct hda_codec *codec = per_pin->codec; struct hdmi_spec *spec = codec->spec; + struct hda_jack_tbl *jack; + + jack = snd_hda_jack_tbl_get(codec, per_pin->pin_nid); + if (jack) + jack->jack_dirty = 1; if (per_pin->repoll_count++ > 6) per_pin->repoll_count = 0;