Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp430019yba; Thu, 16 May 2019 03:17:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqzJ0NHJEVJhRF/5WEYT0UJdfFbpgG+IySf7lgcqGNP8cGXA1rqXnvIcWgbqOj87rxgXcUuo X-Received: by 2002:a63:e408:: with SMTP id a8mr49705686pgi.146.1558001844232; Thu, 16 May 2019 03:17:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558001844; cv=none; d=google.com; s=arc-20160816; b=WhuMytYtnZ/1ZoES7fGTe1ywJ0S+XLiLuGWNX8Wzhc+N4CKQolSiO2c+qkLGcUSTnt bZBRtJl3BWOLI8zfM6grPdVFRUdmpg3jjZPMu/gf5+b2PD/DTlfHlfFd50rK6CnbPFWL Kce36XFCZAlabUAjcr0YgBc1GE5GxcOGFeD+dcQ0OMwjXQqu23BKPuDyrlDHHPds6bEw a8oez68VtiSNzMNgCbRjcHJzFUfqFNipNY0zrXWW6M6LF0dJ5yD76DHUaIATMeQzbrBY juq7RMCGutTL7nSF3abrkt8TpzFR6BFyxmOhKuPmF8MrmMV6X3IAoFFAorBXFz4s03gw YHog== 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=zxiMDr7Yb8T/s7kpxJ6dScAr2OxmipqGjFaA1EwLe2k=; b=fvO9Fublg1chZV2mhumjUv+QqNgPouPYuxyg7d8ZXgQB1LNFnPRjLN2XpRsMtcRNJV NCzZxP89fIHcfA9JqVTHdsEODoonnGXygFvz5IEcIWc8uKwMaBuFIucx3fLNuUJuTNkQ /fwmpVFcRrWUglYbeIPsYevVy0WGF/JgwoiolzHJvgEalopxatNepaBY1+Jzx6B0eHVN 3B62t3ENmavzqctadcaKEozm9zq9s0px8f1N4jcKoMECpxuZS/+9HQbevJ+EUgFW+cMV 6NPc5/BTcM+h5XXyu42c7RjdiD9INxVgzYWMF6Nk/1ymPxxNhfyuPri2MIPWIs5oNd6v fBaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=AqEuEc+3; 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 z26si4557948pge.345.2019.05.16.03.17.08; Thu, 16 May 2019 03:17:24 -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 (test mode) header.i=@ideasonboard.com header.s=mail header.b=AqEuEc+3; 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 S1726605AbfEPKO5 (ORCPT + 99 others); Thu, 16 May 2019 06:14:57 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:55334 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726336AbfEPKO5 (ORCPT ); Thu, 16 May 2019 06:14:57 -0400 Received: from pendragon.ideasonboard.com (dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id ED7C3320; Thu, 16 May 2019 12:14:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1558001695; bh=hdHDpOn6XPeT8HCeSsf6x0SVf0Wl4BDWp5vvALPWmUk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AqEuEc+3Hkk+pq/L7bssYGNH3Yllxa/OlVeqwuBQkQdGyAkzaQU6EeJfTk8WVJnPs MjsLwRz1GcjHCRDFkQlUdbPypKpo5WOf0+nyM2iAS+nk86NSrM0MaqfojXDCwZ8JKa 0fz6L4cv85S3qT8xR0hIekDP5rSwZGn5lYYdQ1fc= Date: Thu, 16 May 2019 13:14:38 +0300 From: Laurent Pinchart To: Douglas Anderson Cc: Heiko Stuebner , Sandy Huang , Andrzej Hajda , linux-rockchip@lists.infradead.org, Neil Armstrong , mka@chromium.org, Sean Paul , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, David Airlie , linux-arm-kernel@lists.infradead.org, Daniel Vetter Subject: Re: [PATCH 2/2] drm/rockchip: dw_hdmi: Handle suspend/resume Message-ID: <20190516101438.GD4995@pendragon.ideasonboard.com> References: <20190502223808.185180-1-dianders@chromium.org> <20190502223808.185180-2-dianders@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190502223808.185180-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 Hi Douglas, Thank you for the patch. On Thu, May 02, 2019 at 03:38:08PM -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. Should this be solved with device links if needed ? > Signed-off-by: Douglas Anderson > --- > > drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c > index 4cdc9f86c2e5..deb0e8c30c03 100644 > --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c > +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c > @@ -542,11 +542,31 @@ static int dw_hdmi_rockchip_remove(struct platform_device *pdev) > return 0; > } > > +static int __maybe_unused dw_hdmi_rockchip_suspend(struct device *dev) > +{ > + struct rockchip_hdmi *hdmi = dev_get_drvdata(dev); > + > + return dw_hdmi_suspend(hdmi->hdmi); > +} > + > +static int __maybe_unused dw_hdmi_rockchip_resume(struct device *dev) > +{ > + struct rockchip_hdmi *hdmi = dev_get_drvdata(dev); > + > + return dw_hdmi_resume(hdmi->hdmi); > +} > + > +const struct dev_pm_ops dw_hdmi_rockchip_pm = { Missing static keyword ? Apart from this, Reviewed-by: Laurent Pinchart > + SET_SYSTEM_SLEEP_PM_OPS(dw_hdmi_rockchip_suspend, > + 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, > }, > }; -- Regards, Laurent Pinchart