From patchwork Sat Oct 22 07:21:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7295 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1092913wrr; Sat, 22 Oct 2022 00:55:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4u8LVoo5WEiz2ax/xVuWR8aWyUCc6l6ahezz3U2lafcJyXPn4V40K0L9YHlqz25FsuThAT X-Received: by 2002:a17:903:2346:b0:183:fffb:1bff with SMTP id c6-20020a170903234600b00183fffb1bffmr23316976plh.55.1666425330313; Sat, 22 Oct 2022 00:55:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666425330; cv=none; d=google.com; s=arc-20160816; b=SELXOKLrdz6N9DFIaofSH2SWiL8vz1yCF3aXx5MSfJ/nhRyvU46LAyrvATMUlohXsN xq1AOL60lreEm5Xo+mm2hhDM7EotvzBah2Y/fFInpaInGA00TX3CK91HWbNlSoYKe1p2 fzC+lzOMQdhaudgIPqQ8NsEdTwqzBOBzD8iruBo8YPuNud8isGIljos358Cjp7yewuDD FmCHHeE2UdSv+AEuDFCGLPY7n6jYkaKtDfBIqkH2rpSZKC7uE/jDbbPp00etv70es+7H O6pFr1O+ISXBtbuPV3mpO1iPNWtN9640E1PIdSMoosj4o2139mlxvhirHVLseFhoTH3i OIkw== 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=hwAFJISQXBxKrTnk6Pj2/+RIEOifuHUpBzBhdXa2T58=; b=krr1OFtHeIXw6Wm9wrEKz/8K2AfAOolEtH7AQP+VwThrcTscZYjx9SgGP03suPEQT+ D/4s7uKW+rLQ4+th1qLvUxv7dqkabVzVZbZjqD30rwco237tNBwfVTTDS48RChv+bfRL JM2RBgIhf2eBA2E2VOIbUWLFMM7Fo4Sigh8QQiGYj2pRRPBxdlHi/fNpZOpiQ3d+AH8R Ozellc/ROhcTmPRv2PYglGVnk9QzdE++PjhYRUUpI2Q3Emx37Zg7K0s2XX2Qn++X5nVx bhv8o0Z1XABEScDp2F9jtM372nc7hCD5QfE7eA3P/z4nYyqY9S2Z1IBLcXb/B4aMQTPs G9uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NRfiM4B7; 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 w17-20020a170902a71100b0017f802fcffesi26149132plq.410.2022.10.22.00.55.17; Sat, 22 Oct 2022 00:55:30 -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=NRfiM4B7; 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 S232045AbiJVHxq (ORCPT + 99 others); Sat, 22 Oct 2022 03:53:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231960AbiJVHvl (ORCPT ); Sat, 22 Oct 2022 03:51:41 -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 D17A92C2AEF; Sat, 22 Oct 2022 00:46:37 -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 DA441B82E2A; Sat, 22 Oct 2022 07:45:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4BFB9C433D6; Sat, 22 Oct 2022 07:45:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424737; bh=Rz9rDCBJAQ2vRjx+afllaCE7dQcrdHH6ja7SalU0vXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NRfiM4B7RgentWQPBsDNA91ZmspghISERhHkn7BnTrnwKrIvY3Lj4if4Hz+hv2pWG 6LVS4t8rJjClz08t6F1kusmqpeNKE2NIJ5H3yo89qHRVyw9v3IHUTLA5b6xt6dBFh+ IA0kDY1KG3sUZR47b9ucxc4UhUqXOWqjonKq2/B4= 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.19 230/717] spi: qup: add missing clk_disable_unprepare on error in spi_qup_resume() Date: Sat, 22 Oct 2022 09:21:49 +0200 Message-Id: <20221022072455.804383866@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747373607023433014?= X-GMAIL-MSGID: =?utf-8?q?1747373607023433014?= 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 00d6084306b4..ae4e67f152ec 100644 --- a/drivers/spi/spi-qup.c +++ b/drivers/spi/spi-qup.c @@ -1245,14 +1245,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 */