Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp8461ybm; Mon, 20 May 2019 10:55:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1iaN4UJVOzqF7/PZ2dLWfjBuFeHbyTAs72JcHdI+WJCaMQeiLpn7+xB8viHNJKhW2aDdM X-Received: by 2002:a63:1854:: with SMTP id 20mr74548819pgy.366.1558374933830; Mon, 20 May 2019 10:55:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558374933; cv=none; d=google.com; s=arc-20160816; b=XiqEwXkaanmT0De7+Kb1jHZQ3YSd4YaNSQU41G+sEzQ+lgl61irL5G1eiFlyzNCzdz h5x+k7MZHVfUskWwSJFTVUgPaqSzRp6/1AA8I5GVfNBv8P18o8serHi4xgHXkV3ZsAKC +KC0XBJou9RQSUrDhsZxLZD5bXf3DkTyPdiKxvZqKK1bK1qFVgE/xaW7oRsfHcOK5LdX hPnbHNMYxefJ7lwqIyzGEtX5aSU9P6yNTu9E6GMoM1Ql21tcl+U2mtcJVcfpliYqj1vv Nle9honvS66z41uDGzGp79fiNgBl5awy3B3Ewn0tgeNRinutt0fN7WaZwJPdbXH87/jz YzTA== 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=3k/IgApLiUrOsue3lIx/ncv4XuDgjhpaD6OI+l2umRQ=; b=txK+ctIlY1i3BtjQziGHSvRTpxOf16c6eUJ0eNb0e8/jH+QdWQuTXTwQr01ua2qOoN xGGu0Bwqm+2Uq2Hc2czaG1iWVK4tE4snPFZVjz7OAm8RQ3iTE8Yhmn2PZrgH2/qOMihn ZGY5bb59KPTgvawf+y/aGs/DInMWxU6LCK7gwDYltpwm1x3ezp3Es2OskKsvoxOUumSU kXdQrR+ddMmAZ1ZQM4yKVSDA0ptmLeHF2WJP2GJWfUdt2GDBtp4l0wYDonIDrhjyuZbD JtPar8K/ptGpqc6T+5+0mBQpnc3QS+sHWHeUAci5n09IHqD7TiPiA8QTijCAOPNrvwhX 4k8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="psO/UzQe"; 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 m191si4324844pga.17.2019.05.20.10.55.18; Mon, 20 May 2019 10:55:33 -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="psO/UzQe"; 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 S2391383AbfETMkH (ORCPT + 99 others); Mon, 20 May 2019 08:40:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:50160 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390653AbfETMdH (ORCPT ); Mon, 20 May 2019 08:33:07 -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 388FB204FD; Mon, 20 May 2019 12:33:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558355586; bh=Zj0sigm9uLM+pqL/O9ZT4QLHWYsxYUJ+aO89sZtK7+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=psO/UzQeMrVwOumST7HZUojh3Pc4+av0OPdHkmHcCU99SnP8bzOVtY4YpI2aildau su1zP2+uPBEDh/5VlQ6+5sVAgjxQEjLnX8UEElzq5R4g45+2CJ3PCFO+JlpR0intX8 sx21dnQAGXWe7wOXk8ob9WR37IadCT7TQC+IYY/g= 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.1 050/128] ALSA: hda/hdmi - Read the pin sense from register when repolling Date: Mon, 20 May 2019 14:13:57 +0200 Message-Id: <20190520115253.152190923@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190520115249.449077487@linuxfoundation.org> References: <20190520115249.449077487@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 @@ -1663,6 +1663,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;