From patchwork Wed Oct 19 08:25:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5554 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp349468wrs; Wed, 19 Oct 2022 07:12:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6YxR/i5fZHFYaBQJkG6DFwgMQ74XSOQyaVFKVqU6JRADMQE9ke6+FTAifjl4dOQgp7QSY+ X-Received: by 2002:a17:907:1624:b0:78d:d61c:2b4a with SMTP id hb36-20020a170907162400b0078dd61c2b4amr6832712ejc.208.1666188720594; Wed, 19 Oct 2022 07:12:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666188720; cv=none; d=google.com; s=arc-20160816; b=03oI7fnHnw5RlENTu/QKVTBXmxW6yrEncCh7XbDiNQTDdTQymuJr6o8r4CMda/WbDt f+t/Q4Kil8dyidCVRsj0Y6ZYLgp2kIXeUtIyBO4rwgh7CEVrTVoMNaNPeXZ4TzaR991u 23aeU3n5deizD3KyztFG0zrxoLIFf9tK7F/UtiCU8OQSq2fLBCAV0X2ux1TZYP1KNo44 xHK2+7K6w97dcHDjYryTNql5et471MBOnNmuRIOjqhoxumqVpDvAaD4TW/5+UcZubmN1 +aPP51MAZ6e/I4K6n/jcuhEiTGBzDLEoNO8NpL+gpCsryjkkNLtCyFUWGgujITsgeQRN uPIQ== 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=FUdu5t2DbwQNWb9AFPtOgW6qFVh/DPMI5i2fzrn4ql2h5AC6+4BxmvFtqHv2h+GPIQ 768LLb6f8zcnKnV5jSnwdKYmhrSNQpPplO1+z1LjMRHM+gjv+eisSYsOkvOHLriSwGB0 4QoW6WtgszwnqS3gum2UXHvU2OGCgODzFegVXVk4y9rTgl4Jjnp64lPa1CwL0B6xyM7M qvYbtXYcsxflGUDYo/zsAxILjIc6EAGu6H8z93Zt2sf2f+wg7Rs78KpZtZeCMvUDDRFg Z55FicRamx7GWjMA2K5Bh0x8OnuuQmRGWi5DH2ZWeQXcXmkqO9mbTxwA84PYVYpEle06 R3Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tWvluceJ; 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 qw20-20020a1709066a1400b0078dad5e8d65si13035327ejc.68.2022.10.19.07.11.28; Wed, 19 Oct 2022 07:12:00 -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=tWvluceJ; 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 S233783AbiJSN46 (ORCPT + 99 others); Wed, 19 Oct 2022 09:56:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233703AbiJSNxQ (ORCPT ); Wed, 19 Oct 2022 09:53: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 7E4771C8816; Wed, 19 Oct 2022 06:36:34 -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 7A86FB8238B; Wed, 19 Oct 2022 08:50:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1EE7C433D6; Wed, 19 Oct 2022 08:50:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169432; bh=Rz9rDCBJAQ2vRjx+afllaCE7dQcrdHH6ja7SalU0vXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tWvluceJ4+KdQ8KQbcJMblJB18QlYqKR9G3Ejz/gPAoU6tI2b5Fl8VPK4FTcu7ZwN PIFjC/BOvgm7pJKf5JYQrBjuJxIFK9xb8SplI/BIOjthOWsWl2vLemDrvLCwoXd07t zn5PmcT/IrLdsl/y9qQJ14iPjvW4zYyCGxdWZz+E= 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 6.0 267/862] spi: qup: add missing clk_disable_unprepare on error in spi_qup_resume() Date: Wed, 19 Oct 2022 10:25:54 +0200 Message-Id: <20221019083301.819748343@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 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?1747125503407392060?= X-GMAIL-MSGID: =?utf-8?q?1747125503407392060?= 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 */