From patchwork Mon Oct 24 11:32:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9190 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp458630wru; Mon, 24 Oct 2022 06:37:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4lHR2X0sVPg0r8q/6Quoh+e3uOqPedJ7naTxJGG7ZIDTYeBdWlnh1uX8PPk09SUIDeEEH1 X-Received: by 2002:a05:6402:5162:b0:457:6ef2:df3 with SMTP id d2-20020a056402516200b004576ef20df3mr30697069ede.128.1666618675307; Mon, 24 Oct 2022 06:37:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666618675; cv=none; d=google.com; s=arc-20160816; b=g8hlG1IlKzmmSTAWLdq1EPk4WlCs5S82f/3i4HpQsJIQdhH9vaEW5Dri6rNl40vfwF c1tr5lU8f9plpvoqnGHCNgZkPvJs4bNyN2hbZTd6xmB9k7p03rNPjLQk+Ge05S6xrZ3h KLmWsFf/qe069udY8KmFhRsc1VwFhZQQVGoXkRjrXtXBtT4QHcLJY7Z66nuEkYil4mUb zzmmA+s8OwpvGLrtTk+Wrouz7ykd3r5VSPDfg8w7m7eDyWbVyOW/PBaAVBRHAcelbdGA F3WvZmZYCb+ZWobpEx9+fg3y2yE7RIImKC1NE7wlS9v2URH/4OVLDlukZf9htQ7IKYs5 XzkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SpoZtMMqYs35YJ5JcRhVRVmgMoTfCpxTSrBK1sSyq50=; b=AuTzVMXniDChAEjW9IbHHlMcyEHDhM2NFdpi/SQ7M7vWGyaoUIoUf0HVQ6Dw2NGkgA HRv1QZA/jVzO0S0HPEWu48E3zrp/2d+z9r3S+NfL7mF3R6MddV+mXbXpGIEksv7kq4cc N3oMy9SUE/ZrmCyceRF8L+bK2TJx6ET79eGK9D1cmEsiEn8GYYnp/+PXH41iHZebisjz B1YGfgqyLhIzqJnMXBx6QM5HECkradCvWUpNbyJdD8YbNfccnFV/HIJ/rOZ2gr1ZpORD tks2llb6OxhOWRZmZdtQDo79m388vrGPTe+meaImcpa+X2hiLrV5GE8jAhettvZ25hZ4 6cVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Cmo8sF30; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b26-20020a1709062b5a00b0078cbe9d08c6si22201628ejg.197.2022.10.24.06.37.13; Mon, 24 Oct 2022 06:37:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Cmo8sF30; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233731AbiJXN11 (ORCPT + 99 others); Mon, 24 Oct 2022 09:27:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236258AbiJXNYw (ORCPT ); Mon, 24 Oct 2022 09:24:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6270C1B79F; Mon, 24 Oct 2022 05:31:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6BB09612CF; Mon, 24 Oct 2022 12:30:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7AAA6C433D6; Mon, 24 Oct 2022 12:30:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614620; bh=t5hmdcnuv44cMjaNtCCxpqakrK7D417F3SSIMY/c0Z4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cmo8sF30d3KocjFR4UGSo52Pa4BiQ3R0DiZi59++aH4/u3piEwQr3N2dK+HlQVCB4 EeEgy/UcfDeinsiT2sObcplNes8npHKI1jZTJD3/uM3/+ZKGxw7NYxNwuTHz19Q5QM +ydgS3B9LdfyiACyyi9dmvLTx43RuyfrcPRbkBJw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lucas Stach , Robert Foss , Sasha Levin , Neil Armstrong Subject: [PATCH 5.10 331/390] drm: bridge: dw_hdmi: only trigger hotplug event on link change Date: Mon, 24 Oct 2022 13:32:08 +0200 Message-Id: <20221024113037.096221850@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747576344494046045?= X-GMAIL-MSGID: =?utf-8?q?1747576344494046045?= From: Lucas Stach [ Upstream commit da09daf881082266e4075657fac53c7966de8e4d ] There are two events that signal a real change of the link state: HPD going high means the sink is newly connected or wants the source to re-read the EDID, RX sense going low is a indication that the link has been disconnected. Ignore the other two events that also trigger interrupts, but don't need immediate attention: HPD going low does not necessarily mean the link has been lost and should not trigger a immediate read of the status. RX sense going high also does not require a detect cycle, as HPD going high is the right point in time to read the EDID. Signed-off-by: Lucas Stach Reviewed-by: Neil Armstrong (v1) Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220826185733.3213248-1-l.stach@pengutronix.de Signed-off-by: Sasha Levin --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index b10228b9e3a9..356c7d0bd035 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -2984,6 +2984,7 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id) { struct dw_hdmi *hdmi = dev_id; u8 intr_stat, phy_int_pol, phy_pol_mask, phy_stat; + enum drm_connector_status status = connector_status_unknown; intr_stat = hdmi_readb(hdmi, HDMI_IH_PHY_STAT0); phy_int_pol = hdmi_readb(hdmi, HDMI_PHY_POL0); @@ -3022,13 +3023,15 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id) cec_notifier_phys_addr_invalidate(hdmi->cec_notifier); mutex_unlock(&hdmi->cec_notifier_mutex); } - } - if (intr_stat & HDMI_IH_PHY_STAT0_HPD) { - enum drm_connector_status status = phy_int_pol & HDMI_PHY_HPD - ? connector_status_connected - : connector_status_disconnected; + if (phy_stat & HDMI_PHY_HPD) + status = connector_status_connected; + + if (!(phy_stat & (HDMI_PHY_HPD | HDMI_PHY_RX_SENSE))) + status = connector_status_disconnected; + } + if (status != connector_status_unknown) { dev_dbg(hdmi->dev, "EVENT=%s\n", status == connector_status_connected ? "plugin" : "plugout");