Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp295892pxx; Wed, 28 Oct 2020 05:15:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjsHoJiWsuZFAKNg1LwSTVRZ2HYxOYX6M4pPeaTGDwKt+jxutEMCQ8r1R0VYQJla31jTp+ X-Received: by 2002:a17:907:42d2:: with SMTP id ng2mr7114227ejb.124.1603887357417; Wed, 28 Oct 2020 05:15:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603887357; cv=none; d=google.com; s=arc-20160816; b=dZPtM4Y0IT5IZpq/hIa/+T7cRqlcxm8p5IJpFbsSmeV24XjLFrPRVvxskclHc0HamL EVMYujwlkL3Mdz+KEfPFZ1JLgwLdBW0LZaIfZyuoIl2yripeRgXd1N447fWVai6AN8Yu MdH+urVe5yxxrepK/O+jw3NGadgIQWODXe60g8VuCYHqi2cxcEcBVOdpwl15hluaqwuE td/kiWvfLYl+YJzRYy+r3F/c0evFr0Nvqur1jk0t+X/bBd9kTVbvbZwSwWwtrSWALhxU I2+/aXa5q0n+cD8hqgGC0wZRtWKMahMNx67QYiv2coqjg8BlNNi2G8MKlt+yNBPrKnjN oYyg== 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=KSzSc+R+VMMynM5Qiwq/P0H1HuM3VsTq9pWAl2UVkIs=; b=dG3suA5UXBhVmlKyVaJsuBPE7IraRwd2Veoa6Ualu5HYiBG8TGNIjcNMS1HriwSXet u8m6+PpPXR4OMDQ6rlYVALxXWALfD0XQlQxCr/OM6WLU9fnlAB5daEmCPFNLCQI9I8eq sgHaVa4x0VfHF/EwEKurj08ZV8PeY987jIO/3OFzsD+6VfBxYvlwwt5QYkzcXlC3mg59 vkMhCLKZEaXIjHpNIJ4rpwFCf4WwGsU1PxGCscrXNJ36yH+QLw3sjmw/ozejRfMa9sG7 qYh6c4zbhfiGTkLdgpnPxHHGlSdBRVmegnlFhvpNEH/WOeq4DWHwnUNpsjH799SCzRGz zzAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xkfUcsiO; 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=fail (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 w17si2969573ejk.629.2020.10.28.05.15.34; Wed, 28 Oct 2020 05:15:57 -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=@kernel.org header.s=default header.b=xkfUcsiO; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1796334AbgJ0PR0 (ORCPT + 99 others); Tue, 27 Oct 2020 11:17:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:50396 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1794789AbgJ0PNe (ORCPT ); Tue, 27 Oct 2020 11:13:34 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 63C4420657; Tue, 27 Oct 2020 15:13:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811614; bh=uMiewmmEqIP9o+WBAyBsct7iMPd6w8XJY4CYwUbB3zc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xkfUcsiOz/v35cNqQlkVZyBE26KiOg7Zi3419DN9DYMLOb3ctyw6li3nQ2xjS7WcI kdqMQNpWOFsPKgkvgLwtHMXuN7Xb7Rbzb7leIwVBdeuqE4RWpOF4x+JdfqrtKjXY5J IJqQzlqf05DG3f8ePMjHoPmoh+8vDiyIpcv0B7SA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.8 556/633] media: venus: core: Fix runtime PM imbalance in venus_probe Date: Tue, 27 Oct 2020 14:54:59 +0100 Message-Id: <20201027135548.895140297@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@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: Dinghao Liu [ Upstream commit bbe516e976fce538db96bd2b7287df942faa14a3 ] pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. For other error paths after this call, things are the same. Fix this by adding pm_runtime_put_noidle() after 'err_runtime_disable' label. But in this case, the error path after pm_runtime_put_sync() will decrease PM usage counter twice. Thus add an extra pm_runtime_get_noresume() in this path to balance PM counter. Signed-off-by: Dinghao Liu Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/qcom/venus/core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index bfcaba37d60fe..321ad77cb6cf4 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -289,8 +289,10 @@ static int venus_probe(struct platform_device *pdev) goto err_core_deinit; ret = pm_runtime_put_sync(dev); - if (ret) + if (ret) { + pm_runtime_get_noresume(dev); goto err_dev_unregister; + } return 0; @@ -301,6 +303,7 @@ static int venus_probe(struct platform_device *pdev) err_venus_shutdown: venus_shutdown(core); err_runtime_disable: + pm_runtime_put_noidle(dev); pm_runtime_set_suspended(dev); pm_runtime_disable(dev); hfi_destroy(core); -- 2.25.1