From patchwork Tue May 7 19:18:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jordan Crouse X-Patchwork-Id: 10933657 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 D105B13AD for ; Tue, 7 May 2019 19:18:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0E4828746 for ; Tue, 7 May 2019 19:18:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4BE72894E; Tue, 7 May 2019 19:18:27 +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,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 6A18A28746 for ; Tue, 7 May 2019 19:18:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BF17E6E837; Tue, 7 May 2019 19:18:21 +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 6D2506E833; Tue, 7 May 2019 19:18:20 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 44D8361213; Tue, 7 May 2019 19:18:18 +0000 (UTC) Received: from jcrouse1-lnx.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jcrouse@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 5FC3061194; Tue, 7 May 2019 19:18:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 5FC3061194 From: Jordan Crouse To: freedreno@lists.freedesktop.org Subject: [PATCH 1/3] drm/msm/dpu: Fix error recovery after failing to enable clocks Date: Tue, 7 May 2019 13:18:09 -0600 Message-Id: <1557256691-25798-2-git-send-email-jcrouse@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1557256691-25798-1-git-send-email-jcrouse@codeaurora.org> References: <1557256691-25798-1-git-send-email-jcrouse@codeaurora.org> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1557256700; bh=Q/mJwJuOJwy/EQv6iKT7QRDV1FjoviOEpC04L2Tcpzk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GXGiQMyi7VKPoUwP62hypwZmvvamlOKhee6AdOv780rokWrsitM7mxaIZXwKZy1f0 R6/nB26BT9oJVOfnvKVlXVn3ZveLUBidWJkTSdIrfda0vQ0TlgWvUabI9CffJp6DWy IDSCox2rZ5OWTPaIztGctxB5FixiwE/zNa7F2OME= X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1557256697; bh=Q/mJwJuOJwy/EQv6iKT7QRDV1FjoviOEpC04L2Tcpzk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eF8zL64FNZTGzDK9ZVMecOUGA2iNRn2Jc8k37M/rPgQq742AAsyBP6rCz7puQVNAY TYI1gGniTkn5FVCIzdmk0WaxThd4R+ipmv+dfqGdm+ihRkyWhUsp+WKM2NxtyOwsbq nXzAjIFCB1ZgUal4J6Ct1Er17YcC8QJnthfZL4Rw= X-Mailman-Original-Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org X-Mailman-Original-Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=jcrouse@codeaurora.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kees Cook , "Gustavo A. R. Silva" , David Airlie , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Mamta Shukla , Sean Paul , Chandan Uddaraju , Rajesh Yadav MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP If enabling clocks fails in msm_dss_enable_clk() the code to unwind the settings starts at 'i' which is the clock that just failed. While this isn't harmful it does result in a number of warnings from the clock subsystem while trying to unpreare/disable the very clock that had just failed to prepare/enable. Skip the current failed clock during the unwind to to avoid the extra log spew. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c index 78833c2..a40a630 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c @@ -114,9 +114,9 @@ int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable) rc = -EPERM; } - if (rc) { - msm_dss_enable_clk(&clk_arry[i], - i, false); + if (rc && i) { + msm_dss_enable_clk(&clk_arry[i - 1], + i - 1, false); break; } }