lkml.org 
[lkml]   [2023]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [RFT PATCH 3/6] drm/vc4: Call drm_atomic_helper_shutdown() at shutdown time
    Hi,

    On Fri, Sep 1, 2023 at 4:40 PM Douglas Anderson <dianders@chromium.org> wrote:
    >
    > 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.
    >
    > Suggested-by: Maxime Ripard <mripard@kernel.org>
    > Signed-off-by: Douglas Anderson <dianders@chromium.org>
    > ---
    > This commit is only compile-time tested.
    >
    > Though this patch could be squashed into the patch ("drm: Call
    > drm_atomic_helper_shutdown() at shutdown time for misc drivers"), I
    > kept it separate to call attention to this driver. While writing this
    > patch, I noticed that the bind() function is using "devm" and thus
    > assumes it doesn't need to do much explicit error handling. That's
    > actually a bug. As per kernel docs [1] "the lifetime of the aggregate
    > driver does not align with any of the underlying struct device
    > instances. Therefore devm cannot be used and all resources acquired or
    > allocated in this callback must be explicitly released in the unbind
    > callback". Fixing that is outside the scope of this commit.
    >
    > [1] https://docs.kernel.org/driver-api/component.html
    >
    > drivers/gpu/drm/vc4/vc4_drv.c | 36 ++++++++++++++++++++++-------------
    > 1 file changed, 23 insertions(+), 13 deletions(-)

    Landed to drm-misc-next:

    013d382d11a2 drm/vc4: Call drm_atomic_helper_shutdown() at shutdown time

    \
     
     \ /
      Last update: 2023-09-21 20:47    [W:4.042 / U:0.236 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site