From patchwork Sat Oct 22 07:24:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7445 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1098389wrr; Sat, 22 Oct 2022 01:10:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5URMr5d4YIKQhXc+wfajmFNPw3cAQtW+/P2YmCkXwqY8ZIToudRHVVKRjm9dERTt7lwxid X-Received: by 2002:a05:6a00:a94:b0:562:dcbb:47c3 with SMTP id b20-20020a056a000a9400b00562dcbb47c3mr23697850pfl.79.1666426239720; Sat, 22 Oct 2022 01:10:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666426239; cv=none; d=google.com; s=arc-20160816; b=hztBr7zWsM0q6b4NH94U2WQgvNsgyfrSnzoQeRg2vJUB36Dcny2FeupkwrDpyx5Lbi 7VCEo1+Qg3sW7+BFWU6VewHKwl5XOHBrFu3H0447b+qtRko8Q5eTvy0n5Le1IlfHMwAW nC5KumFbjfZh19x8ixpUCFH+VaxLbZPy+Nw5K/e8PrCkZ5w6qtSYOcL7MvFlrm4sH62T uPEtdP3Z4dFLihPdjFCvSJ86pmF2nbHJe/hFa+VzrVXB3E80PBKvYqYevueeh3vK3bD/ 8uHRCxWomf+BKCs6isp5Xn5KVk54umBkNohB09OhpDqnIUWe5Te4/9wlSk8+2q/F058i EYBQ== 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=XhWVOrWp1pGGSeEQALigQ8X9+kgy5G8IEinUpuJjHGU=; b=PDMxbiQ53NpA1eTy+l2UNeKimrlo/bmnG87KyAWD1ENv8LPVFqF6rao3QPqwtVDmYK Gxx/2wCW3UOUfVyEptme5z3DBHmAYVpy8RfUvpF5N+Lmwfb84V4xtqesugzJ8BNX0Poe POKmgUB/JS5HGPYpJIE+hD2UstTnqxMetmmv2jrh9vG4XcU0nGh2LMAKWYBpiZjQ1OHu 14iLbUzowUx918n9Fw3aplDkjAS4H+jlC4NhpA0FYEEdyzyNt835mDzpDTKkC6kVitIY EKRcC4tMcb3xk1C0pPDY5IOQ9CdS9VTLGq/FxYvruZ6yC+y8bWs3L7NwDtNx1ZJ+tVk8 s14w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lXYArmOD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s15-20020a056a00194f00b00562db93e317si25088573pfk.114.2022.10.22.01.10.26; Sat, 22 Oct 2022 01:10:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lXYArmOD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233294AbiJVIJb (ORCPT + 99 others); Sat, 22 Oct 2022 04:09:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232394AbiJVIFN (ORCPT ); Sat, 22 Oct 2022 04:05:13 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFB082D52FA; Sat, 22 Oct 2022 00:52:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 68A98B82DF1; Sat, 22 Oct 2022 07:52:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1CAAC433D6; Sat, 22 Oct 2022 07:52:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425129; bh=lU1rMge4AvOB32EqEc1cYUnGuxCTzQQf26R06XK4qiY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lXYArmODH0feiJPoNYwwe31eQNeaO0aGoNx4fvnZjDi/PE1U+6DYflOzKDddoHsR/ GKXEUfvKL4a+9tNZDgh38qkuM+EbOb2q0KxuPo3ZpXRU8kG7e6wnb1PQjYYFYwNZFU z6TDV19zJdMnKDB71ZEw/71oemPSx3NOX86kIGLs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xu Qiang , Neil Armstrong , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.19 400/717] media: meson: vdec: add missing clk_disable_unprepare on error in vdec_hevc_start() Date: Sat, 22 Oct 2022 09:24:39 +0200 Message-Id: <20221022072515.568243594@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747374560868680008?= X-GMAIL-MSGID: =?utf-8?q?1747374560868680008?= From: Xu Qiang [ Upstream commit 4029372233e13e281f8c387f279f9f064ced3810 ] Add the missing clk_disable_unprepare() before return from vdec_hevc_start() in the error handling case. Fixes: 823a7300340e (“media: meson: vdec: add common HEVC decoder support”) Signed-off-by: Xu Qiang Reviewed-by: Neil Armstrong Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/staging/media/meson/vdec/vdec_hevc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/meson/vdec/vdec_hevc.c b/drivers/staging/media/meson/vdec/vdec_hevc.c index 9530e580e57a..afced435c907 100644 --- a/drivers/staging/media/meson/vdec/vdec_hevc.c +++ b/drivers/staging/media/meson/vdec/vdec_hevc.c @@ -167,8 +167,12 @@ static int vdec_hevc_start(struct amvdec_session *sess) clk_set_rate(core->vdec_hevc_clk, 666666666); ret = clk_prepare_enable(core->vdec_hevc_clk); - if (ret) + if (ret) { + if (core->platform->revision == VDEC_REVISION_G12A || + core->platform->revision == VDEC_REVISION_SM1) + clk_disable_unprepare(core->vdec_hevcf_clk); return ret; + } if (core->platform->revision == VDEC_REVISION_SM1) regmap_update_bits(core->regmap_ao, AO_RTI_GEN_PWR_SLEEP0,