Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp2328769rwb; Fri, 20 Jan 2023 01:11:25 -0800 (PST) X-Google-Smtp-Source: AMrXdXslEk7mrjikvopzbG3l5yTmSrGl+yiD9q05qtTIMOurNzBBPfe88BdwMM8blv6f29oo+5op X-Received: by 2002:a17:906:180b:b0:7ac:8e6a:a674 with SMTP id v11-20020a170906180b00b007ac8e6aa674mr12918599eje.2.1674205885193; Fri, 20 Jan 2023 01:11:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674205885; cv=none; d=google.com; s=arc-20160816; b=OKJGICT5EJCgunduWiw+n+YFKFPra0U03iAWhu7+LNNPeNp8TK+s6AwWAEfPTeY7X5 le3paWlNBSflG7nP7yvWeC5JOeoRMnhZSeteyOu6X4JriAWxP00jMcu6R4dpVXcEwqan jMeg3//vRxf40MgjCHMrbMMupzpb2i+e20zXeqCs1ZhYuaLYrvAu8t73dTn7rSpovgh8 bJyJ+gdd8uy6l32hsgXM5YvRKNNrVg1LoBKrO3NB21NjCcU+Tx2ycZaZTqHckC60Okd6 Bgls41gTgu7DbYbfLUP456ofxOOyUe3j3tx1rfzAlVvjOtUlzkfMSHBSfIjI5QXNHjWf 8dpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=mQwFnoK7d7aoRbzy17fXPy5cxQpjfICl1JQ3/3doatw=; b=mkEEfBc97LnGk67pCmfu1S8vm3R2xY8J2VbwqjyzIjfbLy5lXdv35RXn6UcKLjNiu2 hg3unJd8Bs0HJr03pUDIiAQf/1dZlapOSkgDpbxUdoI17EvAo7pZb1CCT7hMxowhw5+q 1qAvc8BGB6NJcHmc5MMvA3byaUVnGmgV21oOTDxD/A3/LeAdOeMhwVE+xZNPEljohy8m f3B1fdQYZn2Jn2Nzrc4YY4MgqOEnVoWsp7yiOthH01nRwqFMbzgRcMYxrxa8i+UVs8aB u8qeUUJDLVmxktnCTmIFkGEM8vhFkqbUz2yZEeJqUHy8A3bEoULJ7QQkRdW6WB6WvR27 v/JQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nb6-20020a1709071c8600b008707a48e696si6872910ejc.392.2023.01.20.01.11.12; Fri, 20 Jan 2023 01:11:25 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229780AbjATJEM (ORCPT + 48 others); Fri, 20 Jan 2023 04:04:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229662AbjATJD7 (ORCPT ); Fri, 20 Jan 2023 04:03:59 -0500 Received: from hi1smtp01.de.adit-jv.com (smtp1.de.adit-jv.com [93.241.18.167]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1BC5EF84 for ; Fri, 20 Jan 2023 01:03:58 -0800 (PST) Received: from hi2exch02.adit-jv.com (hi2exch02.adit-jv.com [10.72.92.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by hi1smtp01.de.adit-jv.com (Postfix) with ESMTPS id D74EB520251; Fri, 20 Jan 2023 10:03:56 +0100 (CET) Received: from vmlxhi-182 (10.72.94.8) by hi2exch02.adit-jv.com (10.72.92.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.17; Fri, 20 Jan 2023 10:03:56 +0100 Date: Fri, 20 Jan 2023 10:03:48 +0100 From: Michael Rodin To: Maxime Ripard CC: Michael Rodin , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Dave Airlie , Alex Deucher , , , , , Subject: Re: [PATCH] drm: override detected status for connectors which are forced on Message-ID: <20230120090348.GA860002@vmlxhi-182> References: <20221107123657.24vbgep3jqeklb2s@houat> <20221215170359.92422-1-mrodin@de.adit-jv.com> <20221222174054.tsj4rfzejrl3cc7g@penduick> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20221222174054.tsj4rfzejrl3cc7g@penduick> X-Originating-IP: [10.72.94.8] X-ClientProxiedBy: hi2exch02.adit-jv.com (10.72.92.28) To hi2exch02.adit-jv.com (10.72.92.28) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, SPF_HELO_NONE,SPF_NONE 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 Hi Maxime, thank you for your feedback! On Thu, Dec 22, 2022 at 06:40:54PM +0100, Maxime Ripard wrote: > Hi, > > On Thu, Dec 15, 2022 at 06:03:59PM +0100, Michael Rodin wrote: > > The detected status of a connector should be ignored when a connector is > > forced as hinted in the commit d50ba256b5f1 ("drm/kms: start > > adding command line interface using fb."). One negative side effect of > > not ignoring this is observed on the RCar3 SoCs which use the dw-hdmi > > driver. It continues executing drm_helper_hpd_irq_event even if its > > connector is forced to ON. As consequence drm_helper_hpd_irq_event calls > > "detect" so the connector status is updated to "disconnected": > > > > [ 420.201527] [drm:drm_helper_hpd_irq_event] [CONNECTOR:76:HDMI-A-1] status updated from connected to disconnected > > > > This status is corrected by drm_helper_probe_single_connector_modes shortly > > after this because this function checks if a connector is forced: > > > > [ 420.218703] [drm:drm_helper_probe_single_connector_modes] [CONNECTOR:76:HDMI-A-1] status updated from disconnected to connected > > > > To avoid similar issues this commit adapts functions which call "detect" > > so they check additionally if a connector is forced and override the status > > returned by "detect". > > > > Fixes: 816da85a0990 ("drm: handle HPD and polled connectors separately") > > Signed-off-by: Michael Rodin > > As reported here, this breaks vc4, and probably i915: > https://lore.kernel.org/dri-devel/20221107123657.24vbgep3jqeklb2s@houat/ > > Maxime My understanding from [1,2] was that the way to avoid such regressions is to make sure that the "detect" callbacks of connector drivers are always called even if a connector is forced. This is what I have implemented in my second patch where "detect" is called first and then the return value is adjusted based on the "force" status. If my understanding was wrong, I would very much appreciate if you could give me some hints for the implementation of an acceptable solution. Maybe it would be safer to simply avoid calling drm_helper_hpd_irq_event in the dw-hdmi driver when the connector is forced like mentioned by Laurent [3]? Although this would fix this global problem only for one particular driver. [1] https://lore.kernel.org/dri-devel/20221107123657.24vbgep3jqeklb2s@houat/ [2] https://lore.kernel.org/dri-devel/20221107122504.tejlb24bjbaxw5t6@houat/ [3] https://lore.kernel.org/dri-devel/YzYrNJbfGcch1UtX@pendragon.ideasonboard.com/ -- Best Regards, Michael