lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230510164330.z2ygkl7vws6fci75@pengutronix.de>
Date:   Wed, 10 May 2023 18:43:30 +0200
From:   Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
To:     Fei Shao <fshao@...omium.org>
Cc:     Hans Verkuil <hverkuil-cisco@...all.nl>,
        Andrew-CT Chen <andrew-ct.chen@...iatek.com>,
        AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Tiffany Lin <tiffany.lin@...iatek.com>,
        Yunfei Dong <yunfei.dong@...iatek.com>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-media@...r.kernel.org, linux-mediatek@...ts.infradead.org,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Pavel Machek <pavel@....cz>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH] media: mediatek: vcodec: Convert mtk_vcodec_dec_hw
 platform remove callback

[expanding the audience a bit for more expertise]

Hello,

On Wed, May 10, 2023 at 11:31:35PM +0800, Fei Shao wrote:
> This aligns with [1] and converts the platform remove callback to
> .remove_new(), which returns void.
> 
> [1]: commit a3afc5b10661 ("media: mtk_vcodec_dec_drv: Convert to
>      platform remove callback returning void")
> 
> Signed-off-by: Fei Shao <fshao@...omium.org>
> 
> ---
> 
>  drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c
> index b753bf54ebd9..bd5743723da6 100644
> --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c
> +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c
> @@ -193,16 +193,14 @@ static int mtk_vdec_hw_probe(struct platform_device *pdev)
>  	return ret;
>  }
>  
> -static int mtk_vdec_hw_remove(struct platform_device *pdev)
> +static void mtk_vdec_hw_remove(struct platform_device *pdev)
>  {
>  	pm_runtime_disable(&pdev->dev);
> -
> -	return 0;
>  }
>  
>  static struct platform_driver mtk_vdec_driver = {
>  	.probe	= mtk_vdec_hw_probe,
> -	.remove = mtk_vdec_hw_remove,
> +	.remove_new = mtk_vdec_hw_remove,
>  	.driver	= {
>  		.name	= "mtk-vdec-comp",
>  		.of_match_table = mtk_vdec_hw_match,

While the patch looks fine, I wonder if having a remove callback just to
do pm_runtime_disable() is worth keeping it. Doesn't the core care for
things like that? I grepped a bit around, device_unbind_cleanup() is
called after device_remove() which calls pm_runtime_reinit(). Does that
mean calling pm_runtime_disable in .remove() is useless? In that case,
you could just drop the .remove() callback.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ