From patchwork Mon Oct 24 11:30:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8579 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp419091wru; Mon, 24 Oct 2022 05:15:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6QpBV8mvdFBo7HxGG47cy44fTaOapTrdewQTn3OjCt7kLXAZnY4dz1HiTNHrVIEQHLScFu X-Received: by 2002:a17:906:5a5b:b0:7a6:cbc7:4ca1 with SMTP id my27-20020a1709065a5b00b007a6cbc74ca1mr5220746ejc.544.1666613744932; Mon, 24 Oct 2022 05:15:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666613744; cv=none; d=google.com; s=arc-20160816; b=SFOC31wraxJZqQeelOSVgJBI/fnUhfDRwUvfEkqI63wQrU+qUDgO1euhrSa8iQJ7Uh YpwjtE+X6q612+njNGWtMJMug967feEr9CjpsoVWhsnyYlxOx30067mRb9qezc4lIUBA oWxCyc+1wsMDBLr5SQYL1xHqGuO4VFgkYSOzQ1Yz9Cou2KIZWaKI7ibriI2ld5qCyWhd 9NUsBdFppE5+M1/cx1VyhLvZFWMbA3ul7sTsIlFZq0SWXF3B7brFDeXAS31Bzy/sIv+K 4hmF3D2Rld3zmNLCzZLDv61QmS3K5N3GQFLi9qHN2tFaSRyerm1Z5jRwQjIp61SzN6WU ULmw== 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=Ltioo1cUxSjO/ajzzZRy7JIKD/bLDfSkewSjDzNolrg=; b=VJJ/BjnFHfFKJAVuOiQjJE61Ek5bPiDsmC8ekMbfLkmTJUGPSlJGDvkHNIwrmFZcMB tp/b55g1Z205Kli5SeOhSLsYCvnpbsd4Ke85FT3OABdFJQnsW09WxOPWauM0BTWaBoYr od58xCi+HqH4z2nBZRmdAt3m0V8kwXVh0Gg8s9XMwEIIL1y0Ewnul95yaTqUfpV2oIZB Juk1UJHg21kOFvyxHzSzxA5tt0k7ENPfPdiEpIsXrj6b7ej/UzCeHOlcWCYaojuH3VTJ lO6Sd+1QNLYI3Pf+JtCLHkpOWHzJgqcny0uaCsUyCYow+Z93Gms4ZAsBeIaEd1pcgOgB 5NSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="M/cH+aTw"; 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 o1-20020a50fd81000000b00461a4eb674dsi4033479edt.619.2022.10.24.05.15.21; Mon, 24 Oct 2022 05:15:44 -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="M/cH+aTw"; 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 S232635AbiJXMGS (ORCPT + 99 others); Mon, 24 Oct 2022 08:06:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232746AbiJXMEN (ORCPT ); Mon, 24 Oct 2022 08:04:13 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D4FA5EDDD; Mon, 24 Oct 2022 04:50:25 -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 0F373B811B8; Mon, 24 Oct 2022 11:49:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B5E2C433C1; Mon, 24 Oct 2022 11:49:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612141; bh=yXMCTS8eONU++mGlDljHj3JlkYoORL7wIFX0W3Arlcs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M/cH+aTwEG0r1e3eM635HEYkZFFPxnjx4KK5K+g5RkKtmLqvwYlcH0WoE7Pd9X7GX k8GE0n0g4XYfMi+HKL2sTEeFnPjEtnjK4sW3wJDXGKLRmsG3/j8dhwEHeOGnsUyEqV dJC72Rgj4Nk3qM/qu0vsXLEvDW17oTKMJBBv6SiQ= 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 4.14 085/210] spi: qup: add missing clk_disable_unprepare on error in spi_qup_resume() Date: Mon, 24 Oct 2022 13:30:02 +0200 Message-Id: <20221024112959.811054555@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112956.797777597@linuxfoundation.org> References: <20221024112956.797777597@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?1747571174154884672?= X-GMAIL-MSGID: =?utf-8?q?1747571174154884672?= 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 cb74fd1af205..c5c727274814 100644 --- a/drivers/spi/spi-qup.c +++ b/drivers/spi/spi-qup.c @@ -1219,14 +1219,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 */