Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2490776rwb; Mon, 3 Oct 2022 01:12:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4hHVGgl3yGWYn7FLu2QyYK4tU+Wp+5jGyIrtt9Xm8DZzFfREUVe8GuuCTuzPmRdjIZ+Fz1 X-Received: by 2002:a62:648e:0:b0:561:6983:4c62 with SMTP id y136-20020a62648e000000b0056169834c62mr4144910pfb.24.1664784735597; Mon, 03 Oct 2022 01:12:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664784735; cv=none; d=google.com; s=arc-20160816; b=s8eIJtyFBM9+eyaBumda8Sm4uOPvZ3ID3NTfYO0Db5aBrkgoXEM5Lb4gHwZlC8ARPT 1zYMFj+Glm5HXFKo8hjWrxlOcQx5+rB7H2a++aldCTkHPJv+yUGr8jjDnUok+giy1hrr Z7KofCf0RkQ3j9za3aLWgE8M8++iv8UHHcG5n4VQWLNxWwSoC2OEIkHUt1Fukb7+h5Q+ 6Ktu+G64Yj/DhlV/C9sr+dJA7cD1QmVZTd1kQwJYQ6ILIXF0lmBwcX55MDt9b1DE4IZJ eMtNajYbYLKJIExLJBA4jHvKSD5VbCf7s70B68eeT9ZMAVcCLCEoNcjV58EIYTZXLrm2 YfDg== 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=sT9SmPrppbwb47vtOWHDxldVGT+p6kyuJZlrgRKOvOA=; b=xkIKEkRwDY7THdAH0ZPm2FJfkyIx858UKL0d2JtDXO1Gj4AGWYfqHAT5HhnVl94cU/ abepU7VdCnVbgwl4kxsNBOT6gJkz7HhUNS3uWyNa3iziEbYRaMNVVz7Idt/pZXSDni/P Qzeethnf2s6iAc0MdLSCBGjSTuofzYloa6iDdkiBdGKYMW5bmKzL5BBtp8gfdedlO0fQ wnuLML3vq8kySs5mChbEFzw6O8pOgDwTzBjrezwNa2HoLsjxGbl4o5d5UhSZ38tZvtNP e3onYEt9n6spr/8/cmDrl3pCVbxJFaXQMNOs54U9AJIT8cB6wmuYo/hTx6vPxGxGQAzX n7cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="tqU0i+r/"; 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 m17-20020a635811000000b0043969d624dcsi9168289pgb.675.2022.10.03.01.12.04; Mon, 03 Oct 2022 01:12:15 -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="tqU0i+r/"; 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 S231887AbiJCHkP (ORCPT + 99 others); Mon, 3 Oct 2022 03:40:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231994AbiJCHis (ORCPT ); Mon, 3 Oct 2022 03:38:48 -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 5BFD95465E; Mon, 3 Oct 2022 00:23:48 -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 E6B5660FAA; Mon, 3 Oct 2022 07:21:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2D27C433D7; Mon, 3 Oct 2022 07:21:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664781718; bh=NrqS59QxcFFbjdlZSFp4aFivbygjdCCj3EejTGW7nmM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tqU0i+r/aI5QUaHW0aRfoNeaW4eTXfkdKSWQ5Wa0xgosZ1nMRfrwKgDeM+i0J0biI F+gKyyTGjQEjDfmmFQRXW6OPfroZTyUbeCZIcXLkrRoAd1qenpxUk8g1RkkeGCwV2r m5tBOA+2QrcBtjhiQ4fp2xn0zqRtrrM6+x9QQaQQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Brian Norris , Douglas Anderson , Sasha Levin Subject: [PATCH 5.10 39/52] Revert "drm: bridge: analogix/dp: add panel prepare/unprepare in suspend/resume time" Date: Mon, 3 Oct 2022 09:11:46 +0200 Message-Id: <20221003070719.899055122@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221003070718.687440096@linuxfoundation.org> References: <20221003070718.687440096@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 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: Brian Norris [ Upstream commit cc62d98bd56d45de4531844ca23913a15136c05b ] This reverts commit 211f276ed3d96e964d2d1106a198c7f4a4b3f4c0. For quite some time, core DRM helpers already ensure that any relevant connectors/CRTCs/etc. are disabled, as well as their associated components (e.g., bridges) when suspending the system. Thus, analogix_dp_bridge_{enable,disable}() already get called, which in turn call drm_panel_{prepare,unprepare}(). This makes these drm_panel_*() calls redundant. Besides redundancy, there are a few problems with this handling: (1) drm_panel_{prepare,unprepare}() are *not* reference-counted APIs and are not in general designed to be handled by multiple callers -- although some panel drivers have a coarse 'prepared' flag that mitigates some damage, at least. So at a minimum this is redundant and confusing, but in some cases, this could be actively harmful. (2) The error-handling is a bit non-standard. We ignored errors in suspend(), but handled errors in resume(). And recently, people noticed that the clk handling is unbalanced in error paths, and getting *that* right is not actually trivial, given the current way errors are mostly ignored. (3) In the particular way analogix_dp_{suspend,resume}() get used (e.g., in rockchip_dp_*(), as a late/early callback), we don't necessarily have a proper PM relationship between the DP/bridge device and the panel device. So while the DP bridge gets resumed, the panel's parent device (e.g., platform_device) may still be suspended, and so any prepare() calls may fail. So remove the superfluous, possibly-harmful suspend()/resume() handling of panel state. Fixes: 211f276ed3d9 ("drm: bridge: analogix/dp: add panel prepare/unprepare in suspend/resume time") Link: https://lore.kernel.org/all/Yv2CPBD3Picg%2FgVe@google.com/ Signed-off-by: Brian Norris Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220822180729.1.I8ac5abe3a4c1c6fd5c061686c6e883c22f69022c@changeid Signed-off-by: Sasha Levin --- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index a7bcb429c02b..e8baa07450b7 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -1865,12 +1865,6 @@ EXPORT_SYMBOL_GPL(analogix_dp_remove); int analogix_dp_suspend(struct analogix_dp_device *dp) { clk_disable_unprepare(dp->clock); - - if (dp->plat_data->panel) { - if (drm_panel_unprepare(dp->plat_data->panel)) - DRM_ERROR("failed to turnoff the panel\n"); - } - return 0; } EXPORT_SYMBOL_GPL(analogix_dp_suspend); @@ -1885,13 +1879,6 @@ int analogix_dp_resume(struct analogix_dp_device *dp) return ret; } - if (dp->plat_data->panel) { - if (drm_panel_prepare(dp->plat_data->panel)) { - DRM_ERROR("failed to setup the panel\n"); - return -EBUSY; - } - } - return 0; } EXPORT_SYMBOL_GPL(analogix_dp_resume); -- 2.35.1