From patchwork Fri Oct 6 10:57:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Archit Taneja X-Patchwork-Id: 9988983 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8970860247 for ; Fri, 6 Oct 2017 10:57:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A64228599 for ; Fri, 6 Oct 2017 10:57:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F0B728C9B; Fri, 6 Oct 2017 10:57:17 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 36C9D28599 for ; Fri, 6 Oct 2017 10:57:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E55006E91E; Fri, 6 Oct 2017 10:57:15 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.codeaurora.org (smtp.codeaurora.org [198.145.29.96]) by gabe.freedesktop.org (Postfix) with ESMTPS id D67086E91E for ; Fri, 6 Oct 2017 10:57:14 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1000) id B4A8D6087C; Fri, 6 Oct 2017 10:57:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1507287434; bh=e0Y3w9fIJi3bhRYrYAtEgNB+dLisZHlgAeJr9CGPkNA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZmhUlE6IFwJvR9we4+ITXrWc/mKn/3C4hMFVh2hFf/Cqa2LPM+fBvY3B/tCsdnGGg ZfcnZ66u7n0hIPcDiUr51GTtDmKmicj1GmbagcZvzeXI/T/pqJb7o0oK5AFXuyp1Bw ypOCLpgsj96iV5oC0Uez4LCN/uF2qsBSbVUnBcbk= Received: from localhost (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: architt@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id D7FE7601D1; Fri, 6 Oct 2017 10:57:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1507287434; bh=e0Y3w9fIJi3bhRYrYAtEgNB+dLisZHlgAeJr9CGPkNA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZmhUlE6IFwJvR9we4+ITXrWc/mKn/3C4hMFVh2hFf/Cqa2LPM+fBvY3B/tCsdnGGg ZfcnZ66u7n0hIPcDiUr51GTtDmKmicj1GmbagcZvzeXI/T/pqJb7o0oK5AFXuyp1Bw ypOCLpgsj96iV5oC0Uez4LCN/uF2qsBSbVUnBcbk= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org D7FE7601D1 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=architt@codeaurora.org From: Archit Taneja To: robdclark@gmail.com Subject: [PATCH 1/2] drm/msm/dsi: Use correct pm_runtime_put variant during host_init Date: Fri, 6 Oct 2017 16:27:06 +0530 Message-Id: <20171006105707.20416-2-architt@codeaurora.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20171006105707.20416-1-architt@codeaurora.org> References: <20171006105707.20416-1-architt@codeaurora.org> Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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. 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: