Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp640656pxv; Thu, 15 Jul 2021 12:13:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpDxwlWsiGJyiROhsQYnRwKLawnCP16H8vBu+e1kssfY8+RqD+/FUhHw4fr7m/65t51XHG X-Received: by 2002:a02:9648:: with SMTP id c66mr5494984jai.73.1626376387402; Thu, 15 Jul 2021 12:13:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626376387; cv=none; d=google.com; s=arc-20160816; b=lc0ZGYsgn58Gkk9aX1pKcsqF3y38B9zCQwiwV4rMaRQlBfU8iSZzWTKqEPDNPo2fFi drXBf5pBHzYMoEFB7zkZz/0JTbVOn3QvM3HbOsaxaODJ3HVg/MN9RMBxFLgIkiYRuPuS nNRgEi/n6uxgbVIvpX+0Ctd7RXIK/jKlkliHNnkP9bVTs3Iy63hps3JVAL28DJHkd4PM c1aa7poo6M89aPKuxbV8EtBqXys7U4ZwamXMWEmbgrCy6rwHObOAIfdnCG7qg+ZIROi9 79uOLgGhoKHHpjxP93EF8d5o1kKyLxc4jBubmt1tZh7cBeneBXIt8DJWKgpmbBgqYYrB XSbA== 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=VW3WrL/bWb4PCmof9qWRhl5FCHJqPaw9bsQQ2ulGltFV2X3X9qCxlJGN53NJ2QlCGj I9KhbGGm+J4x2R+GKarc+yl61U/Xt7IIR6OEIXSgqG4Legnc9e2xCb/ValbcNgnDHSla zyi3fhh4YQjVc8J7wKUALBETuzSjoC2v76xj4o1Qt4GVhAngHD9u8MPWwLL5KzDOOggY oszzgL38Z5fTvwlOa+8dqAZ0cA5h5fAwkBhgRNrAu12L1bZk+KYx2/krrh5EhuJg8WTZ MZ+zrst0jk17Mpp49A5wm0rKvKh8xB6eZS7ATMKXpJbPgmLDHB13kik9irAxNjFvoiY9 oJ+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CUYBn7N2; 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 m4si7514835ioy.95.2021.07.15.12.12.55; Thu, 15 Jul 2021 12:13:07 -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=CUYBn7N2; 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 S244263AbhGOTOj (ORCPT + 99 others); Thu, 15 Jul 2021 15:14:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:35494 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241618AbhGOS7Y (ORCPT ); Thu, 15 Jul 2021 14:59:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0DB25613D8; Thu, 15 Jul 2021 18:56:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375361; bh=NOfpLa5aBZ+YeJoN+sifc7XSiFFqJYiYutLvPXV94U8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CUYBn7N2UD33lMDEcUG0tuxXn6Eq9CberA1jxw7s155BdBkqr/MIpuWNGx4Zm76sh AXgzkjkGpm/zihDs5TauEDqSk1XsVBG+WgXsw2Sg3+JqB8aJ12bnFzvcbCTZqzeHl4 UAagsfhkQ/OE2/U2i6IoNdwNH0sWjEZwcfZ8XARo= 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.12 053/242] clk: tegra: tegra124-emc: Fix clock imbalance in emc_set_timing() Date: Thu, 15 Jul 2021 20:36:55 +0200 Message-Id: <20210715182601.670310684@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@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