From patchwork Mon Oct 24 11:28:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9732 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp548093wru; Mon, 24 Oct 2022 09:40:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6uBf3+dMTc1ZX1n8gHWYsuNev9v/OwlyGo/X0L1acm3N6TjrJXyyolMN3muCAyhP3O5MW8 X-Received: by 2002:a17:906:5a4b:b0:78d:8790:d4a1 with SMTP id my11-20020a1709065a4b00b0078d8790d4a1mr28457623ejc.329.1666629648349; Mon, 24 Oct 2022 09:40:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666629648; cv=none; d=google.com; s=arc-20160816; b=sS/xfGH+g9El3KWEINAG5CQzrHi6OTnwMsqSb0XMC8hhfZut9pI9xAKTHHXR2LZH8Q g/fBAeQ9fJdcJhDJVadiXNvX39rfckUnUyPk8teQXAcITq/BfNeD2KRqUM6TnL5wp5s9 dBW3hs6kErqqWBycXeJruHLLo1AM+MtPgCByBZkuHUZo72eHP7XyumIgiGTvGzmmOfHi Yu4kuNij22Q/79WArRi9vEtp6ZYVk0KeSlUCBSiqmUG0o/v+T/gk9WjglHBRiiB0BljD wCtJr4WEaDM322BbLXpyytxmWndPmTv1H1VQz/gHe28YD1Ky/5uGl8J3BwatTimF0bde iscA== 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=Ur1xwrTmAoOZnv3EJtGAWt106GMCmRsiQGp6XAtbSXj0Hca6OqHHFpifPue/mSG3HA 3/bmYt+TrSmrXI5Jc/qcaxFsLWIsRpwYgMdDwmwmR2MkUmV+bwmMRs2Kch+FtfrAMZ5r P4ywFipFp5PDUO5kQiOXRw5nE9nRi0VSFEOHeiryf5uvHqNEEFLzJW8D2sbUE9kQL/Nq 2lQpuw0OCWbr+6OCf5czaGNQAzQA+a8QuBoR/tnII6GTusguOS/ZLPyZ4w+BgKcm6pdN XFJSwZ6oaOfKUfANvywdwrZ5FBQ3Hbs6y+KW3mANX4p6bOXfjTfF4c3VPnr2xzQOO3K+ 93mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RQe4sl8S; 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 l17-20020a170906795100b0073c12a7e89esi179197ejo.940.2022.10.24.09.40.25; Mon, 24 Oct 2022 09:40:48 -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=RQe4sl8S; 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 S230055AbiJXQjg (ORCPT + 99 others); Mon, 24 Oct 2022 12:39:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232120AbiJXQjF (ORCPT ); Mon, 24 Oct 2022 12:39:05 -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 4EFE7101E8; Mon, 24 Oct 2022 08:26:38 -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 B92FBB81988; Mon, 24 Oct 2022 12:41:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1580AC433C1; Mon, 24 Oct 2022 12:41:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666615298; bh=3p0ypaTB4ah/NxQ3Z63w0/JXH4OE6rh9UQQyxKabtwA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RQe4sl8SbpQuHHU9H6CpyE42o5WONCxTGtAi2wZ1xOZYdo3Gwng/BibZKj6gNGg3M nDO6UNlASX0EB5VeptTrsw30ImyUL7qADDms0w8EQDYfj1WHa7V7Mmsrmp3wuG1G7V 2jCG/f8Dd0WvSI2im5GDE3HybJN60Y28AczmKU2A= 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.15 167/530] spi: qup: add missing clk_disable_unprepare on error in spi_qup_resume() Date: Mon, 24 Oct 2022 13:28:31 +0200 Message-Id: <20221024113052.618886582@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@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?1747587849815165612?= X-GMAIL-MSGID: =?utf-8?q?1747587849815165612?= 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 */