Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp594473ybm; Wed, 27 May 2020 03:17:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxusX0gMP7RkuvQxN85F+micvlFBdootkQI8zELoI+TyHyjtyoMAXtEW2Hg8oW07fbwPkj1 X-Received: by 2002:a17:906:49da:: with SMTP id w26mr5176212ejv.548.1590574634709; Wed, 27 May 2020 03:17:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590574634; cv=none; d=google.com; s=arc-20160816; b=TLPUJ69fYl21984n01vNAJTJHgFqqWbOnSVrVko5kXFm4NVI7Ps8NzaXUb5Gc9OFJ1 8ktc9Dg7Ebw+SdSfXtIVv2qRSYN4haTzgpUYY+a3qI9tBvcGmLGU4tRoVOlPHRWwDuBb E/XKU0z4i//9nUEioo2U/oPL3ILAvyk2kocMqeuskEDXyf7FiQh5YzjIt9uSicEsAbQO rwRHga73R2P1gTPxZoi9VRoOJuHBZqFDUXABh1FDmo7P+3oYHEzDD4dM/zrb9rIPP+RZ T6s//aQz+RtbdJQbDVIH8JUdj5+1lHxLVONNKcTYe7UQlhJJImPNB4IZZLzzJXlAFx5V n+3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=EX0nBYnBaZzQJbRfE3NYIaHF+vv9mckV2b/IAfnb2sU=; b=egcT4BT+H0GbtJPI9g9hxOF0oitDGQkVt0NBnCazEdTZ3nXUQUSr2mYiFDweRxXVln d4dZr/tPGxQJPutqDDWy3QLdl4EqaGQCRUGtzJw23AJ2exuBEyN3bf7syIsOZkQkED1N fO5VTw4vNgKyUWJudlft5g2/95YzwOsmwKrGK2fo7L0yIbKYWU8TZooDCF4fry9KXWdU 6IJzx2H4y+N29lOeRBLbvYDfHk/TdSphjFnftWT8wG/SG1alIOpnMsBWfi0oPq5DrLIA pau6WuwzxdUBm06m06hNt6smBzJsK84fB0ZcjTQ52oNNOEr5RoESkAJYRWWmyoTg/DPg f7rw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m27si1727365eja.414.2020.05.27.03.16.52; Wed, 27 May 2020 03:17:14 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728201AbgE0CrX (ORCPT + 99 others); Tue, 26 May 2020 22:47:23 -0400 Received: from mail.zju.edu.cn ([61.164.42.155]:62720 "EHLO zju.edu.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725948AbgE0CrX (ORCPT ); Tue, 26 May 2020 22:47:23 -0400 Received: from localhost.localdomain (unknown [222.205.60.151]) by mail-app2 (Coremail) with SMTP id by_KCgC3fuyB1M1e7XMdAA--.25698S4; Wed, 27 May 2020 10:46:29 +0800 (CST) From: Dinghao Liu To: dinghao.liu@zju.edu.cn, kjlu@umn.edu Cc: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Thomas Gleixner , Enrico Weigelt , Kate Stewart , Shengjiu Wang , patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: wm8962: Fix runtime PM imbalance on error Date: Wed, 27 May 2020 10:46:22 +0800 Message-Id: <20200527024625.9937-1-dinghao.liu@zju.edu.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: by_KCgC3fuyB1M1e7XMdAA--.25698S4 X-Coremail-Antispam: 1U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rrzjiaqtzq6lmxovvfxof0/1tbiAg0MBlZdtOUT6wAKst Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- sound/soc/codecs/wm8962.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index d9d59f45833f..bb806b195d10 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c @@ -2881,6 +2881,7 @@ static int wm8962_set_fll(struct snd_soc_component *component, int fll_id, int s ret = pm_runtime_get_sync(component->dev); if (ret < 0) { + pm_runtime_put_noidle(component->dev); dev_err(component->dev, "Failed to resume device: %d\n", ret); return ret; } @@ -3013,6 +3014,7 @@ static irqreturn_t wm8962_irq(int irq, void *data) ret = pm_runtime_get_sync(dev); if (ret < 0) { + pm_runtime_put_noidle(dev); dev_err(dev, "Failed to resume: %d\n", ret); return IRQ_NONE; } -- 2.17.1