Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7317192rwi; Mon, 24 Oct 2022 12:52:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM71EOonNf6X9OPiNYZZROwgZGInVe6ArqzRo1T0tFSNdP6YsMB8ji1WeLsATW93TNl39UQs X-Received: by 2002:aa7:d80b:0:b0:45f:b9ed:6e3c with SMTP id v11-20020aa7d80b000000b0045fb9ed6e3cmr24393937edq.22.1666641138518; Mon, 24 Oct 2022 12:52:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666641138; cv=none; d=google.com; s=arc-20160816; b=jpX0yh0tN38BEwzmNmr/j99tqVAvqJs0/LhV3CPoux9oy09q+e7vJWeE8Ljk3WK2C2 mPADS/z4H7IVXDzOQH7j+WnmjXYBq1miCxIoQFV2jk8Vq+rILunlFT3TVMZpDsJnEOBQ /mOqwvypxYwjrnUqdddG2k+z4sO19SHL7PSHK3/s4h10ykf7WfS9mFkrW7ixIzKq/xQ4 fcVza1bH3xRBN4cmUL7T6JYOHHunSYy3bF5V5mxQ3k2Vt4V5HemRUGyKsIlnWC9qU58b fm5+UZYksiA29P/d40ugq7FxWcbXiJlV/SHY8cLkOcJWa3NgNEC+Ny3vzqVpvkXaHL5w 9g2g== 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=399hTR0jyJ9lYOlr1fDGh56cU8wkPyD1rbNjFXEDPwU=; b=KUvwsTFniGVeScwqrEdk2Tvjk7B3ME5E9dUpEZZjmTUL2Dm0jjdSvpUufoh3GcjqHj sSTp5HjDEUfsxo0sKtq2imYNpwAgH4iOcBiWnIviUjbb2dU6+kwGdi95kZdm82HF0u2+ E05N9yiE5zac0SgVOPx0zvnjZsS3hF6BktWhAB7p4n4ThrSdVZD1jBFV5qMkNW+nEEax I+eL0cIuP4qEEW/OyqpYIcfy+/BZPWoK+AR4mugNyALAZ+njwtG7CzSqiUpHy6jClyin obnJiC/JlONfjkQFmkT2dU+QcQ7LWOuZYm4AXJU0AaeScH5E4mQxZ8Dy8rdB8qQtxXF+ qMSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Rpb0Ffje; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c13-20020a50d64d000000b0046184b7c4besi469699edj.462.2022.10.24.12.51.53; Mon, 24 Oct 2022 12:52:18 -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=Rpb0Ffje; 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 S233242AbiJXTpp (ORCPT + 99 others); Mon, 24 Oct 2022 15:45:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232109AbiJXTnN (ORCPT ); Mon, 24 Oct 2022 15:43:13 -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 3BABD100BF5; Mon, 24 Oct 2022 11:11:57 -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 296BAB818B4; Mon, 24 Oct 2022 12:52:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87CD4C433D6; Mon, 24 Oct 2022 12:52:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666615965; bh=RY3cfM/ftCZjdDWwiDv/6mYDrpRONkhu8X8mieWXehg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rpb0FfjendPoUFkvM/UpIzMCt3zg84XT9OGnRsfNS6kIRfnOQYiz5VbwJVBVnseBZ 0sDxruloxRRTTuLlDmrCA8BlsxA5LHNPbueQVYnkxt1RetNbocy4h+uhtjjmcHBxTi TrVj45VE5MsWysx2z/77UKLcJddK1EvX0/P+bFRs= 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.15 450/530] drm: bridge: dw_hdmi: only trigger hotplug event on link change Date: Mon, 24 Oct 2022 13:33:14 +0200 Message-Id: <20221024113105.419943323@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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 25d58dcfc87e..d3129a3e6ab7 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -2970,6 +2970,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); @@ -3008,13 +3009,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"); -- 2.35.1