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: 11074043 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 2030C1399 for ; Fri, 2 Aug 2019 18:46:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1029F287F5 for ; Fri, 2 Aug 2019 18:46:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03B6928803; Fri, 2 Aug 2019 18:46:56 +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,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9BB7C287F5 for ; Fri, 2 Aug 2019 18:46:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=DFT3NhlgnVUkqhUPHWWwBQsJdNwQTXz/bntDAQCZgf8=; b=oxJISEfFwk6KwB 4arkx+IXL3LUbNPkCkUrox51U2iA6Um9XrnWOdxL+AGj41eOOEopzbLq5N6x8NxfOkQSPXR6EkDho 3dCEcjlACsExVLGOL4IxUQmsvmQIdNvObTOF5YNEZU8Im1H47EaC5s3be4bHENxNhW+uSRDEevJny 6IuVJn1bAyDXS2JAQicr7k0RJLB5DlxdrAPumLMrY3Vf57vI0zLX0k2xuDMbK4NRqQafenFcyOVmB wP5q8uicvhTuTQVdciMtaLibUccASAU6Iu9iLLUSqHiv6ChZb9fWcyakZXKCpXSMdxMWM1weFe/yo 21O/2v2J8uDsX2fylmHw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1htcZn-0002Ds-6F; Fri, 02 Aug 2019 18:46:51 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1htcZi-0002Ck-98 for linux-arm-kernel@lists.infradead.org; Fri, 02 Aug 2019 18:46:47 +0000 Received: by mail-pl1-x641.google.com with SMTP id k8so33985041plt.3 for ; Fri, 02 Aug 2019 11:46:41 -0700 (PDT) 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-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=P9QDn7/zDReLvo0FIBl+ktpXdqPj/3Gu1oY2C5uJKaJkSn5CQAAuaExqTP5zuDc3HR myVHoz6xftx+b70B/LT6B895GunnsqDCCoNBn3xzwcXiamy5pxcCfUtLmBGrCz2bgmn8 G+w5tHDP3nipxz76ZVZPQqfMWYNCJAJT8swVZK0uSgdtXyS0qy0jHzQEF9j/EBWu3dax aYNGA5TbwwHvTFeiv5uXfjfZwv1E7Fz5TAj6iUiQ7UJN6fRToDImAPFtnXAV/XXW5lar yKTJXq4iXS0HZ1GrottUX2kxtJ+enm098DNVhH2PVXXRmtHuL/B+5LbHon/bPc6q4aLL rv2Q== X-Gm-Message-State: APjAAAUwjHUA/C8MZuBYI8RPZ2wcfpdKwVM5wyBaRAjl/NdHZhpu2mVu kq7cC8qY9Ufiz+WR3wsGMfmL5g== 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190802_114646_324481_53438C0D X-CRM114-Status: GOOD ( 12.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sandy Huang , David Airlie , Douglas Anderson , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, mka@chromium.org, Daniel Vetter , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 };