All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Mike Lothian" <mike@fireburn.co.uk>
Cc: ojeda@kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 11/13] drm/vino: add the USB driver frontend
Date: Wed, 26 Aug 2026 17:01:33 +0000	[thread overview]
Message-ID: <20260826170134.0D6331F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260826163913.7052-12-mike@fireburn.co.uk>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Calling sleeping functions in Plane and CRTC atomic callbacks
- [Low] Non-compliant import formatting.
--

commit 8a75fe9a885fe8920f6bb62eb588d5aa17fbe92e
Author: Mike Lothian <mike@fireburn.co.uk>

drm/vino: add the USB driver frontend
    
Vino drives DisplayLink DL3 docks as ordinary DRM devices, replacing the
out-of-tree EVDI module and the closed-source DisplayLinkManager daemon.
It adds the probe lifecycle, places the device by family, and handles
presence and EDID workers off the probe path. Sinks that drop and return
quickly are absorbed to prevent dock-wide re-activations.

> diff --git a/drivers/gpu/drm/vino/vino.rs b/drivers/gpu/drm/vino/vino.rs
> new file mode 100644
> index 0000000000000..0813faa43c031
> --- /dev/null
> +++ b/drivers/gpu/drm/vino/vino.rs
> @@ -0,0 +1,1747 @@
> +// SPDX-License-Identifier: GPL-2.0
> +// SPDX-FileCopyrightText: Copyright (C) 2026 Mike Lothian
> +
> +//! DRM/KMS driver for DisplayLink DL3 docks.
> +//!
> +//! Vino drives the Dell Universal Dock D6000 using a clean-room implementation of its USB control,
> +//! HDCP authentication and compressed video protocols. Each device owns its control session and
> +//! exposes two atomic KMS pipelines backed by shmem GEM objects.
> +
> +use kernel::{
> +    alloc::flags::GFP_KERNEL,
> +    alloc::Flags,
> +    device::{self, Core},

[Severity: Low]
Does this import block violate the vertical import style requirement?

The kernel Rust coding guidelines strictly require a vertical import style
instead of nested brace groups.

[ ... ]


Also in drivers/gpu/drm/vino/drm_sink/mode_objects.rs:

[Severity: High]
Does this call read_cursor_bgra() in VinoPlane::atomic_update() from atomic
context?

VinoPlane::atomic_update():
    if let Ok(bgra) = read_cursor_bgra(fb, usize::from(w), usize::from(h)) {

read_cursor_bgra() allocates memory with GFP_KERNEL and invokes vmap(), both
of which can sleep. Plane and CRTC atomic callbacks run in atomic context
where sleeping is forbidden, which can cause kernel warnings and deadlocks.


[Severity: High]
Does queue_scanout() sleep here while in atomic context?

VinoPlane::atomic_update():
    data.queue_scanout(
        dev,
        fb,
        PendingScanout { ... },
    );

It acquires the data.shadow Mutex and calls SourceBindingCache::get(), which
allocates with GFP_KERNEL and calls vmap().


[Severity: High]
Does this acquire a sleeping Mutex inside VinoCrtc::atomic_enable()?

VinoCrtc::atomic_enable():
    let mut pinned = crtc.vblank_pinned.lock();

CRTC atomic callbacks run in atomic context where sleeping is forbidden.


[Severity: High]
Do these acquire multiple sleeping Mutexes inside VinoCrtc::atomic_disable()?

VinoCrtc::atomic_disable():
    drop(crtc.vblank_pinned.lock().take());
    ...
    data.pending_scanout.lock()[connector as usize] = None;
    data.settle_repaint.lock()[connector as usize] = None;
    data.shadow[connector as usize].lock().discard();

CRTC atomic callbacks run in atomic context, so acquiring sleeping locks here
is forbidden and can cause kernel warnings or deadlocks.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260826163913.7052-1-mike@fireburn.co.uk?part=11

  reply	other threads:[~2026-08-26 17:01 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-26 16:37 [PATCH v3 0/13] drm/vino: a Rust driver for DisplayLink DL3 docks Mike Lothian
2026-08-26 16:37 ` [PATCH v3 1/13] drm/vino: add the DL3 wire framing Mike Lothian
2026-08-26 16:37 ` [PATCH v3 2/13] drm/vino: add the USB transport Mike Lothian
2026-08-26 16:58   ` sashiko-bot
2026-08-26 16:37 ` [PATCH v3 3/13] drm/vino: add the crypto primitives and the HDCP 2.2 AKE Mike Lothian
2026-08-26 16:37 ` [PATCH v3 4/13] drm/vino: add the encrypted control plane Mike Lothian
2026-08-26 16:37 ` [PATCH v3 5/13] drm/vino: add the dock profiles Mike Lothian
2026-08-26 16:37 ` [PATCH v3 6/13] drm/vino: add the video codec Mike Lothian
2026-08-26 16:56   ` sashiko-bot
2026-08-26 16:37 ` [PATCH v3 7/13] drm/vino: add control-session bring-up Mike Lothian
2026-08-26 16:57   ` sashiko-bot
2026-08-26 16:37 ` [PATCH v3 8/13] drm/vino: add the KMS device and the atomic path Mike Lothian
2026-08-26 16:59   ` sashiko-bot
2026-08-26 16:37 ` [PATCH v3 9/13] drm/vino: add the dock activation and scanout path Mike Lothian
2026-08-26 16:59   ` sashiko-bot
2026-08-26 16:37 ` [PATCH v3 10/13] drm/vino: read the dock's firmware version, and update it over DFU Mike Lothian
2026-08-26 16:58   ` sashiko-bot
2026-08-26 16:37 ` [PATCH v3 11/13] drm/vino: add the USB driver frontend Mike Lothian
2026-08-26 17:01   ` sashiko-bot [this message]
2026-08-26 16:37 ` [PATCH v3 12/13] drm/vino: allow the driver to be built Mike Lothian
2026-08-26 17:04   ` sashiko-bot
2026-08-26 16:37 ` [PATCH v3 13/13] Documentation/gpu: document the Vino driver Mike Lothian
2026-08-26 17:10   ` sashiko-bot
2026-08-26 17:28   ` Randy Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260826170134.0D6331F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=mike@fireburn.co.uk \
    --cc=ojeda@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.