From patchwork Mon Aug 17 15:13:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 266095 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14B22C433E1 for ; Mon, 17 Aug 2020 19:02:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DED8D2072E for ; Mon, 17 Aug 2020 19:02:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597690957; bh=8B3cUnRmx62sFKs0qlloxzrRqSMU4MSjAFmvDjdYovk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=yoDUPYCyOU28isdVTTDSoq+jK5/AcPpA5zC80Uwks272Lz6+zsatFVNLakAngigP+ t8oqoAKLhdm/t1QN/HTZtgEwyaMo5ema6lp+iEG0P46B2zhsXz6O8eozvLAOUttLQQ 5knuR/J13YpagjmDiLM12PtQCIcTmubEm4Ptg2Ro= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404038AbgHQTCf (ORCPT ); Mon, 17 Aug 2020 15:02:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:59372 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730818AbgHQPrU (ORCPT ); Mon, 17 Aug 2020 11:47:20 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 49336221E2; Mon, 17 Aug 2020 15:47:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597679240; bh=8B3cUnRmx62sFKs0qlloxzrRqSMU4MSjAFmvDjdYovk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1mZc1DVPBxvVj4UCHXEufZt5jiVedvHSBEK/7vpjLDD0kcj13rnsu9NtTRYxtuTVz I/XteRaGYUEtTwR+8wmWUjkxuYcBBsa8HxfJoHkN2hDL2Rp+j0HcVD66gQAG3n46hq KXRgwefb7tWvK5suIhTR/k05cGcOtF07gWkh0PJ0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lubomir Rintel , Lucas Stach , Sasha Levin Subject: [PATCH 5.7 143/393] drm/etnaviv: Fix error path on failure to enable bus clk Date: Mon, 17 Aug 2020 17:13:13 +0200 Message-Id: <20200817143826.549367565@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143819.579311991@linuxfoundation.org> References: <20200817143819.579311991@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Lubomir Rintel [ Upstream commit f8794feaf65cdc97767604cf864775d20b97f397 ] Since commit 65f037e8e908 ("drm/etnaviv: add support for slave interface clock") the reg clock is enabled before the bus clock and we need to undo its enablement on error. Fixes: 65f037e8e908 ("drm/etnaviv: add support for slave interface clock") Signed-off-by: Lubomir Rintel Signed-off-by: Lucas Stach Signed-off-by: Sasha Levin --- drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c index 7c9f3f9ba1235..4a512b062df8f 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -1502,7 +1502,7 @@ static int etnaviv_gpu_clk_enable(struct etnaviv_gpu *gpu) if (gpu->clk_bus) { ret = clk_prepare_enable(gpu->clk_bus); if (ret) - return ret; + goto disable_clk_reg; } if (gpu->clk_core) { @@ -1525,6 +1525,9 @@ static int etnaviv_gpu_clk_enable(struct etnaviv_gpu *gpu) disable_clk_bus: if (gpu->clk_bus) clk_disable_unprepare(gpu->clk_bus); +disable_clk_reg: + if (gpu->clk_reg) + clk_disable_unprepare(gpu->clk_reg); return ret; }