From patchwork Mon Oct 24 11:29:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10381 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp696078wru; Mon, 24 Oct 2022 16:10:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7RDzCrvDmMzdIUh/niYidccA8/0sq271NPkuqnosc9045aWcC348PttyW+750FyNl5Blkj X-Received: by 2002:a05:6402:2804:b0:439:83c2:8be2 with SMTP id h4-20020a056402280400b0043983c28be2mr33424353ede.292.1666653036793; Mon, 24 Oct 2022 16:10:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666653036; cv=none; d=google.com; s=arc-20160816; b=EQAEB5X5ZhhdoWAGnJ83zc0uZESqwMtakFepkOI2sTL2mH0mI+rOV5IYWIKClYbJe7 R5PzSm4l1YFJA3XtRBUJQzQLtyqP/E1weVs7B1OtVzhAiU6Zql1H3Z2t1NTKoEC5gG9l ymMW4+z8PmwvEx/xVKFndAPrAFZodITO8MWPs3CseGLVML6ovRfyefpVydkTFCZsuACI C6Et6JS9nAhqh/I/qYG06KbCwgbLOmln8Mt6ORfziFOhpAI5j2MtTNmqgP8jf13Srqc0 WQXJJn0tPcHg6HGQBH/+0PCzWBigTniB0owaZW6TexaJtCEHwJzQrmmXQYp+mCMqM9G5 6ySg== 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=H7DiPTsLpKEEMi/2n3jAo5j9AghPQ8J1jWI64+LLQQc=; b=feHEM2hGK5lSOafs5Txjr1vEBmWekA0P6TxHEqqqmiKubClTxBhP06CHoD8qezBBI6 05AOgReSTuKEOFh06sNy0EVHORuSyxToHTGiQV1Q7ydrQCNgQigxMYGYJ3AsP4j0loyA ain2qZgQId7u3DydMiLceKDOwKVMAr6BUC+R6/mgn8Mv1Z14m+L9NsGDScsBhuhZRC2B nEOkxGmzydtrK60MqYDfsKz7CnsGtQgfi/skY4ukiiczDFIKoOE3ZB1/l0LDsB+XJMCZ z6PtXDGRRp2lDbKWUOVMBbZ/HH90JhpUDSYUH81E2/GBZI3zLEMyghszP8a9w6fknJGy IzhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LrBVr8sF; 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 i4-20020a50fc04000000b00456b734ceebsi892929edr.436.2022.10.24.16.10.12; Mon, 24 Oct 2022 16:10:36 -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=LrBVr8sF; 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 S232173AbiJXWzu (ORCPT + 99 others); Mon, 24 Oct 2022 18:55:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231440AbiJXWzQ (ORCPT ); Mon, 24 Oct 2022 18:55:16 -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 691104150B; Mon, 24 Oct 2022 14:16: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 51A3CB81210; Mon, 24 Oct 2022 12:07:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8B2CC433C1; Mon, 24 Oct 2022 12:07:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613256; bh=448XI5nFKO3xYfv7nmwZvLPYd7LKGy/pR4tYG6xDquA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LrBVr8sF8TDVopNpiua2wSOaPaG7jOVaNMCfCkmOLb5qB+3IIruYeRSYFRg1TofiL Vz4Vq6xt+sLQ4LvVicCc1wpjR9D+1efO3YTeEPDr6AE/sy23G9fUxdxcXmGwQho8CI COoaDcDp/FJ3w/odWA7r/pD/NTxrDWw5qpL7tPjM= 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.4 068/255] spi: qup: add missing clk_disable_unprepare on error in spi_qup_resume() Date: Mon, 24 Oct 2022 13:29:38 +0200 Message-Id: <20221024113004.787516127@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113002.471093005@linuxfoundation.org> References: <20221024113002.471093005@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?1747612374850617428?= X-GMAIL-MSGID: =?utf-8?q?1747612374850617428?= 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 d1dfb52008b4..6da49705a10a 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 */