From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 1/2] drm/msm/dsi: Use correct pm_runtime_put variant during host_init Date: Fri, 6 Oct 2017 16:02:09 +0200 Message-ID: <20171006140208.3oltpjd3beytvdkz@phenom.ffwll.local> References: <20171006105707.20416-1-architt@codeaurora.org> <20171006105707.20416-2-architt@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail-wm0-f66.google.com ([74.125.82.66]:35555 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752193AbdJFOCN (ORCPT ); Fri, 6 Oct 2017 10:02:13 -0400 Received: by mail-wm0-f66.google.com with SMTP id b189so11604793wmd.2 for ; Fri, 06 Oct 2017 07:02:12 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20171006105707.20416-2-architt@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Archit Taneja Cc: robdclark@gmail.com, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org On Fri, Oct 06, 2017 at 04:27:06PM +0530, Archit Taneja wrote: > The DSI runtime PM suspend/resume callbacks check whether > msm_host->cfg_hnd is non-NULL before trying to enable the bus clocks. > This is done to accommodate early calls to these functions that may > happen before the bus clocks are even initialized. > > Calling pm_runtime_put_autosuspend() in dsi_host_init() can result in > racy behaviour since msm_host->cfg_hnd is set very soon after. If the > suspend callback happens too late, we end up trying to disable clocks > that were never enabled, resulting in a bunch of WARN_ON splats. Sounds like the correct fix here is to block autosuspend until after everything is set up, including bus clocks. This patch just makes the race harder to hit in practice ... -Daniel > > Use pm_runtime_put_sync() so that the suspend callback is called > immediately. > > Reported-by: Nicolas Dechesne > Signed-off-by: Archit Taneja > --- > drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c > index dbb31a014419..deaf869374ea 100644 > --- a/drivers/gpu/drm/msm/dsi/dsi_host.c > +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c > @@ -248,7 +248,7 @@ static const struct msm_dsi_cfg_handler *dsi_get_config( > clk_disable_unprepare(ahb_clk); > disable_gdsc: > regulator_disable(gdsc_reg); > - pm_runtime_put_autosuspend(dev); > + pm_runtime_put_sync(dev); > put_clk: > clk_put(ahb_clk); > put_gdsc: > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > hosted by The Linux Foundation > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch