From patchwork Fri Aug 2 18:46:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 11074041 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 668FE746 for ; Fri, 2 Aug 2019 18:46:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54C5E287F5 for ; Fri, 2 Aug 2019 18:46:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 45A7228803; Fri, 2 Aug 2019 18:46:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4C396287F5 for ; Fri, 2 Aug 2019 18:46:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7FDF36EF4D; Fri, 2 Aug 2019 18:46:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6C40A6EF4D for ; Fri, 2 Aug 2019 18:46:41 +0000 (UTC) Received: by mail-pl1-x641.google.com with SMTP id b3so33995972plr.4 for ; Fri, 02 Aug 2019 11:46:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NIy8h5wSfDH2K7xzDnBEs97s43/jf77iM8+1t5qbcTA=; b=GjKmFEInnh29PCbD4CQssDVXjHfPMkdxArd7wEnDxhB/idrQmP6HqkAtpdCoPQtLvK RgM0g5n0seT91dzAuNYIJK5x/UNM5h1q39BbWz8mJ4tuA0Ozh/V8iFtNi9m2VGzIBQAf Rbn/3PuxEVaF1zS3er/9iuxed8cAx/jMYsLVeKwX7bkqe8OhrmAEOrL8XFTBMLwdVD+b 0LkI+xbDfyB+7UgDoip5zSXmSu/c2zDXDmY58MMIAiykcEDVvX+BOSOHaUbgtPg3zNZv wrGocTQy3AHPNEAmMqkJBLcQoCVazL+Glts/91t88NRPCpFf6XjZINAwH8gz4I3RlYVo OPjg== X-Gm-Message-State: APjAAAUlbpD/HpqV3hFrUTgFzKUG9YWvOMN13WLtzEpLTBKdlE0BdcBO IJlV/9HftXwY+QvajEYtlIVp5Q== X-Google-Smtp-Source: APXvYqyzzypa/BIcIJw4+CL+ZCerUphjYpafPzUroZSN13bv9VpeTF9YJah3URQns8ZT10F1jhisNA== X-Received: by 2002:a17:902:2aa8:: with SMTP id j37mr126464818plb.316.1564771600984; Fri, 02 Aug 2019 11:46:40 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id f19sm112071104pfk.180.2019.08.02.11.46.39 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 02 Aug 2019 11:46:40 -0700 (PDT) From: Douglas Anderson To: Heiko Stuebner , Tomeu Vizoso , seanpaul@chromium.org Subject: [PATCH] drm/rockchip: Suspend DP late Date: Fri, 2 Aug 2019 11:46:16 -0700 Message-Id: <20190802184616.44822-1-dianders@chromium.org> X-Mailer: git-send-email 2.22.0.770.g0f2c4a37fd-goog MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NIy8h5wSfDH2K7xzDnBEs97s43/jf77iM8+1t5qbcTA=; b=dM2JCKG4ZUdCfNsWMCALyfKMUlMYXJR1Ny3J8w66b56pgCzx9krV9g/X89YcVbqo19 05Hw1m1UpMW0MmMsBYCojTQBt56r4WJImUvbKsmgjzA/PcpjOl/lII2MX/R4BfBJH5fG XEBK2PEP1UZjsjFqxDsMfeIoZ0TIeDfIePL1s= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Douglas Anderson , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, mka@chromium.org, linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP In commit fe64ba5c6323 ("drm/rockchip: Resume DP early") we moved resume to be early but left suspend at its normal time. This seems like it could be OK, but casues problems if a suspend gets interrupted partway through. The OS only balances matching suspend/resume levels. ...so if suspend was called then resume will be called. If suspend late was called then resume early will be called. ...but if suspend was called resume early might not get called. This leads to an unbalance in the clock enables / disables. Lets take the simple fix and just move suspend to be late to match. This makes the PM core take proper care in keeping things balanced. Fixes: fe64ba5c6323 ("drm/rockchip: Resume DP early") Signed-off-by: Douglas Anderson Reviewed-by: Sean Paul --- drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c index 7d7cb57410fc..f38f5e113c6b 100644 --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c @@ -436,7 +436,7 @@ static int rockchip_dp_resume(struct device *dev) static const struct dev_pm_ops rockchip_dp_pm_ops = { #ifdef CONFIG_PM_SLEEP - .suspend = rockchip_dp_suspend, + .suspend_late = rockchip_dp_suspend, .resume_early = rockchip_dp_resume, #endif };