From patchwork Mon Oct 24 11:28:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9687 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp541407wru; Mon, 24 Oct 2022 09:25:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4TpCu1+myToSAF92Fhx5pxkrh85Y7NNjTu4Kgw9rXr+Fp4ltA8p+UML30xcmbzmU4lCg+M X-Received: by 2002:a17:907:1c9e:b0:79e:6d97:5e0 with SMTP id nb30-20020a1709071c9e00b0079e6d9705e0mr13164600ejc.534.1666628745094; Mon, 24 Oct 2022 09:25:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666628745; cv=none; d=google.com; s=arc-20160816; b=O/0i3LjvQ8qA9Mrw6rVtlrvDBBm+gklIsD6IRzSo41hAmYfKwwfSKXjudC/S/4Ye7W Lx7XCq6MSirjJBd4mTD6WWqWow7yuk4BVMA3o8w5Hg8g3E6lZnqijGjJGm1t6hv6kgF/ 7M5lSCfHuVSG50ZaQuQOJznlQKlir+nx0gtqpV/+VhuxgaK9b3BOFhA72vtpCP9rM4W+ u93s779hWMGXvLVQUe/9ha8RLOYvOxuHlqnu4pnYw/Ugmi1HPs5VfXIsreaNDfjBWPY/ Ft2hH7X9DHciRKaftsPsKYm/CkE9G6eKp5rfvo8O5jbBFXCqBV79TV7bvgOFs7u1WgSn SzGw== 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=ExmJEnt0/fd/OJN5YmrVJ1KvA5EFNRhXmOCQdhPUPQI=; b=gQZADIANgqt+66/slJlIwUFDecUtV/oW0+drru7+MUJ6X8XQUrm6OHo0QdnMFCkOoF v9BkCsbRerXMXZQBRodinadsLhXzlwfuN9Wmz2l7i+yvLZmiuLd+l1ovUzrov9QNJVv9 5hEt8kbZjHECoQMYlOOkoQSws7VHMEhVu6h61CuKOgXBENJZ8yR84DugvxjycpkR1BuY JY0LOzWFSHrnLgQpdcYRxK2XGkmn8S+Npxtm0sgvtGOrWLtHE1nb3HE8kU6OALInwozD O9Dv7wEaHWqRdgRBaM6+xd/YQfCQDS1fK4lAHhN7gIkcjrXt4SBKxGHOtzw9xVaoLYhj TaEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ml1JvWYa; 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 b10-20020aa7c6ca000000b004614e263f51si203669eds.118.2022.10.24.09.25.16; Mon, 24 Oct 2022 09:25:45 -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=Ml1JvWYa; 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 S233671AbiJXQNS (ORCPT + 99 others); Mon, 24 Oct 2022 12:13:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234491AbiJXQJ6 (ORCPT ); Mon, 24 Oct 2022 12:09:58 -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 B405312D1F; Mon, 24 Oct 2022 08:00:51 -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 2D3B7B8161D; Mon, 24 Oct 2022 12:20:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8258BC433B5; Mon, 24 Oct 2022 12:20:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614047; bh=3p0ypaTB4ah/NxQ3Z63w0/JXH4OE6rh9UQQyxKabtwA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ml1JvWYaV+jZqghmbPPrZB07LIIQjiAxWquizO8fRtyr6ejto66CqfwKR7dE8Jdw6 iSg08/oy4ZD0gtX4ddTpHXvss8Q3ckgjn8PccB2tvI7LhoywxmlLZZW5wUHb8+khIL PtbldGR6T/Q4Wtl8qKWq9/6FJzERIEghKWaLQVDo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xu Qiang , Mark Brown , Sasha Levin Subject: [PATCH 5.10 111/390] spi: qup: add missing clk_disable_unprepare on error in spi_qup_resume() Date: Mon, 24 Oct 2022 13:28:28 +0200 Message-Id: <20221024113027.444773833@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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?1747586903070554501?= X-GMAIL-MSGID: =?utf-8?q?1747586903070554501?= From: Xu Qiang [ Upstream commit 70034320fdc597b8f58b4a43bb547f17c4c5557a ] Add the missing clk_disable_unprepare() before return from spi_qup_resume() in the error handling case. Fixes: 64ff247a978f (“spi: Add Qualcomm QUP SPI controller support”) Signed-off-by: Xu Qiang Link: https://lore.kernel.org/r/20220825065324.68446-1-xuqiang36@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-qup.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-qup.c b/drivers/spi/spi-qup.c index d39dec6d1c91..668d79922fac 100644 --- a/drivers/spi/spi-qup.c +++ b/drivers/spi/spi-qup.c @@ -1246,14 +1246,25 @@ static int spi_qup_resume(struct device *device) return ret; ret = clk_prepare_enable(controller->cclk); - if (ret) + if (ret) { + clk_disable_unprepare(controller->iclk); return ret; + } ret = spi_qup_set_state(controller, QUP_STATE_RESET); if (ret) - return ret; + goto disable_clk; + + ret = spi_master_resume(master); + if (ret) + goto disable_clk; - return spi_master_resume(master); + return 0; + +disable_clk: + clk_disable_unprepare(controller->cclk); + clk_disable_unprepare(controller->iclk); + return ret; } #endif /* CONFIG_PM_SLEEP */