Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4296475pxy; Tue, 27 Apr 2021 01:20:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEIId4y4ktO5qbhn2zf8Zo3mvkDuKdWyez2pX5zBcUtAl+XKLR/6eULwb67/W49CseGP0o X-Received: by 2002:a17:906:3e4a:: with SMTP id t10mr22226454eji.553.1619511610685; Tue, 27 Apr 2021 01:20:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619511610; cv=none; d=google.com; s=arc-20160816; b=BhgyrJeVhLhuExxtTYaCE6CU1mLZeG8POBNKUSzCIhyM27Vi+AP2xrVpYm0ZDOLrlh +JXbTXw7m+utYN3eMBoKqBl7BI/WYuD2HwyRUX/c91yP96czD4M3tuxbjwULRTO6uja/ LP8rDcQTFNGU4ks/E8MpEHGFhTwD2oSekcg43crHlaxlnjS+8XU/OUELscI8AHr9GsMN ykwOwQoTWzaTmSzkYPNcUsU9ZHxBUMdzl7GVoRZBf72Fg+IlIxwZWvFMKbjaubrYoMwR nIEqTX4e/hjG4iIEXrLlwskJBC8HLh//h54NZJml19hAjFX4fnu0iwzUygnxNkbRHT8D 9rMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:cc:to:subject:dkim-signature:dkim-filter; bh=rWw6Tw10qSxMP/aYL1ato5GIYt+P77hpHOeiD6gAOe0=; b=CyDgJAR2ejtZIrrLQ7OqvlVHcAPNDvHGUlA6UzNjOSAwZE/vNI4e5LjiSWQZzQJRqd wUAWjmH91Vdm2LcYvIisJ7UbtNtZnAEo7ZDz4HHh47NiYtmuXjJCItns9TqWyzwMV3F3 3tqp8Kan/adG7DZNQUdPhD5oGftERCRQJPpHhH/z4PdFkupn2ailD9hQ4AXml73ortzg hC0lmJq2CZVO4TaHLjgFpAQWsAkY6cG/LtRsLDK4YLIdj0B+GIt75SSBx1mvnilpA7Jy jPEhFC9y6rAbn8YPP2HzIM6E8tnCEdDhYVaGltMHFY5vkfNYR3TTKUCfwUYfjkrf/vGc jPcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=WBlFiPsl; 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=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g18si16378519ejt.696.2021.04.27.01.19.45; Tue, 27 Apr 2021 01:20:10 -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=@samsung.com header.s=mail20170921 header.b=WBlFiPsl; 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=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229487AbhD0IS7 (ORCPT + 99 others); Tue, 27 Apr 2021 04:18:59 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:15502 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230325AbhD0IS6 (ORCPT ); Tue, 27 Apr 2021 04:18:58 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20210427081814euoutp0133bd83cd174d3c494ccfd4dda407f2c8~5qR_yp6942859828598euoutp01Y for ; Tue, 27 Apr 2021 08:18:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20210427081814euoutp0133bd83cd174d3c494ccfd4dda407f2c8~5qR_yp6942859828598euoutp01Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1619511494; bh=rWw6Tw10qSxMP/aYL1ato5GIYt+P77hpHOeiD6gAOe0=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=WBlFiPsl90XGq/EExu3kHadXmEuXUGwrVAUU/EdvxowaLecr0SfHuia68ZPGw0h+3 sxElwlXMw15tY01FA8T6Z8CHT9Bdi25YW1e/J7eYQG5zs0A+nRO+uss1XN26DZudCY es5LXtmiRiqOk5fOj991AwO1+c2u4ueHIXzdg6kE= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20210427081814eucas1p1526248e463d4151ba0e4fa71e0ecbc75~5qR_XmA1X0352703527eucas1p1J; Tue, 27 Apr 2021 08:18:14 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id DF.56.09444.6C8C7806; Tue, 27 Apr 2021 09:18:14 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20210427081813eucas1p2a3ca16a3a6cdddbf50276d28b4211489~5qR94-q731032210322eucas1p2V; Tue, 27 Apr 2021 08:18:13 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20210427081813eusmtrp21a8ebea2b2405264cc341f90c17f54ae~5qR94Ou0X2209022090eusmtrp2X; Tue, 27 Apr 2021 08:18:13 +0000 (GMT) X-AuditID: cbfec7f4-dbdff700000024e4-64-6087c8c69b9e Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 61.96.08705.5C8C7806; Tue, 27 Apr 2021 09:18:13 +0100 (BST) Received: from [106.210.134.141] (unknown [106.210.134.141]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20210427081812eusmtip133f6b58731c3349de435b0e00a91b1ee~5qR9Fq63m1809918099eusmtip1Q; Tue, 27 Apr 2021 08:18:12 +0000 (GMT) Subject: Re: [PATCH 58/78] media: exynos-gsc: use pm_runtime_resume_and_get() To: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Ezequiel Garcia , Hans Verkuil , Krzysztof Kozlowski , Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org From: Sylwester Nawrocki Message-ID: Date: Tue, 27 Apr 2021 10:18:12 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <9c7d683907b9f9cf4a99f57f978671ec7f5a1dbc.1619191723.git.mchehab+huawei@kernel.org> Content-Language: en-US Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrOKsWRmVeSWpSXmKPExsWy7djP87rHTrQnGMw9y2qxc8MXdouLM++y WJw/v4HdYtPja6wWl3fNYbPo2bCV1WLG+X1MFoc3nmGyaFtwmc3i4eyrjBbLNv1hcuD22HF3 CaNHy5G3rB6bVnWyeWxeUu/xeZOcx6mvn9kD2KK4bFJSczLLUov07RK4Mr5fbmQsaOWrmLPl DlMD41vuLkZODgkBE4nd536xdTFycQgJrGCUmPLrDDuE84VRYv3Ue1DOZ0aJWZMesMO0nDq/ hBkisZxRom/yGkYI5yOjxIwNx1hAqoQF/CU2PX7GCmKLCJhK3HzVyQRiMws8YpI4O0EWxGYT MJToPdrHCGLzCthJ/P3+D6yXRUBV4tzB3cwgtqhAssT5x1fZIWoEJU7OfAJWwymQIHFz8kIW iJniEreezIeaLy+x/e0csOskBNo5JWZ8O8wGcbaLxKmumUwQtrDEq+NboN6Rkfi/E6QZpKGZ UaJn9212C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Hu1jBLF5Bewk/n7/xwJiswioSpw7 uBtsqqhAssTq35tZIWoEJU7OfAJWwymQIHFz8kIwm1lAXeLPvEvMELa4xK0n85kgbHmJ7W/n ME9gFJqFpH0WkpZZSFpmIWlZwMiyilEktbQ4Nz232FCvODG3uDQvXS85P3cTIzBKtx37uXkH 47xXH/UOMTJxMB5ilOBgVhLhZdvVmiDEm5JYWZValB9fVJqTWnyI0RTon4nMUqLJ+cA0kVcS b2hmYGpoYmZpYGppZqwkzrt17pp4IYH0xJLU7NTUgtQimD4mDk6pBqY9we33zzHyFC5eYrQl 95R+Zq9pjO6Gv62dghLHp1gf78yudzc6vJPHTuTY/El6789M3FZc9o/nzz3Oh0zqpUanb518 fKG3on2Bx8u6Y/K8qxhezre4vv/Gl44Dd546pH3aIZ9muaf7jXJ07iarmyqtSd6hHx/FVbJY zbD837L90OYdvKfbLJm9bD2Cua//fuEqLMjvvvpz4nldnj0z5rxuV2xosog+2y3MlPmm/tHn Gc8zu6JLJr+5dlrgXe/q9ZVn3jwTvKIzSXGS2vrufaxL+JzmhP+4W7LB6d+zBRuXc2jJGlnt PxJ26eLi+9yPOxbXzVorJ5O855HW0fYbXAyO+keKZx6zr865t25R3eVUJZbijERDLeai4kQA 5ySSN1sDAAA= X-CMS-MailID: 20210427081813eucas1p2a3ca16a3a6cdddbf50276d28b4211489 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20210424064556eucas1p1e89378837c377168c9782b4172e70482 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20210424064556eucas1p1e89378837c377168c9782b4172e70482 References: <9c7d683907b9f9cf4a99f57f978671ec7f5a1dbc.1619191723.git.mchehab+huawei@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24.04.2021 08:45, Mauro Carvalho Chehab wrote: > Commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter") > added pm_runtime_resume_and_get() in order to automatically handle > dev->power.usage_count decrement on errors. > > Use the new API, in order to cleanup the error check logic. > > Signed-off-by: Mauro Carvalho Chehab > --- > drivers/media/platform/exynos-gsc/gsc-core.c | 3 +-- > drivers/media/platform/exynos-gsc/gsc-m2m.c | 2 +- > 2 files changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c > index 9f41c2e7097a..9d5841194f6b 100644 > --- a/drivers/media/platform/exynos-gsc/gsc-core.c > +++ b/drivers/media/platform/exynos-gsc/gsc-core.c > @@ -1210,7 +1210,7 @@ static int gsc_remove(struct platform_device *pdev) > struct gsc_dev *gsc = platform_get_drvdata(pdev); > int i; > > - pm_runtime_get_sync(&pdev->dev); > + pm_runtime_resume_and_get(&pdev->dev); > > gsc_unregister_m2m_device(gsc); > v4l2_device_unregister(&gsc->v4l2_dev); > @@ -1219,7 +1219,6 @@ static int gsc_remove(struct platform_device *pdev) > for (i = 0; i < gsc->num_clocks; i++) > clk_disable_unprepare(gsc->clock[i]); > > - pm_runtime_put_noidle(&pdev->dev); If we do this then the device usage count will not get decremented after the pm_runtime_resume_and_get() call above and after driver unload/load cycle it will not be possible to suspend the device. I wouldn't be changing anything in gsc_remove(), pm_runtime_get_sync() works better in that case. Regards, Sylwester > pm_runtime_disable(&pdev->dev); > > dev_dbg(&pdev->dev, "%s driver unloaded\n", pdev->name