From: Thomas Zimmermann <tzimmermann@suse.de>
To: Klara Modin <klarasmodin@gmail.com>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Danilo Krummrich <dakr@kernel.org>,
Alice Ryhl <aliceryhl@google.com>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Mukul Joshi" <mukul.joshi@amd.com>,
"Felix Kuehling" <felix.kuehling@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Thorsten Leemhuis" <linux@leemhuis.info>,
"Manuel Ebner" <manuelebner@mailbox.org>,
"Gary Guo" <gary@garyguo.net>,
dri-devel@lists.freedesktop.org, rust-for-linux@vger.kernel.org,
amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rust/drm/gem: initialize callbacks with ..pin_init::zeroed()
Date: Wed, 9 Sep 2026 10:01:23 +0200 [thread overview]
Message-ID: <2642740a-b894-47bd-b26e-cabdaa14d8b8@suse.de> (raw)
In-Reply-To: <20260908175427.47207-1-klarasmodin@gmail.com>
Hi
Am 08.09.26 um 19:54 schrieb Klara Modin:
> When the commit b67d2d039f64 ("drm/gem: Add callback for when handle
> count goes to 0") added the handle_free callback, it did not update the
> rust abstraction, which will cause a build failure when that is enabled.
> Rather than just adding another None initializer, use
> ..pin_init::zeroed() to make all unlisted callbacks None, and remove the
> existing None-initializations.
>
> Fixes: b67d2d039f64 ("drm/gem: Add callback for when handle count goes to 0")
> Reported-by: Thorsten Leemhuis <linux@leemhuis.info>
> Closes: https://lore.kernel.org/all/aaef18cd-ab55-4fb8-8563-ca3a5ea9cbc6@leemhuis.info
> Suggested-by: Gary Guo <gary@garyguo.net>
> Signed-off-by: Klara Modin <klarasmodin@gmail.com>
Please see my bug report at [1]. This patch fixes half of it. I still get
error[E0063]: missing field `handle_free` in initializer of
`drm_gem_object_funcs`
--> /home/tzimmermann/Projekte/linux/rust/kernel/drm/gem/shmem.rs:130:52
|
130 | const VTABLE: bindings::drm_gem_object_funcs =
bindings::drm_gem_object_funcs {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `handle_free`
error: aborting due to 1 previous error
[1]
https://lore.kernel.org/dri-devel/CANiq72mUW5d1dOQDgpYjuKoUaZAi-im7j3v30Wd4KTDznmM9zw@mail.gmail.com/T/#r8f10eefc91d3bbce58869433b8258882c2d19ff5
Best regards
Thomas
> ---
> rust/kernel/drm/gem/mod.rs | 12 +-----------
> 1 file changed, 1 insertion(+), 11 deletions(-)
>
> diff --git a/rust/kernel/drm/gem/mod.rs b/rust/kernel/drm/gem/mod.rs
> index 80d8f524f9d5..af8274134a71 100644
> --- a/rust/kernel/drm/gem/mod.rs
> +++ b/rust/kernel/drm/gem/mod.rs
> @@ -266,18 +266,8 @@ impl<T: DriverObject, Ctx: DeviceContext> Object<T, Ctx> {
> free: Some(Self::free_callback),
> open: Some(open_callback::<T>),
> close: Some(close_callback::<T>),
> - print_info: None,
> - export: None,
> - pin: None,
> - unpin: None,
> - get_sg_table: None,
> - vmap: None,
> - vunmap: None,
> - mmap: None,
> - status: None,
> vm_ops: core::ptr::null_mut(),
> - evict: None,
> - rss: None,
> + ..pin_init::zeroed()
> };
>
> /// Returns the `Device` that owns this GEM object.
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, (HRB 36809, AG Nürnberg)
next prev parent reply other threads:[~2026-09-09 8:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-08 17:54 Klara Modin
[not found] ` <20260908180555.0830E1F00A3A@smtp.kernel.org>
2026-09-08 18:57 ` Klara Modin
2026-09-08 19:09 ` Klara Modin
2026-09-08 19:25 ` Klara Modin
2026-09-08 20:50 ` Gary Guo
2026-09-09 8:01 ` Thomas Zimmermann [this message]
2026-09-09 8:05 ` Miguel Ojeda
2026-09-09 8:11 ` Thomas Zimmermann
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=2642740a-b894-47bd-b26e-cabdaa14d8b8@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=aliceryhl@google.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=felix.kuehling@amd.com \
--cc=gary@garyguo.net \
--cc=klarasmodin@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@leemhuis.info \
--cc=manuelebner@mailbox.org \
--cc=mukul.joshi@amd.com \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=simona@ffwll.ch \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®