Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp8402824ybi; Thu, 6 Jun 2019 11:41:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqz8986Yq8ptU2REKRbgpBBXa2pVEAbTW8J4e8peYsjHSbxCzRdbEdk7RJUlFVhU8EJ1+N6+ X-Received: by 2002:a62:e417:: with SMTP id r23mr23001157pfh.160.1559846516685; Thu, 06 Jun 2019 11:41:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559846516; cv=none; d=google.com; s=arc-20160816; b=xfhSu45LI8lHaDuR3s/mtuvQoCw9bI9uWzL7S75/gk5/O8wpF8GqMvoAc/LhdJQtP0 AGnptMoSqFsmJkMUcpdMZ2SiLskn7GU/FNGZEfIdo81RaX4hoSJ0IAemOwZTzHhZyyem 6MG9BlnRvrMNTj16YSPXO19LgaTyZblxf271m7ogCY3SwOgwFji9aA0K9ZiuhGyHTCHP 0XotSYgF/ObgjgOQ+ocaH6CRnukBi9M6/lrrm+ekIfCCFrmnTUMIuR0uMwtw1jxru4Fi B4fSlUOlY+TgkdCCASnCUE274YwgQdLnrucx9GwtzrxTDw+Fa3aMi/gzdn4RKIpNWBJL Me2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5QPjMBZ7QhHbHLNmjjqsDaYi7y/cyLKjCBZGOMHoSEM=; b=nQTozaEDvHaL53q9J3kzzuKhxWlQ4qCsm4OKr93Hl+o6ZVvUu7Kwxdrl8UNNQX9DmY Mq77hEW0TBcUUXCBDdlNGrLzphV4B0aBcpCaJVwWnwLVinlHOZQR7stZRXlN0aN55MsT 1O0pELild42CeMLxjTZ5nGjDJeyvMfuaj/76igRB2Yuh+9iXHWt3KiVeGxhwEEyNehoF VYAd3MBcuepfHSiK3g0ZRK253g9M+BWuriDpfmc1QZfDnxpuAFf2Yu36A6DHjDRKZSc/ 4KttoOSGBaVxHaprewKH9GTSo71GovVcn8Z1MEO8UI5pwsHTSlHqiUUFihXv+T26m+hZ A0vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@poorly.run header.s=google header.b=PmHXHYVp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q14si2249142pls.327.2019.06.06.11.41.39; Thu, 06 Jun 2019 11:41:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@poorly.run header.s=google header.b=PmHXHYVp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727379AbfFFQmY (ORCPT + 99 others); Thu, 6 Jun 2019 12:42:24 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:43011 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725784AbfFFQmX (ORCPT ); Thu, 6 Jun 2019 12:42:23 -0400 Received: by mail-qk1-f193.google.com with SMTP id m14so1853877qka.10 for ; Thu, 06 Jun 2019 09:42:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5QPjMBZ7QhHbHLNmjjqsDaYi7y/cyLKjCBZGOMHoSEM=; b=PmHXHYVp6HOkCqaTqZemv5nyGH4FlSL0ZuPiDcmSv5FFWeztRTukCpz/zF5umFyIF7 4je6OpUcXwr9MhnH+dUacPzDzOiGFu/lP3laPt023f0oct1OV/EEyTcH5GhBWHvXLFxK vKCUR+DAFolYNwYYr/Cge6hSW3ditkcGKysmai/+ch0RqByKpmJe9Cd5GkK65gU0U4Pp LrEWbGJLa6vvzJ/p/5edCgDWYufEVxSjT2bXgvsP6sQBbQYYKpC8A3kBe8Zk3kv2HE90 UmGUMJbUF1qisGKUvh0WZTCZVRDcV7TyoVZnpbUtquwGTLSsgYt5qbp62PSAp2I1wRBL 9nxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5QPjMBZ7QhHbHLNmjjqsDaYi7y/cyLKjCBZGOMHoSEM=; b=mSuJt2Strusm/deins97TSl5i/arVCUKCkrpMkTKQZMKdQI2UjVS2df/UNrT6yscCJ +4BZ4h6xGer0xzKDH8w+ZXwWVn9/SihlowSYHAqbJXF+MF48cVP8zYBcb2jZJXi3LXLP aKYDh3EkzwuQBYmvpN+OJrmGLjP1r203+ruMu+rNg6uQ7UCsAJMWXm5YVyYdN+fbsSJe 8lilhms8M36M0L12MuaiaihUGh6pIJ9HVidVeuEwgWC0gI6xKiIt3ZBXW5RgFTz7k6pn twW3uYT5hHZlsiscS/8PnTN21TCdMU91dp3l5xNenLdXXvTw9MOFYjkMobL0fjx5diSY wOxw== X-Gm-Message-State: APjAAAW86xLxz0eHsE6htGobxJXRx0Eeca4eZr6EQKloq3LO8WMX6TGU IT/O4VlytQPawE41IkLGW2PqSQ== X-Received: by 2002:a37:7a47:: with SMTP id v68mr25644536qkc.56.1559839342745; Thu, 06 Jun 2019 09:42:22 -0700 (PDT) Received: from localhost ([2620:0:1013:11:89c6:2139:5435:371d]) by smtp.gmail.com with ESMTPSA id d123sm1224349qkb.94.2019.06.06.09.42.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Jun 2019 09:42:22 -0700 (PDT) Date: Thu, 6 Jun 2019 12:42:21 -0400 From: Sean Paul To: Douglas Anderson Cc: Sean Paul , Heiko Stuebner , Sandy Huang , Andrzej Hajda , Laurent Pinchart , linux-rockchip@lists.infradead.org, Neil Armstrong , mka@chromium.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, David Airlie , linux-arm-kernel@lists.infradead.org, Daniel Vetter Subject: Re: [PATCH v3 2/2] drm/rockchip: dw_hdmi: Handle suspend/resume Message-ID: <20190606164221.GI17077@art_vandelay> References: <20190604204207.168085-1-dianders@chromium.org> <20190604204207.168085-2-dianders@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190604204207.168085-2-dianders@chromium.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 04, 2019 at 01:42:07PM -0700, Douglas Anderson wrote: > On Rockchip rk3288-based Chromebooks when you do a suspend/resume > cycle: > > 1. You lose the ability to detect an HDMI device being plugged in. > > 2. If you're using the i2c bus built in to dw_hdmi then it stops > working. > > Let's call the core dw-hdmi's suspend/resume functions to restore > things. > > NOTE: in downstream Chrome OS (based on kernel 3.14) we used the > "late/early" versions of suspend/resume because we found that the VOP > was sometimes resuming before dw_hdmi and then calling into us before > we were fully resumed. For now I have gone back to the normal > suspend/resume because I can't reproduce the problems. > > Signed-off-by: Douglas Anderson > --- > > Changes in v3: > - dw_hdmi_resume() is now a void function (Laurent) > > Changes in v2: > - Add forgotten static (Laurent) > - No empty stub for suspend (Laurent) > > drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c > index 4cdc9f86c2e5..7bb0f922b303 100644 > --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c > +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c > @@ -542,11 +542,25 @@ static int dw_hdmi_rockchip_remove(struct platform_device *pdev) > return 0; > } > > +static int __maybe_unused dw_hdmi_rockchip_resume(struct device *dev) > +{ > + struct rockchip_hdmi *hdmi = dev_get_drvdata(dev); > + > + dw_hdmi_resume(hdmi->hdmi); The rockchip driver is already using the atomic suspend/resume helpers (via the modeset helpers). Would you be able to accomplish the same thing by just moving this call into the encoder enable callback? .enable is called on resume via the atomic commit framework, so everything is ordered properly. Of course, this would reset the dw_hdmi bridge on each enable, but I don't think that would be a problem? Sean > + > + return 0; > +} > + > +static const struct dev_pm_ops dw_hdmi_rockchip_pm = { > + SET_SYSTEM_SLEEP_PM_OPS(NULL, dw_hdmi_rockchip_resume) > +}; > + > struct platform_driver dw_hdmi_rockchip_pltfm_driver = { > .probe = dw_hdmi_rockchip_probe, > .remove = dw_hdmi_rockchip_remove, > .driver = { > .name = "dwhdmi-rockchip", > + .pm = &dw_hdmi_rockchip_pm, > .of_match_table = dw_hdmi_rockchip_dt_ids, > }, > }; > -- > 2.22.0.rc1.311.g5d7573a151-goog > -- Sean Paul, Software Engineer, Google / Chromium OS