Return-Path: Received: from omzsmtpe02.verizonbusiness.com ([199.249.25.209]:18384 "EHLO omzsmtpe02.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752302AbdLMB4U (ORCPT ); Tue, 12 Dec 2017 20:56:20 -0500 From: alexander.levin@verizon.com Cc: Ed Blake , Mark Brown , alexander.levin@verizon.com To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH AUTOSEL for 4.14 37/60] ASoC: img-parallel-out: Add pm_runtime_get/put to set_fmt callback Date: Wed, 13 Dec 2017 01:55:20 +0000 Message-ID: <20171213015455.6455-37-alexander.levin@verizon.com> References: <20171213015455.6455-1-alexander.levin@verizon.com> In-Reply-To: <20171213015455.6455-1-alexander.levin@verizon.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Ed Blake [ Upstream commit c70458890ff15d858bd347fa9f563818bcd6e457 ] Add pm_runtime_get_sync and pm_runtime_put calls to set_fmt callback function. This fixes a bus error during boot when CONFIG_SUSPEND is defined when this function gets called while the device is runtime disabled and device registers are accessed while the clock is disabled. Signed-off-by: Ed Blake Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/img/img-parallel-out.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/img/img-parallel-out.c b/sound/soc/img/img-parallel-= out.c index 23b0f0f6ec9c..2fc8a6372206 100644 --- a/sound/soc/img/img-parallel-out.c +++ b/sound/soc/img/img-parallel-out.c @@ -164,9 +164,11 @@ static int img_prl_out_set_fmt(struct snd_soc_dai *dai= , unsigned int fmt) return -EINVAL; } =20 + pm_runtime_get_sync(prl->dev); reg =3D img_prl_out_readl(prl, IMG_PRL_OUT_CTL); reg =3D (reg & ~IMG_PRL_OUT_CTL_EDGE_MASK) | control_set; img_prl_out_writel(prl, reg, IMG_PRL_OUT_CTL); + pm_runtime_put(prl->dev); =20 return 0; } --=20 2.11.0