From patchwork Sat Oct 22 07:28:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7629 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1107509wrr; Sat, 22 Oct 2022 01:41:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4kBJ2NSvFw4EwUqZAnd/JHRnbB+S2xbLBdVmQVYImHWRlGQ7reGndayJqQMsDCQpsozK2n X-Received: by 2002:a17:907:60c8:b0:78d:bc56:8f04 with SMTP id hv8-20020a17090760c800b0078dbc568f04mr18460099ejc.560.1666428067901; Sat, 22 Oct 2022 01:41:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666428067; cv=none; d=google.com; s=arc-20160816; b=Y5cS3+sDZ9INoBglraUkGmilH8jrYPMWmXcpH5LzcLE0JUBkiQ3riSxUycOAzyiD7C H3yHITjYswfLmEa4NaY2QOnFs5pS9EUUmlfMQa1GhXNh5bH5hhDIXWdlQS1qVmJvBlBS qPFIflPmnTW6i6eNmLCNQeAFFNLUyUffnxk3D2L7iL+06/Li9eSGbDaxe8szGang4kPp Le2i+LJQe2BqLLZb/G/oIxZ3BjHRvjxeuVVHAw5B9jduv2yBhM7+hJd0cQs9LzqkfUI8 UwfvpIB+XsXWHjKmYQKMUNJJslty+mvvheSAEwtrC0dI3GEWPIi7oasMsDgu+bX0X9DX MpJg== 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=tc4OpjiKKYKziA7rO/RxrZ1lxajFcVj97yyhbHKtXlU=; b=Bj6pdWuJcZbdzdqUGjbAQItZEWWdEo+U77QGyj6tAgEqg3/xCEGiF8MulZjaM0n9oE 937LC2T18k0MTpU9kblVA4+35cLHgDP87hiS18R6xuKs5+miiwhrjwMTj0xbUoz2NCnB tte7NIMtLoBi0S+KwLirHpMmVK9Xpyk/cM9VBjd227/L2zehbVIoJIeVCebGpSDIF4L6 w5aCbQ3NTKXFywmrQMl3QYX0Hda5wq7mPseODBvWTkenYItsod7pVqO5XWsELrNXv/mO bb/d2WXxb2tfqGE2avwYvfvD0mLmog5/QcmP0yB4ULtEbdguaqB9QFyERhIPS+RuNv/r Ul9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="U+/IR8lh"; 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 st11-20020a170907c08b00b007948b932e6bsi6271660ejc.227.2022.10.22.01.40.38; Sat, 22 Oct 2022 01:41:07 -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="U+/IR8lh"; 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 S234254AbiJVIgy (ORCPT + 99 others); Sat, 22 Oct 2022 04:36:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234491AbiJVIbB (ORCPT ); Sat, 22 Oct 2022 04:31:01 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 479A82E5E01; Sat, 22 Oct 2022 01:03:13 -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 ams.source.kernel.org (Postfix) with ESMTPS id CFCB7B82E11; Sat, 22 Oct 2022 08:02:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25274C433C1; Sat, 22 Oct 2022 08:02:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425755; bh=VmgxIigWdW5PxGDKM9INkjR8myLbENkFTD+P5Yn5K18=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U+/IR8lhQnei74q2ymeGbbD5XG66adln3hzYkIxYsWVn1Zy4ugiqfflFUhFAdYkNf ES947x95WKEGEyC0q54U3dZbSblangqXEFKIeQ+R+J+nf5qX+Bi62AV+5MeqPF3y4z R6v8ykDupPHqDHbyll9M04ERm/34EWb3gEP434kI= 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.19 606/717] drm: bridge: dw_hdmi: only trigger hotplug event on link change Date: Sat, 22 Oct 2022 09:28:05 +0200 Message-Id: <20221022072525.269053960@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747376478082399708?= X-GMAIL-MSGID: =?utf-8?q?1747376478082399708?= 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 3e1be9894ed1..0552e9a3c838 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -3095,6 +3095,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); @@ -3133,13 +3134,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");