Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp82758yba; Mon, 20 May 2019 05:24:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqw64+h4N9TBC2ixFYQGvIJaeOFx+W+ohdbPWtUZ0P5ostoPzRQMtPz6Tb3QDyHkM2mn84g7 X-Received: by 2002:a17:902:6b44:: with SMTP id g4mr75290993plt.157.1558355057318; Mon, 20 May 2019 05:24:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558355057; cv=none; d=google.com; s=arc-20160816; b=ULJahfcCWmvKe1FNAlPD+u8aDSer+sNuWtdfM1/Mor3rI2Mp2Uv9ybqo3wbYwkHEmk 9Ixkc4E7oZ4EWq1djHVgVOGOAEaWOCcjQ+wGnf/YFJv+zLOTRiofwaZdYM/Q7jaaGoVf Tp/upoRbP+9nMkQpZZdhJCin5dUb+HRxD1mJo9kx4ixA5rgsBlJeLFtIcEp5A2NI/VXc 1FJKYu0T35tdDl8XQNfQEfZZtetfmMCfmV/rks8hlQTl9RmGDuHj1/FQFVRFK2VOihR8 DdkLeg1soI5FXhmn0B/SEJ+eJbjQ/9Ah/H8RxtNawQL6fqaUN9Url+8Wl5Wg7jntkqb+ Kakw== 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=zT+Ux2uVJQTbBXXRP+lcpn+XvAJoKAAJWyY3Hfat4Ks=; b=ufbG8YRMueA0py0qp40ii4VKZYotvgmz91eLriWy1nM2QeE5/GyIQJ2eHvVcQGI74q w2/4ZeWWLvprqnNg/Q5uTouO8zwiTWn8FwbIaofoZfBveIfJYnLs73qAQZJfeKrY3vsg IjULusY4N0kC4TYbJWPUNPJCJvubHpTgGK83CbrDJhNDNU926VEejAY8C2nzhPl8o82C V4GtLOjBffscNE7rIEkukm66t2DwuMbUQML8geRPHD7YvmTW1HYcqlkVuuPPf2fbOEhq Pk+5ZOA5At2SWcwvfJBRJzYsq4IFLjnrmLntaDKAmm73arF+EaRAzWZlz6l6UhTDYBVq s0Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YEsK5atO; 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 h5si18880217pgg.526.2019.05.20.05.24.02; Mon, 20 May 2019 05:24:17 -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=YEsK5atO; 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 S2388396AbfETMWY (ORCPT + 99 others); Mon, 20 May 2019 08:22:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:36330 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387666AbfETMWV (ORCPT ); Mon, 20 May 2019 08:22:21 -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 33F5B21019; Mon, 20 May 2019 12:22:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558354940; bh=6ZPD1QSHdzGTzkY0bnB7RTClmvWPiJlvDHS9dNTMtq0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YEsK5atORVi2EVcyaZnY4biDAHSlPQTXHHMVPJYd1p76DIdykShCirIPCCqbwpGma 5cnG5WN/vJz7OjCeULwBzkpMpzZtPt1SVRLOFsWmE+eKvJ13K4WucMVyRtkQha2FzZ sM8ChHhbTe3eFFhQ5+73wd3NgVZpOiXJPTHoVn5E= 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.19 035/105] ALSA: hda/hdmi - Read the pin sense from register when repolling Date: Mon, 20 May 2019 14:13:41 +0200 Message-Id: <20190520115249.464956414@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190520115247.060821231@linuxfoundation.org> References: <20190520115247.060821231@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 @@ -1660,6 +1660,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;