Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9111691pxu; Mon, 28 Dec 2020 06:57:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJxZiiEMnS5D9dyl1eCqOhBpIe+aNPqQLngDxwTAB4/9sKUu2Pg7DWEjh96KvozlB3q+ww+V X-Received: by 2002:aa7:d407:: with SMTP id z7mr44393413edq.234.1609167449699; Mon, 28 Dec 2020 06:57:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609167449; cv=none; d=google.com; s=arc-20160816; b=BMlGzaXxG/cZ9U4GFpu/FCcqUVCjq4zdrETlLHTEYphWM3KJw5YXswnhQiwb/w4tPl r3h3QZ3avPyAsd24EHitxU5bLfy2eal3FICoaezrOde0srOzFvPaIwCRwe6hteF9gk6Q XgY0j5V+cVoXvdypxXWI9gYrGaii0mxqH17XkEag7SfIfMP80IFVf4N9oD9fZaX3j4dm 3wW1bjX2SqhwOqlWfEoz5a1/LwkvNAwmDgIM8l8BV+eOWuiB1dqormM/i9kXm0upxHHx Zq4++jXNZxwrKDZhKcrIKNGrHjwadKaL8TLnKOuQntO6C64HcI7+ma2TzXqxdBXWANAa WLlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Y1mPJvDyKp2VXcevNV7fmCPS4x/k9t+TPcsTNdw05EY=; b=F7EstoACBDlGYsAwyDDOr7Z2+F0+y/Z6vVr65wPblpEV3khaVVx+3iSuDr8k3vKTxB jxoGhC0FcGrkMDWIT79MN+/An6te7Ntp8G1etzBSxpGa0vGTjmOkMXwXIponCe7vApAm QWvcqtEnzvRNa07mMqkUoP5wab7PteisPg3SqwbWOCMDMggKSVl0LrFmVZ2YTM02INWY cLj8kuAxL+73QVfTeVJk6dXZLq/pGRQtUEzDQ52+ShblMr44kxXEJ/uOGLsavC0B6WvR 2JXxMcHLrMF/3C/ZzSdCmLcn1u3yfkkMngc1EdjcyiIDE68PTlxlPVAI+tNRyNY5zqX2 AFBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nS0yzGYI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r19si20923109edw.476.2020.12.28.06.57.05; Mon, 28 Dec 2020 06:57:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nS0yzGYI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391830AbgL1OSd (ORCPT + 99 others); Mon, 28 Dec 2020 09:18:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:52306 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2441570AbgL1OSX (ORCPT ); Mon, 28 Dec 2020 09:18:23 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 25FF220791; Mon, 28 Dec 2020 14:18:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165087; bh=mUGHk6r51IylLfP0yvXyk94WqmWSN719DKhiODtC8XQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nS0yzGYIC8cuALlf5MqqLRvT+k1ghSS9FahYLEne+AriYNu5By/l9Uk49qIS/ujZv FPsbwX/FjR80XVwN5g9lbY7ZMv2N+hdLcGzsWk7teJOfvTjGHhAFKrwRA81ePnpli7 k9UoafUwiVO1e4DDg6dFkqWZYSTS8B8PH9U0jZlE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mathieu Poirier , Tzung-Bi Shih , Bjorn Andersson , Sasha Levin Subject: [PATCH 5.10 405/717] remoteproc/mediatek: unprepare clk if scp_before_load fails Date: Mon, 28 Dec 2020 13:46:43 +0100 Message-Id: <20201228125040.393149541@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tzung-Bi Shih [ Upstream commit 22c3df6f5574c8d401ea431c7ce24e7c5c5e7ef3 ] Fixes the error handling to unprepare clk if scp_before_load fails. Reviewed-by: Mathieu Poirier Fixes: fd0b6c1ff85a ("remoteproc/mediatek: Add support for mt8192 SCP") Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20201203155914.3844426-1-tzungbi@google.com Signed-off-by: Bjorn Andersson Signed-off-by: Sasha Levin --- drivers/remoteproc/mtk_scp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c index f74f22d4d1ffc..52fa01d67c18e 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -350,9 +350,10 @@ static int scp_load(struct rproc *rproc, const struct firmware *fw) ret = scp->data->scp_before_load(scp); if (ret < 0) - return ret; + goto leave; ret = scp_elf_load_segments(rproc, fw); +leave: clk_disable_unprepare(scp->clk); return ret; -- 2.27.0