Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6741115rwi; Mon, 24 Oct 2022 05:39:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM53SkAIrTPQ0Cv0CKyEV9Bcl6Ofoy3Lk+Hijt01dQKJ+Yn3kLeWsyVLdPgvXmYd+p45Bx7v X-Received: by 2002:a17:907:3188:b0:741:4bf7:ec1a with SMTP id xe8-20020a170907318800b007414bf7ec1amr27857244ejb.448.1666615152743; Mon, 24 Oct 2022 05:39:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666615152; cv=none; d=google.com; s=arc-20160816; b=WiHq4QzoW5Zdg0TAdkQftqV4Y3fMe5zyluI2tt/PqE4xEmbjHDAX3NC0bjZiMxEnOH EqqIyfSLsiGqXhsmVY4/eM5hrbBRZLqfydwg/EbFJbDuQfuqSsKGjb+LMAmDBnYV5fll h3+VUPIAfnI515TNDwrigmaQRvz9klUCNQ94+ny93DkE8QOAnHqQxzrC+aHUUeMrPpaW D2XdnAbhOllxAxKzrOTFg6srr3KZdFts3g29qsQG6UOievG2Qp0Qgm0Aycza5tyfhE25 VCaJJMz7+unSw3CQHlzBc+QCZLNsWVEngAKu7QmyZOjcqcudrtEj8F5SEe38yf1TTX0e cRpg== 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=uoS/6oczMVGHQdwNJ7amyCw34AmpXyZ+8lSmHv88iKA=; b=Di9gYLTTOYa6kS9XZEHpLNpBJArbr0D9YJ5Q+p23flNJyz4y002M+ocT+kUw9Rqe/b +Pbubdv9QlDFAcAO/8PI7u36xh6+IcfE3MyEdbXY0tCvXO8v1e30bBmGQIXv/JJzey7c +TMwuSYi5YI/5po8R+WS4uAtCzHg5BvhIPilAGVrEw1sUZHwWc+jbXJTgxtJZtHbVCTl xnfllVJhXHMEk8SG/LWfPWqFAmSZnZTu3uxVz//uONSsBzWzwbwKyWdU4ioglcnETMkE 6S7n4VOZOgaeNT1xSitQfY6Wsg62FXHlIpsaSoFVa8Pl6lH1RawHXoxvVtjdKSwZpYU9 Bc7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GGwfbzzB; 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 v22-20020a056402349600b0045cea9cf231si32101486edc.566.2022.10.24.05.38.47; Mon, 24 Oct 2022 05:39:12 -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=GGwfbzzB; 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 S232537AbiJXMCg (ORCPT + 99 others); Mon, 24 Oct 2022 08:02:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232679AbiJXL7f (ORCPT ); Mon, 24 Oct 2022 07:59:35 -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 8C4D3760DD; Mon, 24 Oct 2022 04:48:41 -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 F27CF61254; Mon, 24 Oct 2022 11:45:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11C62C433D6; Mon, 24 Oct 2022 11:45:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666611946; bh=0r9yXMGtHSXuCCuQ4goaoaQXrHdS/+jB9HWLemhsNQo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GGwfbzzB0TYTNBqzWyEEV5t3EzbDhPhr321M/yIUDYd3Sf70uEef8f3nq3TyIDl8w XpfS7bzDClVwN0R6hzD57fdUnodeozWHaNYm5QjWNKLL90HjJwV85TvdEMsqczSrWn uCrWZ/vlhiWTsNplpEI+ZMkEossAAJ6uWnlWKygw= 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 4.14 012/210] Revert "drm: bridge: analogix/dp: add panel prepare/unprepare in suspend/resume time" Date: Mon, 24 Oct 2022 13:28:49 +0200 Message-Id: <20221024112957.299670862@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112956.797777597@linuxfoundation.org> References: <20221024112956.797777597@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: 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 5855f17caf16..3a462240198a 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -1473,12 +1473,6 @@ int analogix_dp_suspend(struct device *dev) struct analogix_dp_device *dp = dev_get_drvdata(dev); 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); @@ -1494,13 +1488,6 @@ int analogix_dp_resume(struct device *dev) 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