From patchwork Mon Oct 24 11:29:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8766 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp430419wru; Mon, 24 Oct 2022 05:41:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4hpEW+TEYI+BHLUpIr+0K48l7cvEmEI/BW0bxz0BcAtb3e4O2SYQyut8nOY6nOpcQWgJN0 X-Received: by 2002:a05:6402:50d3:b0:461:ba8a:8779 with SMTP id h19-20020a05640250d300b00461ba8a8779mr5658081edb.411.1666615289461; Mon, 24 Oct 2022 05:41:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666615289; cv=none; d=google.com; s=arc-20160816; b=F8+Rc2q3UhSMxk4kUsTA7ZYpwS7aoBlCXm3PcGt9DC3mV7Hn3H52NPjvnlXSwtUIes RFIyhjO2n7TwX9rcwUai4l4j0N2oWHNEUmN7EEgB89tPgjNOI9aUebwja35iHrBzIN8z mwij0LR5bg7Ak8aVtWaadsK36JenE32+74VPVaAnlistK2Sh5rYTeMjtEn3tlWhVwLYF H6sgJsUY945FkozNKZ6HhSLguJDbfd1xfqdGzLoy0b0oPby17aCMXJvIjrveK7uIh2ET J1LlPEyElbeoU5elH+IjyWKZmxuL9p0Yj1pg/WXRfd8n3T9jCriybdYjjZs+02IwQxaI 8JeQ== 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=RzrcHfvx0R2Ml1yubb+2iBHlQnmT8RnpTLEfRu3tv07gWFO9WewlSZd0g6POu8tgvL Ul/MGPF/ZWvyRnJDsGyNf1C2Q/AY6HzAsmZvw7Ti+teHDs2r31QWafxdZ0lYeLwvDUUY iIzXyiIz9B4ev1w7BJNF2v2njeTGbYTRxaZ+7Ji7xRaA0Nb6jmv8LA2kiwKoe4rtPSVH vQRoqwWhW0jry2Bs/Ag2GR/cuFz/v6MPE1sdDRu4oN3o75ULrSSYU+vV4W6SW/WGC6wA LF/PM2orsNtl2m2Y2PXoAOxqPnoQxSAdhjvuvwuuaSoHiYegy9BhqHSIc+aZITT2aLoH Pp/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tdlsy5qf; 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 x6-20020a05640226c600b00461c5846e1asi3263980edd.371.2022.10.24.05.41.04; Mon, 24 Oct 2022 05:41:29 -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=tdlsy5qf; 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 S231403AbiJXMah (ORCPT + 99 others); Mon, 24 Oct 2022 08:30:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233846AbiJXM2Z (ORCPT ); Mon, 24 Oct 2022 08:28:25 -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 157617656B; Mon, 24 Oct 2022 05:02:07 -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 ECD45B810DB; Mon, 24 Oct 2022 11:57:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C8EDC433C1; Mon, 24 Oct 2022 11:57:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612674; bh=yXMCTS8eONU++mGlDljHj3JlkYoORL7wIFX0W3Arlcs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tdlsy5qfHfI8Wgiw77L9rac5tL7dCUaOGgpbdL8naoYhfdqeUJcZG0NpCAndzeE+p wXgD6Xks30kCfW2LRe5P7uqDL8n8fYSJxWLv2V9RJERJZ5X2V2GCuyzpUHsV5YRwVV xuG4I/N83L1rxIv8uQ7dTlSgfcUz0Jn9nu4nYN0A= 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.19 076/229] spi: qup: add missing clk_disable_unprepare on error in spi_qup_resume() Date: Mon, 24 Oct 2022 13:29:55 +0200 Message-Id: <20221024113001.532215271@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112959.085534368@linuxfoundation.org> References: <20221024112959.085534368@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?1747572793796977739?= X-GMAIL-MSGID: =?utf-8?q?1747572793796977739?= 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 */