Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp652212pxv; Thu, 15 Jul 2021 12:31:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWmVAqxkrMtnGyhdM+79pmBmqRFwCN9/pxu4JGE3AE1ZLq+bLFtHAv11LIVt5ITgF28Sgy X-Received: by 2002:a05:6402:1c8a:: with SMTP id cy10mr9113791edb.232.1626377497456; Thu, 15 Jul 2021 12:31:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626377497; cv=none; d=google.com; s=arc-20160816; b=uNwcMIHMzKytv+FtEo6C4iuVrsJi79OPvoED3HbkzS7Qlj70wGq0uwInTBYpwdS6Ap sBHvQsiZiORxaV0kj8W0oljIg2JgnTiXYb9DmWhcr9A1gdMjPhTKnq271EQ6m1nK7VZl 5ZbtBobe03Y2IAaxlAQy4jHg9jYCJS43n1TabvPioRySZ+x/TCNqNBKPsZ2UtOcf0y8X um16R+/4QPiviueyHBlZ8KY2CjZNByTt2rkpD02LvFM6myZF/WWtoEmEZaM31GMdMtEn zbnZkVMjAwsNMDbEuUPF4EQ/v2F1jORX5ncXFUW0XO79E62yF8kk6rxR/hblEY84xypJ 0Lqg== 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=xGNN4WZZ0mvwu229XTYEx8bCDtub1WGzKojZtWR29ZQ=; b=tMOCYLX+fIR9rCECLZqKDh9RA9v4B3a+iRsiDnsYigOsJuTm1Il7ekqqiZ03r6EvdK W1woz4nT0CEyBiHMHngkyiwYaxcZFMuwokMUCibPDNMHJMpxnK4T5UqbE+EOZxDZztUW HoHQjOR/PQ6Jbss8GyZKOEyl9VP0QenG9pxcXgBnrLAFdDCfaCQ5HG3ttCvdINwN3yf/ nbUftiQYGaEg25rUq4r9qAXGXl1RPnq5mIA4zpCKhFRIXa5abPRlQZJXYB9NqqjKzT/J YeY+xJsm+Wz72rlndPl7MdxNdGDUsyfnbAgmuN9svTgk4kkVUejCzYH5zj+Y3i41p+LJ wDyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zkjltHMx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c4si8337358eds.528.2021.07.15.12.31.14; Thu, 15 Jul 2021 12:31:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zkjltHMx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S245118AbhGOTbj (ORCPT + 99 others); Thu, 15 Jul 2021 15:31:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:46196 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243546AbhGOTJz (ORCPT ); Thu, 15 Jul 2021 15:09:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 19AEB613DA; Thu, 15 Jul 2021 19:05:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375956; bh=NOfpLa5aBZ+YeJoN+sifc7XSiFFqJYiYutLvPXV94U8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zkjltHMxQRX3GOJ+50YZkdyYX1RcP1LDx4XWHK7lQEjEZFF4EaXd7UAVm+1xRG1YQ CwsngDLI3iCff9BTCo4T4yW8V952tXPIQ/m8FfFt+1D5QxaxwWRw1X8icZVV5j8tY9 kNkKv/FQJFKgO8W+jJ105nmYEUDmjzobStytt00A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Yang Yingliang , Thierry Reding , Sasha Levin Subject: [PATCH 5.13 064/266] clk: tegra: tegra124-emc: Fix clock imbalance in emc_set_timing() Date: Thu, 15 Jul 2021 20:36:59 +0200 Message-Id: <20210715182625.568673769@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182613.933608881@linuxfoundation.org> References: <20210715182613.933608881@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yang Yingliang [ Upstream commit f13570e7e830ca4fbf4869015af8492b8918445e ] After calling clk_prepare_enable(), clk_disable_unprepare() needs be called when prepare_timing_change() failed. Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: Thierry Reding Signed-off-by: Sasha Levin --- drivers/clk/tegra/clk-tegra124-emc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/clk/tegra/clk-tegra124-emc.c b/drivers/clk/tegra/clk-tegra124-emc.c index bdf6f4a51617..74c1d894cca8 100644 --- a/drivers/clk/tegra/clk-tegra124-emc.c +++ b/drivers/clk/tegra/clk-tegra124-emc.c @@ -249,8 +249,10 @@ static int emc_set_timing(struct tegra_clk_emc *tegra, div = timing->parent_rate / (timing->rate / 2) - 2; err = tegra->prepare_timing_change(emc, timing->rate); - if (err) + if (err) { + clk_disable_unprepare(timing->parent); return err; + } spin_lock_irqsave(tegra->lock, flags); -- 2.30.2