Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp773649ybc; Sat, 16 Nov 2019 08:26:37 -0800 (PST) X-Google-Smtp-Source: APXvYqwplN9EG6ZiC3k+BwIB7uU8tH2DFGw3C9Sei3w9OzsEGisKA0GRap34nyJJwTi8Ac2govWK X-Received: by 2002:a17:906:80c:: with SMTP id e12mr11102292ejd.59.1573921597777; Sat, 16 Nov 2019 08:26:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573921597; cv=none; d=google.com; s=arc-20160816; b=f0jFo7hG5xyfayuFWcntDkko8fLKmrDd8+CE4vRnzRzuzQ6pKl2M6DnzBDXKftDa6f LHnhR9qTwp4t1a9QHRJnSR4ATBjICIitCkuEweam8TjmHCDB131M/h4hzq3K38qpo43B o0LXzG8gOBeABL/HP6jxBz3HXj7RUCbuoHUL4B9aevRh72Wft8aH4EZ6Aqr1g1M3NaZk ykNKo+eXh9MWaE7SY/55sBHVchg9z3V/OSUrp1J6cIAgBJj8fuMFq6qKLKeIvCfbg+FA jE4eWNBrouBOlf8OHd/UUE1nFIyWz1voiBRYGCz/hciufNPsevWrEa1lTwQbB13+NqWN 6tDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xG5pVZGxv6vD2dtmpM7yqbyziiA0ZJO7RGcHuCU0Mi8=; b=kEiNPFFlg/7020/PbbNodQthB0aBs+d0VS6l93OemhQ+7jH69pv8S1OmOsTJAWgD/y F3SEdPyJ3DyIO289s/op5EDxva4502PHIuXcHkzI783Z+bvi2ZTI9cTL86tKWA1MDGwf 6xc+oyobEZAQTbuzUDzFv9vbJcafa2bkjqkS184BLvJIsCynrnC/9r4n7oOgnjxY0vjB CFCi5JMHFVsoA3v2ln4mxMMQ05Q1aAx/q1q4NWhaGKQekWwhlZcPIa4Ys7EExuND2RD1 GmqmYYraatkNs4FJ2+e5ma4+baVe6vo8YIvvoJSSvZyMDMvDQRagmhu2llD8yP5/0yIW erZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TWURu8VB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j16si1955477ejv.305.2019.11.16.08.26.13; Sat, 16 Nov 2019 08:26:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TWURu8VB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730201AbfKPQVq (ORCPT + 99 others); Sat, 16 Nov 2019 11:21:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:47480 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728734AbfKPPn1 (ORCPT ); Sat, 16 Nov 2019 10:43:27 -0500 Received: from sasha-vm.mshome.net (unknown [50.234.116.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 00F7220733; Sat, 16 Nov 2019 15:43:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573919007; bh=9Y+FllgtX9H8rgB0biRlPzQSiJRaRqpAoGAVl3BQjbk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TWURu8VBKgZ/95mm9Stse6cWVRhrVJAtsRGaQrdZRPRy3fCqazGIos0HM0AFqRkoL OXgxT/zMESmJElRqP3zQlHLiyh7z9inVmDdQGLqbQIcikWbkg4oulEONPF3c4GBaC+ xFVjE3tQ/1x7kY+4pGgkSWRT1CaoMVIFmrxF5qG8= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sapthagiri Baratam , Charles Keepax , Lee Jones , Sasha Levin , patches@opensource.cirrus.com Subject: [PATCH AUTOSEL 4.19 109/237] mfd: arizona: Correct calling of runtime_put_sync Date: Sat, 16 Nov 2019 10:39:04 -0500 Message-Id: <20191116154113.7417-109-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191116154113.7417-1-sashal@kernel.org> References: <20191116154113.7417-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sapthagiri Baratam [ Upstream commit 6b269a41a4520f7eb639e61a45ebbb9c9267d5e0 ] Don't call runtime_put_sync when clk32k_ref is ARIZONA_32KZ_MCLK2 as there is no corresponding runtime_get_sync call. MCLK1 is not in the AoD power domain so if it is used as 32kHz clock source we need to hold a runtime PM reference to keep the device from going into low power mode. Fixes: cdd8da8cc66b ("mfd: arizona: Add gating of external MCLKn clocks") Signed-off-by: Sapthagiri Baratam Acked-by: Charles Keepax Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/mfd/arizona-core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c index 47d6d40f41cd5..a4403a57ddc89 100644 --- a/drivers/mfd/arizona-core.c +++ b/drivers/mfd/arizona-core.c @@ -52,8 +52,10 @@ int arizona_clk32k_enable(struct arizona *arizona) if (ret != 0) goto err_ref; ret = clk_prepare_enable(arizona->mclk[ARIZONA_MCLK1]); - if (ret != 0) - goto err_pm; + if (ret != 0) { + pm_runtime_put_sync(arizona->dev); + goto err_ref; + } break; case ARIZONA_32KZ_MCLK2: ret = clk_prepare_enable(arizona->mclk[ARIZONA_MCLK2]); @@ -67,8 +69,6 @@ int arizona_clk32k_enable(struct arizona *arizona) ARIZONA_CLK_32K_ENA); } -err_pm: - pm_runtime_put_sync(arizona->dev); err_ref: if (ret != 0) arizona->clk32k_ref--; -- 2.20.1