Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp301051yba; Mon, 20 May 2019 08:58:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPMn0tUGNTUbZ0S+DQMSu4Y8DOx2D1b0bZtXWjW0e/MxTw84l2J1EshmAoI/eOJp9PFLlB X-Received: by 2002:a17:902:63:: with SMTP id 90mr22652880pla.342.1558367908394; Mon, 20 May 2019 08:58:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558367908; cv=none; d=google.com; s=arc-20160816; b=MXiN4ueElOHKzI+mLnJFe4OROcJmFIFFGMon7lic+pezVVz+xhJWYEfwN445Dui/qB m7llvsfqWpmvLR/9hKIj7LYNHVXtpZ00TFRbzFW6Vqr3nxCs1/s9HaQpg1uMtx87BEdb zSyKntzi5iM0i8cbZS6FNPXsyNDTmiFHdWaKbcMs4HbPJn0vzP7cA4SpVQ+IiYLflSwA Jv4ERgNYuU7m6MvNTu4ioNk40/0hSJjBhqH9IjPoudD8Zg+PtgFL21MNT4VIs00pFeYn MdVB8p4lKNUmm5O1rirJ4VGcT23p7czSaU5pnENSYEWKBsHKZcfIa6vQ5qeWCDlYE5IJ JwfA== 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=USrG5G6D4/HfEwEoGrDzCdEA+o+DlNdZM7QD1W15Lh8sU31e6SUF9/2WWsU24EhuoN sVjabbQfo8tCvFN5rSfBjsAjBnZ/79XAJ3t6Hf9HQ1mTy+jj514Uco9ZqURpUfVNi1NU 6l/OO8Gdebr01v5ZBu7MYKi5xXIk+nuF0n9FAMmaIivBHVw/2VyNBTAE2v5wyqW1sYvo W33QMq9Y45Ff55fq35/zBTM9htR1gcm2QnAnwruIpzuUxUDfwEnn7cd+Y3wz8kYA1yVy L7FBfE/mrwGO8qu8zjtOUmW/+uq4I0Z0TeKdj2P8/PDUpLIIn14NWFpA+9NSGaae/TDr kGrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fRdU42HZ; 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 h14si16952146plr.255.2019.05.20.08.58.14; Mon, 20 May 2019 08:58:28 -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=fRdU42HZ; 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 S2389535AbfETM1p (ORCPT + 99 others); Mon, 20 May 2019 08:27:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:43232 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389512AbfETM1i (ORCPT ); Mon, 20 May 2019 08:27:38 -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 9DD2820675; Mon, 20 May 2019 12:27:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558355258; bh=6ZPD1QSHdzGTzkY0bnB7RTClmvWPiJlvDHS9dNTMtq0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fRdU42HZsVivLc8/UnikLyE8kTHPEvOVsnr2MZqXEWtEVpN+Y9KLW4xVS8xtGhU5k 5mMDNECtxA8ZaWcbcCi+p1DYOOsSQL11FTXlekG96a56LX0Mjq7zWyoJSkQJGVu4wD VQN2U9uMOXyrV9MErErjq1pZW6cQTCNQ4Vpf2+88= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hui Wang , Takashi Iwai Subject: [PATCH 5.0 049/123] ALSA: hda/hdmi - Read the pin sense from register when repolling Date: Mon, 20 May 2019 14:13:49 +0200 Message-Id: <20190520115247.991762078@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190520115245.439864225@linuxfoundation.org> References: <20190520115245.439864225@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;