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: <5970528.lOV4Wx5bFT@jernej-laptop>
Date:   Tue, 05 Sep 2023 23:06:00 +0200
From:   Jernej Škrabec <jernej.skrabec@...il.com>
To:     dri-devel@...ts.freedesktop.org,
        Maxime Ripard <mripard@...nel.org>,
        Douglas Anderson <dianders@...omium.org>
Cc:     Douglas Anderson <dianders@...omium.org>, airlied@...il.com,
        airlied@...hat.com, alain.volmat@...s.st.com,
        alexander.deucher@....com, alexandre.belloni@...tlin.com,
        alison.wang@....com, bbrezillon@...nel.org,
        christian.koenig@....com, claudiu.beznea@...rochip.com,
        daniel@...ll.ch, drawat.floss@...il.com, javierm@...hat.com,
        jfalempe@...hat.com, jstultz@...gle.com,
        kong.kongxinwei@...ilicon.com, kraxel@...hat.com,
        linus.walleij@...aro.org, linux-arm-kernel@...ts.infradead.org,
        linux-hyperv@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-sunxi@...ts.linux.dev, liviu.dudau@....com,
        nicolas.ferre@...rochip.com, paul.kocialkowski@...tlin.com,
        sam@...nborg.org, samuel@...lland.org,
        spice-devel@...ts.freedesktop.org, stefan@...er.ch,
        suijingfeng@...ngson.cn, sumit.semwal@...aro.org,
        tiantao6@...ilicon.com, tomi.valkeinen@...asonboard.com,
        tzimmermann@...e.de, virtualization@...ts.linux-foundation.org,
        wens@...e.org, xinliang.liu@...aro.org, yongqin.liu@...aro.org,
        zackr@...are.com
Subject: Re: [RFT PATCH 2/6] drm: Call drm_atomic_helper_shutdown() at shutdown time
 for misc drivers

Dne sobota, 02. september 2023 ob 01:39:53 CEST je Douglas Anderson 
napisal(a):
> Based on grepping through the source code these drivers appear to be
> missing a call to drm_atomic_helper_shutdown() at system shutdown
> time. Among other things, this means that if a panel is in use that it
> won't be cleanly powered off at system shutdown time.
> 
> The fact that we should call drm_atomic_helper_shutdown() in the case
> of OS shutdown/restart comes straight out of the kernel doc "driver
> instance overview" in drm_drv.c.
> 
> All of the drivers in this patch were fairly straightforward to fix
> since they already had a call to drm_atomic_helper_shutdown() at
> remove/unbind time but were just lacking one at system shutdown. The
> only hitch is that some of these drivers use the component model to
> register/unregister their DRM devices. The shutdown callback is part
> of the original device. The typical solution here, based on how other
> DRM drivers do this, is to keep track of whether the device is bound
> based on drvdata. In most cases the drvdata is the drm_device, so we
> can just make sure it is NULL when the device is not bound. In some
> drivers, this required minor code changes. To make things simpler,
> drm_atomic_helper_shutdown() has been modified to consider a NULL
> drm_device as a noop in the patch ("drm/atomic-helper:
> drm_atomic_helper_shutdown(NULL) should be a noop").
> 
> Suggested-by: Maxime Ripard <mripard@...nel.org>
> Signed-off-by: Douglas Anderson <dianders@...omium.org>
> ---
> This commit is only compile-time tested.
> 
> Note that checkpatch yells that "drivers/gpu/drm/tiny/cirrus.c" is
> marked as 'obsolete', but it seems silly not to include the fix if
> it's already been written. If someone wants me to take that out,
> though, I can.
> 
>  drivers/gpu/drm/arm/display/komeda/komeda_drv.c | 9 +++++++++
>  drivers/gpu/drm/arm/display/komeda/komeda_kms.c | 7 +++++++
>  drivers/gpu/drm/arm/display/komeda/komeda_kms.h | 1 +
>  drivers/gpu/drm/arm/hdlcd_drv.c                 | 6 ++++++
>  drivers/gpu/drm/arm/malidp_drv.c                | 6 ++++++
>  drivers/gpu/drm/ast/ast_drv.c                   | 6 ++++++
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c    | 6 ++++++
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c       | 8 ++++++++
>  drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 6 ++++++
>  drivers/gpu/drm/hyperv/hyperv_drm_drv.c         | 6 ++++++
>  drivers/gpu/drm/logicvc/logicvc_drm.c           | 9 +++++++++
>  drivers/gpu/drm/loongson/lsdc_drv.c             | 6 ++++++
>  drivers/gpu/drm/mcde/mcde_drv.c                 | 9 +++++++++
>  drivers/gpu/drm/omapdrm/omap_drv.c              | 8 ++++++++
>  drivers/gpu/drm/qxl/qxl_drv.c                   | 7 +++++++
>  drivers/gpu/drm/sti/sti_drv.c                   | 7 +++++++
>  drivers/gpu/drm/sun4i/sun4i_drv.c               | 6 ++++++

For sun4i:
Tested-by: Jernej Skrabec <jernej.skrabec@...il.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@...il.com>

Best regards,
Jernej

>  drivers/gpu/drm/tiny/bochs.c                    | 6 ++++++
>  drivers/gpu/drm/tiny/cirrus.c                   | 6 ++++++
>  19 files changed, 125 insertions(+)



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ