From patchwork Sun Sep 8 13:28:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 13795468 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A238FCD4F4C for ; Sun, 8 Sep 2024 13:29:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dd2GBBNI1cFsLmVCHViLjbHqrCLHBjNsVqfE6t9rmlY=; b=rnPIojXdXWg0SP gh9CG1ViDsL8JDq9V1zTdtM4KjU1v3LiltXHsfli9DK12q8LGZMK6eiiYjrhzA/2/kgQVZYgDg6Rv /ARZTvZ8SdS61rq5gj2byATQ6hIA7B0e9cqrzJEW4LnI8QB0MQZ6AyOiHEbAWgnlsA4/zEEoQpZvA ClW2xdv8NnKblznyAJX9DCbw97cQAXY35FvRQgGbAFVSyDXzRW3B8WhA6hOzD14acBXVXvW68qJYs mu78DBnjv5AyzEinsnRp3Z/pmRbZ5PPPEL31FEHgfGzB7i9PZlL7vdGLkZLiHgox6INFTdMk9KXCM jFuzoCnqJo5vmG1NXB4g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1snHyn-0000000GqDF-3fVp; Sun, 08 Sep 2024 13:29:25 +0000 Received: from smtp.forwardemail.net ([149.28.215.223]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1snHyj-0000000Gq9U-3pHi for linux-rockchip@lists.infradead.org; Sun, 08 Sep 2024 13:29:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Cc: To: From; q=dns/txt; s=fe-e1b5cab7be; t=1725802145; bh=bw7hUA9+T9ojuBGzAwclXIncQiP3YNb92ShoyGh/flo=; b=irIJXzKjfxQDHQuGOAJzKUxX4mvjCB4XMUrvWnyX9XcNVS0WkpkPBwmf4okaWaixE6WIcKRzQ YqgkSQBE/yZrD5XcgwidI1wV2I8ZRndbkzgsW92FzCfUqf4NWU0SLve6yaF/bAVSGO83SDjAKsM EUyBayPFiykG3+5NBN5NGz7q0+JTVHkeiX4FF6qvh+nEnLF670zgk2nhuJA1pxnosZi6TMRw48u t89YR5ikSMgw6rLnRq/AjR37QCLvMVmGC5KAMeFQHif4kF60Eq7AYbUWJbfxmKK0ENFwLDmCMB/ vwjGHB7aiXCv7qC2t030xXkw+AcEir6354uHB2habKtQ== From: Jonas Karlman To: Andrzej Hajda , Neil Armstrong , Robert Foss , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Laurent Pinchart , Jonas Karlman , Jernej Skrabec Cc: Christian Hewitt , Diederik de Haas , Christopher Obbard , dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 07/10] drm: bridge: dw_hdmi: Invalidate CEC phys addr from connector detect Date: Sun, 8 Sep 2024 13:28:09 +0000 Message-ID: <20240908132823.3308029-8-jonas@kwiboo.se> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240908132823.3308029-1-jonas@kwiboo.se> References: <20240908132823.3308029-1-jonas@kwiboo.se> MIME-Version: 1.0 X-Report-Abuse-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net X-Complaints-To: abuse@forwardemail.net X-ForwardEmail-Version: 0.4.40 X-ForwardEmail-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 149.28.215.223 X-ForwardEmail-ID: 66dda69d3c9877b45958797c X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240908_062922_028592_262CD5A0 X-CRM114-Status: GOOD ( 11.05 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Wait until the connector detect ops is called to invalidate CEC phys addr instead of doing it directly from the irq handler. Reviewed-by: Neil Armstrong Signed-off-by: Jonas Karlman --- v2: Collect r-b tag --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 6a94376a3da3..8ec97babd334 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -2454,7 +2454,17 @@ dw_hdmi_connector_detect(struct drm_connector *connector, bool force) { struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi, connector); - return dw_hdmi_detect(hdmi); + enum drm_connector_status status; + + status = dw_hdmi_detect(hdmi); + + if (status == connector_status_disconnected) { + mutex_lock(&hdmi->cec_notifier_mutex); + cec_notifier_phys_addr_invalidate(hdmi->cec_notifier); + mutex_unlock(&hdmi->cec_notifier_mutex); + } + + return status; } static int dw_hdmi_connector_get_modes(struct drm_connector *connector) @@ -3065,12 +3075,6 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id) phy_stat & HDMI_PHY_HPD, phy_stat & HDMI_PHY_RX_SENSE); - if ((phy_stat & (HDMI_PHY_RX_SENSE | HDMI_PHY_HPD)) == 0) { - mutex_lock(&hdmi->cec_notifier_mutex); - cec_notifier_phys_addr_invalidate(hdmi->cec_notifier); - mutex_unlock(&hdmi->cec_notifier_mutex); - } - if ((intr_stat & HDMI_IH_PHY_STAT0_HPD) && (phy_stat & HDMI_PHY_HPD)) status = connector_status_connected;