Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1712085pxp; Thu, 10 Mar 2022 10:35:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwYPtyGfEEtsnaJOa8XzVXj3wTbFf4FaMFAD4+vxtYXBbnSLsFMh2gafcVmm2pv9fe6fTFU X-Received: by 2002:a17:902:e9c6:b0:153:2d8a:30d with SMTP id 6-20020a170902e9c600b001532d8a030dmr1463827plk.120.1646937300107; Thu, 10 Mar 2022 10:35:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646937300; cv=none; d=google.com; s=arc-20160816; b=E+mmoGMnfpa156oz9mxhoZjh0+Xdk/e3FqKZSnq+sNgDJbJ9stbSydo3WTSdmg9BB4 XHIJJmP2ddmWtXqs3tjYpCQ1swI8eCjp57eyaMo508RQwo28fZj0bqX7AaIXYgFt9KPL 275be8xZ5fhMEfz+hd8uq8HgzQ2116q8C/aKP6zGLAEqSUXcHxDmKKZ+bfogLlu7ilhY UBz1T8ospo5xnZcCBOaQCgTJJEmyxkbJt4gOQ5Ntva808xhSItqEys1oCT7t/jd3QyjN wqRSQdjD6FkqkjOcciHO2WQba0EmzSdakDSdPhiow3os3JQAwNqZ0WNaYstYegQ//gRv He0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:dkim-signature; bh=QOUPb/MXDpAhDlvBmQeOiY48BmrgZ+iOxXTy3hwTuKk=; b=ToP1VucjuSBoLbump7G+MPk6us+dmlRbHH5aI4rW1X0zMDbRjRW1bFyTGYO48ZS1Ud FtLLoMTDKlFX9M9a+OsbIJqLP4WzY/LQpnKD2qO5oP/ixkomg4BQKT3RC3DBhojicGCh IXeVGku2LfQICwviSeyZKm5rUFqEdf5Y73X/sYKN//8kG3la8MgRA5z5dCHjI2/wE/7L 8Mm5BXgKnaePOCxrc1Tm4Ahyodry7SiTDIDyY2BQQJhNBDCWFF9bbYTzSmSutYxHsPtS cOwF801IZgV4P0G7keUMU4M3Rm1nR2EzbsEHe3o4czo8Km+G473Cw9+VKqSDawbVwuIf hjQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=ilAVPNar; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t184-20020a6381c1000000b00380f8ecdae4si1282721pgd.186.2022.03.10.10.34.41; Thu, 10 Mar 2022 10:34:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=ilAVPNar; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243525AbiCJQdv (ORCPT + 99 others); Thu, 10 Mar 2022 11:33:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236913AbiCJQdt (ORCPT ); Thu, 10 Mar 2022 11:33:49 -0500 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 586D9B4587; Thu, 10 Mar 2022 08:32:46 -0800 (PST) Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 22AGEo0P026874; Thu, 10 Mar 2022 17:32:34 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=subject : to : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=QOUPb/MXDpAhDlvBmQeOiY48BmrgZ+iOxXTy3hwTuKk=; b=ilAVPNarl8JUDS3F88iBufFFGv6LPPSul+Vi43t7WQcYIXix1rg45qJRoXE4qICCXi40 ZZSirC+lq0LMRs0Ec9qo+NssxoY2EzBHsAeRWpmNd+hy+51tY+M4ZekemncpPWCFlpWx htvLVr4a3v8pzN6sj5knrn18NK8fJ0sDjcxWfh6eDam2lmQOvQIVZlWs9YaPM880zY5r 1Up3uxzjzn/t4i9PIWvXi/afI1cgu4oxSdRn/7Pdq4bEbruTB0u9Dh1G+g13njGdRWb3 epRrfUKUL5+tO78xNUO5cyZpHpiLsmlYuG9tNCuHy94kLGSnV89vOWl6FRt2/qfhB761 UQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3embmh7mun-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Mar 2022 17:32:34 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 98C2E100038; Thu, 10 Mar 2022 17:32:33 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag2node2.st.com [10.75.127.5]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 91A8C232FEF; Thu, 10 Mar 2022 17:32:33 +0100 (CET) Received: from [10.201.23.19] (10.75.127.44) by SFHDAG2NODE2.st.com (10.75.127.5) with Microsoft SMTP Server (TLS) id 15.0.1497.26; Thu, 10 Mar 2022 17:32:32 +0100 Subject: Re: [PATCH v3] media: st-delta: Fix PM disable depth imbalance in delta_probe To: Miaoqian Lin , Mauro Carvalho Chehab , Peter Griffin , , References: <2a3b4095-7b63-4da5-d0fa-43ba86715504@xs4all.nl> <20220307080859.14475-1-linmq006@gmail.com> From: Hugues FRUCHET - FOSS Message-ID: <9d543059-2a3b-e5b2-59f2-30819d49b74b@foss.st.com> Date: Thu, 10 Mar 2022 17:32:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20220307080859.14475-1-linmq006@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.44] X-ClientProxiedBy: SFHDAG2NODE2.st.com (10.75.127.5) To SFHDAG2NODE2.st.com (10.75.127.5) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-10_06,2022-03-09_01,2022-02-23_01 X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Miaoqian Lin, Thanks for the patch ! Acked-by: Hugues Fruchet BR, Hugues. On 3/7/22 9:08 AM, Miaoqian Lin wrote: > The pm_runtime_enable will decrease power disable depth. > If the probe fails, we should use pm_runtime_disable() to balance > pm_runtime_enable(). > > Fixes: f386509 ("[media] st-delta: STiH4xx multi-format video decoder v4l2 driver") > Signed-off-by: Miaoqian Lin > --- > changes in v2: > - remove unused label. > changes in v3: > - add err_pm_disable label and update related 'goto err'. > - update commit message > --- > drivers/media/platform/sti/delta/delta-v4l2.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/platform/sti/delta/delta-v4l2.c b/drivers/media/platform/sti/delta/delta-v4l2.c > index c887a31ebb54..420ad4d8df5d 100644 > --- a/drivers/media/platform/sti/delta/delta-v4l2.c > +++ b/drivers/media/platform/sti/delta/delta-v4l2.c > @@ -1859,7 +1859,7 @@ static int delta_probe(struct platform_device *pdev) > if (ret) { > dev_err(delta->dev, "%s failed to initialize firmware ipc channel\n", > DELTA_PREFIX); > - goto err; > + goto err_pm_disable; > } > > /* register all available decoders */ > @@ -1873,7 +1873,7 @@ static int delta_probe(struct platform_device *pdev) > if (ret) { > dev_err(delta->dev, "%s failed to register V4L2 device\n", > DELTA_PREFIX); > - goto err; > + goto err_pm_disable; > } > > delta->work_queue = create_workqueue(DELTA_NAME); > @@ -1898,6 +1898,8 @@ static int delta_probe(struct platform_device *pdev) > destroy_workqueue(delta->work_queue); > err_v4l2: > v4l2_device_unregister(&delta->v4l2_dev); > +err_pm_disable: > + pm_runtime_disable(dev); > err: > return ret; > } >