Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6018398ybc; Wed, 27 Nov 2019 13:30:17 -0800 (PST) X-Google-Smtp-Source: APXvYqy/5uvw74HkxwmSnAzsL4M6kuyz5AqdCrzqou9c9de4uqWl4lSP+S7k6Mih4Wm6hc4BTnZ6 X-Received: by 2002:a17:906:a2d0:: with SMTP id by16mr3015862ejb.322.1574890217818; Wed, 27 Nov 2019 13:30:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574890217; cv=none; d=google.com; s=arc-20160816; b=Wz2rC+40zHqecpr1iy69rpvi6dOt7HOB79LtU5xdpBU8QqBjFLfYWoJy12z1xHdHkl 3LnfaRo3OHW1X40fKq8p9+twQQ79ACwTMfBkuk7KYYlNplJyQlyic7nlHFDM8hN+saqr MYKt5W0qK3Q0l3TXLnmp9rcCEgKZRRFiXjOQtFkmvjMKxeZ0v3jgOrm1DnZy8KGmBDBP n82mSVfY1pz5On6wgG68uMn07Xocvjga4DYnka2I4t3H3SvhPfuTm6o4CDdlltm9GIpy RQJHXUwPxZ1CXQQmBveuudsmrSqxYsZ4T+oHszaAvQeKVPCMHmI4Y5CjiRQoM9Us9dZh J7Qg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xG5pVZGxv6vD2dtmpM7yqbyziiA0ZJO7RGcHuCU0Mi8=; b=YBOngwHwEtIMRYJscfNEZSjY2P1mH2b2ZOtkeMnJR6LY33aGDDO21pkJxahYbITzao UW/reKia+t6+gg9fdd8gsKxgwqzkzQNQQE0cWcX+byaUPIg0QtfQndXBRmFvPtrfjl/A Dv0rpCj0ZA4Gz4D2O06Jg7QjkSyhuvq+qs5W/eHI1FotXaHOuCebbOS+cEc2zxKZfBl6 Kgk7B/a3arcjtthIJWaOaCGKJ3a1Z3u+1g+FvrPwrBqKRuw+E3Y4DN77haA1BgYrW0DY 0YWNKs75s8vRa8JL9w0UVwnmJcSoA6tV5VKkWM98sFZva/8ly1LsyytR0GwLieQd2871 AdAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AZGPWino; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id la4si9557326ejb.297.2019.11.27.13.29.54; Wed, 27 Nov 2019 13:30:17 -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=AZGPWino; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731678AbfK0V0l (ORCPT + 99 others); Wed, 27 Nov 2019 16:26:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:52302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730126AbfK0VAX (ORCPT ); Wed, 27 Nov 2019 16:00:23 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4BF892084B; Wed, 27 Nov 2019 21:00:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888422; bh=9Y+FllgtX9H8rgB0biRlPzQSiJRaRqpAoGAVl3BQjbk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AZGPWino5CxE7IKPEWZ1mtPpX4vWO6tWcnxeZhAgwNLhk2KfO6NZTFWwjG5vakFgA qLQ9f1CHU+DaGN5tcu03TLFaTc4UT1q+mQF1iuewFFhE1aorHrmigMowh9eFXTkcw1 gaJRfelIkpEh473vd8X6AhSXWWzFKKKLxgwuOkJU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sapthagiri Baratam , Charles Keepax , Lee Jones , Sasha Levin Subject: [PATCH 4.19 127/306] mfd: arizona: Correct calling of runtime_put_sync Date: Wed, 27 Nov 2019 21:29:37 +0100 Message-Id: <20191127203124.387371381@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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