From patchwork Mon Aug 17 15:11:55 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: 265944 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=unavailable 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 E2D20C433DF for ; Mon, 17 Aug 2020 19:41:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C623820760 for ; Mon, 17 Aug 2020 19:41:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597693268; bh=8B3cUnRmx62sFKs0qlloxzrRqSMU4MSjAFmvDjdYovk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ozCcqeTOKXbnxQvTcyJNqbD4rPWn3JvkFhCp7iC65ca8nGVFcRtoE1O3zlKMZ7uzU KjbV2nTJo6O5v9E55rWOeSpwHg7cuMX5JdSFpePmEpRBLss+sCw2atrQySNPsgKVnS cn/EsJxBwPqcNNPbp9JN279RhDMGY3i1dDXjpA+Y= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404250AbgHQTkx (ORCPT ); Mon, 17 Aug 2020 15:40:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:60276 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729744AbgHQPZg (ORCPT ); Mon, 17 Aug 2020 11:25:36 -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 5203B2395A; Mon, 17 Aug 2020 15:25:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597677935; bh=8B3cUnRmx62sFKs0qlloxzrRqSMU4MSjAFmvDjdYovk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KQiA2KhGJIPsmz/sOFKHIQlqNCYYk7n0oyGz2gKdG+RZ0tVCOT849awo7YuVfXTO6 CYa8msKdrp/170Xij1GmXbbCLE++Hn1CDOOMsRtFnNrWByZFVCP2ypbu6vClDk0CTK 0sOQfEPuesukLfk+Lv0QK0SmU+vMSlOFfKOxlhtU= 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.8 162/464] drm/etnaviv: Fix error path on failure to enable bus clk Date: Mon, 17 Aug 2020 17:11:55 +0200 Message-Id: <20200817143841.568807126@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143833.737102804@linuxfoundation.org> References: <20200817143833.737102804@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; }