Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2927610rwb; Mon, 15 Aug 2022 14:13:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR5vn2vIu8ZM/FWc3sqcIZ/ox/dq+LnaBbCYA2AgpwA4TVucfTy/qsGf20Ir++Koy0JTJqP6 X-Received: by 2002:a05:6a00:1950:b0:534:ebea:546d with SMTP id s16-20020a056a00195000b00534ebea546dmr5767199pfk.77.1660597985002; Mon, 15 Aug 2022 14:13:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660597984; cv=none; d=google.com; s=arc-20160816; b=rwNrFmMFkPFkH08nFTkJUEPoSCbYuJclFdwyBblx97IVwCIYbwSLbSlnEnnP3idHNY sbK09XayrnzQhKGZfNO87aqjCnJXeL79cRnT8ll1GP3z+g+X/jB1yfH359H5zvBZwaGj igWiEMjofvGLs/Zsy4ytygVgkWZ3/ZDCvg6sjNPGHD7iiXxl8y9x0RgfaEx90yfrMTN7 HU/wr1DOcujGigKA9s0b8RNtMxP7f4SlkGIew1X2N15Oojb0I0wu0zfM/cSfMOCd0lEA pZ1NG++Wkpt/VLhl4NTWNM9MNbGNh5Ai9zwklCzT8LWgAn6BSSnmAS2hN6qxQxyrrp2s JcxA== 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=tq4CuvzjCbdGhFfzXz8mFdU3pEfu1gLhiFfKGfmCS28=; b=g1HIEQelj3hbJA5kVJuPz8nBAN/tWhti0tnM4WoQYgzpP3klJ4vSMTs4ed4XED99CH UYXGx0jcJKmtv9mOg8cjK14EMXUEHxBoy5rM4raafWfK2XO3WvTwQ0cBoq5RWclWzGcq uluH2Oj5+YVOedMh3k0TP9F3P2aEDsbFKRBUIuJbFzKAgmFR3eNukC4JcOqWImLL0ZiT ib42cj2Iny2ObzH5VRuQXbKx7xSjS3OLHoVyIOM7Ee/hhYdWetfzbsYIlt5Nrp/kZbXA t9LPuRApknoLs0wogJV0UEBXlJqzoPZ4bo4NYh1csv7BmLpQ1n6LXfmkbTHwv+xFM53P 86vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ek4WjC9c; 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 z11-20020a170902834b00b001709b95d191si10346401pln.284.2022.08.15.14.12.54; Mon, 15 Aug 2022 14:13:04 -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=Ek4WjC9c; 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 S244358AbiHOSx1 (ORCPT + 99 others); Mon, 15 Aug 2022 14:53:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244136AbiHOSuK (ORCPT ); Mon, 15 Aug 2022 14:50:10 -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 CEDD043E52; Mon, 15 Aug 2022 11:28:51 -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 26D2060F9F; Mon, 15 Aug 2022 18:28:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13A4DC433B5; Mon, 15 Aug 2022 18:28:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660588130; bh=cmDsqLOGQfyeTpTaFLigwTiIwb3RCMp1vGAzPHr5B50=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ek4WjC9cdH4woGVDY8zk2V7P1At/yHgUV7k1KM0VPMHCe/jkCZPvKWbpU1Kw313wR 8DDBeFa3GcTPnMW/TyL1pSxDAbr4MjDGKqHATrVLgA08uRPbY/mEcooAKIc2A64rq/ B3uloLY9HL6V3IGjDOvtWm05dMG2O8aXxGzm64lo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maxime Ripard , Dave Stevenson , Sasha Levin Subject: [PATCH 5.15 305/779] drm/vc4: hdmi: Fix HPD GPIO detection Date: Mon, 15 Aug 2022 19:59:09 +0200 Message-Id: <20220815180350.335774846@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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.1 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,T_SCC_BODY_TEXT_LINE 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: Maxime Ripard [ Upstream commit e32e5723256a99c5324824503572f743377dd0fe ] Prior to commit 6800234ceee0 ("drm/vc4: hdmi: Convert to gpiod"), in the detect hook, if we had an HPD GPIO we would only rely on it and return whatever state it was in. However, that commit changed that by mistake to only consider the case where we have a GPIO and it returns a logical high, and would fall back to the other methods otherwise. Since we can read the EDIDs when the HPD signal is low on some displays, we changed the detection status from disconnected to connected, and we would ignore an HPD pulse. Fixes: 6800234ceee0 ("drm/vc4: hdmi: Convert to gpiod") Signed-off-by: Maxime Ripard Reviewed-by: Dave Stevenson Link: https://lore.kernel.org/r/20211025152903.1088803-3-maxime@cerno.tech Signed-off-by: Sasha Levin --- drivers/gpu/drm/vc4/vc4_hdmi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 1aeb57656112..e4533fe315bf 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -173,9 +173,9 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) WARN_ON(pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev)); - if (vc4_hdmi->hpd_gpio && - gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio)) { - connected = true; + if (vc4_hdmi->hpd_gpio) { + if (gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio)) + connected = true; } else if (drm_probe_ddc(vc4_hdmi->ddc)) { connected = true; } else if (HDMI_READ(HDMI_HOTPLUG) & VC4_HDMI_HOTPLUG_CONNECTED) { -- 2.35.1