From patchwork Wed Dec 2 04:45:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 11944689 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=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,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 9107CC64E8A for ; Wed, 2 Dec 2020 04:47:32 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2F54622202 for ; Wed, 2 Dec 2020 04:47:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2F54622202 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:From:Subject:Mime-Version:Message-Id:Date: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=KLsSXAorZitTxtL6/vfALo3H5XnO9WqTb0EMG5FhIa0=; b=yRIBZw0RqNJeu3QH7pdqOsz7cJ aKQj3iGjo9MxXSZs1Oj7tPkMsIFHF6+QOx3hTBokmeTrMtKFMIttET2KodFdnQ6r7bsasiec2j/5n QXYaZPIzvudOg7d9AZkskNIQa8Ufavh+nc50EwODMGaYvhsKZAO32/j6Tg8waRfl2Dn3WLWj5+IAo oB64JJxLda5NfD3rDzlrL2P4jBGa0Dq5TbcoxA8GGAkEOH0n3u4gIopfCfJcWSLXwRRFAiN1bY8PM YN1ToZWINZKrIuJ05ispE/S0PPh9mZcsqu0Iga8px+nrOzUf9+ovEnLJtKwRPdHgO3gN6j2lrTulw /so4/tLg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkK1t-0006PT-Ha; Wed, 02 Dec 2020 04:46:13 +0000 Received: from mail-qt1-x84a.google.com ([2607:f8b0:4864:20::84a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkK1n-0006OA-M9 for linux-arm-kernel@lists.infradead.org; Wed, 02 Dec 2020 04:46:10 +0000 Received: by mail-qt1-x84a.google.com with SMTP id v9so379688qtw.12 for ; Tue, 01 Dec 2020 20:46:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=KaD/sETMhQdwAs4CxEJvlROU3dFFHCWo0dFsT9X/rFw=; b=HqtyOa7OG56z5TA7PLMydmHYJxsAKx/WMKSXgBPdXYpQbAMfKonL5cSXWbbkl9KjhI JdBgvEZTXZGjXhN6yukz5tIIIB3ZeA9f4vzH0+fw1J2jwW2B6ZMxm6iP/KSgC2G1SmGE yT3qY0rHdTKa1M0OD9DYU4abtt/AQeZIex8J8aWxexSKwHtb9aa2mpwwX8TSm8p+wk0Y DVEJLOxa5SnTwD59EFqZrWzmxpPLeyTlMbxwmWzV6F44qStm3c6oTqAvK1Fucqh/+uXs /JWUHmohoaQ+K0MYpGXJX9J1qsGzS2EclWMkPNb2tsBOLgtTwmcbK0QyEqnoBjG9CSv+ pKmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=KaD/sETMhQdwAs4CxEJvlROU3dFFHCWo0dFsT9X/rFw=; b=hXVbo8zVlZizJaVnIkrhpdjhZniqz+Jua2phMkjtLYzwNiTlOEiF4dLhQY1tNJuDt7 LI6a0cEL+P2XG7IGg0aIHgOh5oYubIQmBRCKHMt1m3jT2nsrzCIXz/pmeFytZrx5GG5H MDQYuCJE9og4PK12u0BQS0VjJE2lE539RpbqdekxpvllVSJvY9+FGmK78hbnmGkKvmNp BoSQVNjTSgKYLBb+TQQ4QsEdSLU2K4/+GndKIVeUdPH2h0nCAV8h9QRP8YQ1gFRbhOws pbL5RAjNNBgmmeo66Rxv9FSWbI/k8+WF7/hh33XBBjFBoth1fhUPWzrYLcjUVltpFoil lPOA== X-Gm-Message-State: AOAM530njmDRKYHTYvIyTd8T3V2zkjcsMXWUAymlbi0du0BxjuzMMUB6 OmC47jaHGdd1tqEJJF5BFM5Iqsgn92Xg X-Google-Smtp-Source: ABdhPJxIqcCBWdbzcwmEwprb6kcsp08cmzPY7xMIsej180ilIQOQ7gBZtgOPoEGoGa4RkKipRh5+zEF+lUBj X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:b:725a:fff:fe41:c6a5]) (user=tzungbi job=sendgmr) by 2002:ad4:4721:: with SMTP id l1mr908110qvz.30.1606884364037; Tue, 01 Dec 2020 20:46:04 -0800 (PST) Date: Wed, 2 Dec 2020 12:45:37 +0800 Message-Id: <20201202044537.2500497-1-tzungbi@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.29.2.454.gaff20da3a2-goog Subject: [PATCH] remoteproc/mediatek: unprepare clk if scp_before_load fails From: Tzung-Bi Shih To: ohad@wizery.com, bjorn.andersson@linaro.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201201_234607_825204_3E189990 X-CRM114-Status: GOOD ( 13.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mathieu.poirier@linaro.org, linux-remoteproc@vger.kernel.org, tzungbi@google.com, linux-mediatek@lists.infradead.org, pihsun@chromium.org, matthias.bgg@gmail.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Fixes the error handling to unprepare clk if scp_before_load fails. Signed-off-by: Tzung-Bi Shih --- drivers/remoteproc/mtk_scp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c index 5f42b9ce7185..c7d49c861adb 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -350,11 +350,11 @@ 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; }