From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0C5FFC98318 for ; Sat, 17 Jan 2026 11:24:10 +0000 (UTC) Received: from kara.freedesktop.org (unknown [131.252.210.166]) by gabe.freedesktop.org (Postfix) with ESMTPS id E47AC10E0D5; Sat, 17 Jan 2026 11:24:08 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="JadbjWt8"; dkim-atps=neutral Received: from kara.freedesktop.org (localhost [127.0.0.1]) by kara.freedesktop.org (Postfix) with ESMTP id 5EDC244CB4; Sat, 17 Jan 2026 11:15:31 +0000 (UTC) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=lists.freedesktop.org; s=20240201; t=1768648531; b=B6X7vRbtKheufIMh0Z5tIXhoSS349yVtXyM64Soxwj8lRVBXgaWAzX3OMd0/Z/lsx208/ 1NTdK3/ztMZoXbUMCVgMzL713U/Ez8iuBNpWLRpHn0XuX2nZ2EH7/YozzoYE1splWI7WRot RMGFsLdictC4ijkSaamTBb+dvaPhrTGURAFEJseDJOmKZQkVq5YRgc6aELNYouCS36/wfv6 NuoFdbYyXYjTMcUtghzxPDKzsGl2q6yoMfPcjMtwlxQmC2K0gO49DOYkkahhiclmFUM8utF d/EKRZbDx+35H8KWEq1Q297hWNjUEvuMWTFfY/Cu72H0WKq9I9wGyzqx1qGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.freedesktop.org; s=20240201; t=1768648531; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=sdUdwh0/kELsmG/W/xSwG0nO6D8TCJ0rO7FAQ1hzi6I=; b=xGmiCinjNxRWofzq0dfC8vvvoiNlvuxhoOwKs4PYepDbEUrap32QUhj7HE012ECDVg3t4 HTbQ9L4KTXsHdoMiD2v3ZgqeTSk1Sx0s8n4eF1rgrL+mYIdeWob+jhot2YfErO+wkGEWq/u t1YkzmiQop76eR/swimh4bBFCBPm4aH4A0VFxM/qCyTiALbvhUBUK7/MNRPdjz6wrN36vOW bQNkJkJXWI7xUo9OIjElgggDw34vXcYf4kdJVdAwa1YpLwrsStEACBeNGd2Mb0TctUw83iJ 4yVTsro7GKGN/CzJV43Hk46POwXoe2HWAhHFPuspSXenaNtmzULN98u95zYw== ARC-Authentication-Results: i=1; mail.freedesktop.org; dkim=pass header.d=kernel.org; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=kernel.org policy.dmarc=quarantine Authentication-Results: mail.freedesktop.org; dkim=pass header.d=kernel.org; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=kernel.org policy.dmarc=quarantine Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by kara.freedesktop.org (Postfix) with ESMTPS id 197DD44C9B for ; Sat, 17 Jan 2026 11:15:29 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6BEFA10E081 for ; Sat, 17 Jan 2026 11:24:06 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 3366840C13; Sat, 17 Jan 2026 11:24:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86E6EC4CEF7; Sat, 17 Jan 2026 11:24:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768649046; bh=y1VqaXEkPKmolU8tuUd7ehCwYdrV2lX2sTBowpAwuGE=; h=Date:Subject:Cc:To:From:References:In-Reply-To:From; b=JadbjWt8wCHgJkTrvTK+O2Xf7dHwdsca3hEosLp8S7+IqgMtVQmW+ukBAISkpZ0xp 2/vvvXZVXu6I0vK41Al3PRhYFrpeMARqmpx535iqVdHDcfzbKshyVsr+DZsRpGQ0fv gK5ifup+WWV1K25heb2ygdldWiEFJOuJOT+lUSVIF9PKHAYdZo0nA92kuXSFsBOBUf 9awmRbPKrBKg5pSBeYNEBvDY4K3HKdlgczx1m+/HdWXLiv7B73GiQ+o6zELGMWHD0K pQfubArMSP/t+p50OkZ/urj5k+iQBJ9Gn0ZWMW84JYc62KwALaj9WF6or4vBvOBZQI Yx20OVzQsWUOQ== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sat, 17 Jan 2026 12:24:02 +0100 Message-Id: Subject: Re: [PATCH v5 5/8] gpu: nova-core: Replace module_pci_driver! with explicit module init To: "Timur Tabi" From: "Danilo Krummrich" References: <20260116214959.641032-1-ttabi@nvidia.com> <20260116214959.641032-6-ttabi@nvidia.com> In-Reply-To: <20260116214959.641032-6-ttabi@nvidia.com> Message-ID-Hash: E2UI6NJDPYLKGGGRAE2RMLLVSU4Q447X X-Message-ID-Hash: E2UI6NJDPYLKGGGRAE2RMLLVSU4Q447X X-MailFrom: dakr@kernel.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation CC: Matthew Maurer , Gary Guo , Joel Fernandes , Alexandre Courbot , nouveau@lists.freedesktop.org, rust-for-linux@vger.kernel.org X-Mailman-Version: 3.3.8 Precedence: list List-Id: Nouveau development list Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Fri Jan 16, 2026 at 10:49 PM CET, Timur Tabi wrote: > Replace the module_pci_driver! macro with an explicit module > initialization using the standard module! macro and InPlaceModule > trait implementation. No functional change intended, with the > exception that the driver now prints a message when loaded. > > This change is necessary so that we can create a top-level "nova_core" > debugfs entry when the driver is loaded. > > Signed-off-by: Timur Tabi > --- > drivers/gpu/nova-core/nova_core.rs | 26 +++++++++++++++++++++++--- > 1 file changed, 23 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/nova-core/nova_core.rs b/drivers/gpu/nova-core/n= ova_core.rs > index c1121e7c64c5..d0df8db3693d 100644 > --- a/drivers/gpu/nova-core/nova_core.rs > +++ b/drivers/gpu/nova-core/nova_core.rs > @@ -2,6 +2,13 @@ > =20 > //! Nova Core GPU Driver > =20 > +use kernel::{ > + error::Error, This should be covered by prelude. > + pci, > + prelude::*, > + InPlaceModule, // > +}; > + > #[macro_use] > mod bitfield; > =20 > @@ -20,13 +27,26 @@ > =20 > pub(crate) const MODULE_NAME: &kernel::str::CStr =3D ::NAME; > =20 > -kernel::module_pci_driver! { > - type: driver::NovaCore, > +#[pin_data] > +struct NovaCoreModule { > + #[pin] > + _driver: kernel::driver::Registration= >, Let's import driver, such that this becomes driver::Registration<_>. > +} > + > +impl InPlaceModule for NovaCoreModule { > + fn init(module: &'static kernel::ThisModule) -> impl PinInit { > + try_pin_init!(Self { > + _driver <- kernel::driver::Registration::new(MODULE_NAME, mo= dule), Same here. > + }) > + } > +} > + > +module! { > + type: NovaCoreModule, > name: "NovaCore", > authors: ["Danilo Krummrich"], > description: "Nova Core GPU driver", > license: "GPL v2", > - firmware: [], Should be a separate patch. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 779162D1F64 for ; Sat, 17 Jan 2026 11:24:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768649046; cv=none; b=OrIJwpkY7RtVsmFFQqcgJM9XtzWZrVTKGIYUoKwm2Jrz1wsjHdGrkebRmhJR5J4+RivzGVjHUqj5cdAjX3/EWSoijiq2qniu/42oGtxXW8oiltUmG/7JTh1CelmZ76yG2rL/KTgm1lKtq76uYoESrw3Rs23l51I5LGYkJ1IC6JI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768649046; c=relaxed/simple; bh=y1VqaXEkPKmolU8tuUd7ehCwYdrV2lX2sTBowpAwuGE=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:Cc:To:From: References:In-Reply-To; b=U6H0gx663AsEqCq0u2G8VTxwDSihOZyLRDrGxeQ9tPSHUEDxKOxSymxI0nkRKcvJ5dOBJP+gMJydvkBZlWL6Tl2u43kCafxRzMB7jUBemYlBjO/Hs0xEj6+yiSb/TZLVroVqREJxPLbifjPmuqKNZ8opWp6e6boIZiZxOBxkurU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JadbjWt8; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JadbjWt8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86E6EC4CEF7; Sat, 17 Jan 2026 11:24:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768649046; bh=y1VqaXEkPKmolU8tuUd7ehCwYdrV2lX2sTBowpAwuGE=; h=Date:Subject:Cc:To:From:References:In-Reply-To:From; b=JadbjWt8wCHgJkTrvTK+O2Xf7dHwdsca3hEosLp8S7+IqgMtVQmW+ukBAISkpZ0xp 2/vvvXZVXu6I0vK41Al3PRhYFrpeMARqmpx535iqVdHDcfzbKshyVsr+DZsRpGQ0fv gK5ifup+WWV1K25heb2ygdldWiEFJOuJOT+lUSVIF9PKHAYdZo0nA92kuXSFsBOBUf 9awmRbPKrBKg5pSBeYNEBvDY4K3HKdlgczx1m+/HdWXLiv7B73GiQ+o6zELGMWHD0K pQfubArMSP/t+p50OkZ/urj5k+iQBJ9Gn0ZWMW84JYc62KwALaj9WF6or4vBvOBZQI Yx20OVzQsWUOQ== Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sat, 17 Jan 2026 12:24:02 +0100 Message-Id: Subject: Re: [PATCH v5 5/8] gpu: nova-core: Replace module_pci_driver! with explicit module init Cc: "Matthew Maurer" , "Gary Guo" , "John Hubbard" , "Joel Fernandes" , "Alexandre Courbot" , , To: "Timur Tabi" From: "Danilo Krummrich" References: <20260116214959.641032-1-ttabi@nvidia.com> <20260116214959.641032-6-ttabi@nvidia.com> In-Reply-To: <20260116214959.641032-6-ttabi@nvidia.com> On Fri Jan 16, 2026 at 10:49 PM CET, Timur Tabi wrote: > Replace the module_pci_driver! macro with an explicit module > initialization using the standard module! macro and InPlaceModule > trait implementation. No functional change intended, with the > exception that the driver now prints a message when loaded. > > This change is necessary so that we can create a top-level "nova_core" > debugfs entry when the driver is loaded. > > Signed-off-by: Timur Tabi > --- > drivers/gpu/nova-core/nova_core.rs | 26 +++++++++++++++++++++++--- > 1 file changed, 23 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/nova-core/nova_core.rs b/drivers/gpu/nova-core/n= ova_core.rs > index c1121e7c64c5..d0df8db3693d 100644 > --- a/drivers/gpu/nova-core/nova_core.rs > +++ b/drivers/gpu/nova-core/nova_core.rs > @@ -2,6 +2,13 @@ > =20 > //! Nova Core GPU Driver > =20 > +use kernel::{ > + error::Error, This should be covered by prelude. > + pci, > + prelude::*, > + InPlaceModule, // > +}; > + > #[macro_use] > mod bitfield; > =20 > @@ -20,13 +27,26 @@ > =20 > pub(crate) const MODULE_NAME: &kernel::str::CStr =3D ::NAME; > =20 > -kernel::module_pci_driver! { > - type: driver::NovaCore, > +#[pin_data] > +struct NovaCoreModule { > + #[pin] > + _driver: kernel::driver::Registration= >, Let's import driver, such that this becomes driver::Registration<_>. > +} > + > +impl InPlaceModule for NovaCoreModule { > + fn init(module: &'static kernel::ThisModule) -> impl PinInit { > + try_pin_init!(Self { > + _driver <- kernel::driver::Registration::new(MODULE_NAME, mo= dule), Same here. > + }) > + } > +} > + > +module! { > + type: NovaCoreModule, > name: "NovaCore", > authors: ["Danilo Krummrich"], > description: "Nova Core GPU driver", > license: "GPL v2", > - firmware: [], Should be a separate patch.