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 E4F7BD6D22F for ; Thu, 18 Dec 2025 14:55:45 +0000 (UTC) Received: from kara.freedesktop.org (unknown [131.252.210.166]) by gabe.freedesktop.org (Postfix) with ESMTPS id B9FA910EA1F; Thu, 18 Dec 2025 14:55:45 +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="sBEbtPot"; dkim-atps=neutral Received: from kara.freedesktop.org (localhost [127.0.0.1]) by kara.freedesktop.org (Postfix) with ESMTP id C008645649; Thu, 18 Dec 2025 14:48:14 +0000 (UTC) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=lists.freedesktop.org; s=20240201; t=1766069294; b=ZaXOBt5SotfItfheRP/7nSiNjHiRnYhcP/Hhiy+UR/VEfUKugIgyLSS6Symf+a1rUsjW+ bs3kSL1pMuLP/kmcAZ+PkBvx2fEV/G3xl18/QEO8C7S9jbbXsYtRU72gfEg+GYX1B52EA+6 oV5/MkPyTOGqJv6VsB04JW2oNekDxnd93XUdaP60SwaCcUB6B8i/JtnGCJAElxP5OZj3MnB CHnQ1qHbIL+W3MqBIy6hbkog7iw7IW1iDw4Q9VMSaVGIYE4Svcow8XnlxQIe1eHeGzqIAwR A1TJzzv6Td5U9fvvzdlsoNz18WwV1Q3Xi87jvNvs3V1db25P93b7unjeV9kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.freedesktop.org; s=20240201; t=1766069294; 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=vgIb/JAKdJ9AMUp0JYBMyMI1p+JfdQH1RwjrrN6xlRY=; b=zlBaPWJsZA9/1BTY+QOjGL9c6lFGEVl5VHv5e+/45/6emvABKoAjSw775xl0nsnI+Ohwz 2kqADMAppWJ9kr5TM9uuxmOqM55oKVVjb2iNXWK59wVT5v6Oo9bn2AKIWq+4fSy9TwFPN2A IWujztkOYogKQo/HBuWzOk0MSMOEK2Q7UndB+RtXWwvuoyWYlaG/NhIyi2sKBIx+AD2GVGs tP8+RNz4kpybhXVys3w90d8DPevMvEbjRxm7w9S8/sbdltO/k+l/lbXL4l0nKKt924fpJ55 5LVbLkW7W+PagGHj+AtwKImQTFgoOQ2F9kSmtj0pi8WlV6gYjKYn+z6/0H6w== 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 906FF45667 for ; Thu, 18 Dec 2025 08:53:50 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id B980E10E888 for ; Thu, 18 Dec 2025 09:01:20 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id F250160010; Thu, 18 Dec 2025 09:01:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26A25C4CEFB; Thu, 18 Dec 2025 09:01:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1766048479; bh=afeAQJRCnu4GRHnu5E5kfLOK1xWhPyYLbd+eFtITJ+w=; h=Date:Subject:Cc:To:From:References:In-Reply-To:From; b=sBEbtPotMzYJvW58gLZbIA2sN4jEkILwBFePD5sTuF8TqonBXGW4QYxLuCvusY7gI U/9bFCey1JZhHUyfb5zyHXNcyvVxlwjRjmlww/6IflJuJNGwsEC/y8AVlPNB/aPCPW PL4oG/YylRUKKTfgypYpUN0FpISqhjrmlI7GGLZ0MQuu6TRQvwvvRfSJiqwSVIyXQA RSE6QRmp5bWu1VeRhsshxE9wNCD2Yi34uah2mTiTbugyZqE8mRdZ3ZNk/Mbk/nc4zN GfmFcosRvKDbOv0MXWQLFV22MashEyvjpmIk0oaB+jaywLnt760m1oArdLowTi9ipo tz3m4ksujvphQ== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 18 Dec 2025 10:01:16 +0100 Message-Id: Subject: Re: [PATCH v3 5/9] gpu: nova-core: Replace module_pci_driver! with explicit module init To: "Timur Tabi" From: "Danilo Krummrich" References: <20251218013910.459045-1-ttabi@nvidia.com> <20251218013910.459045-6-ttabi@nvidia.com> In-Reply-To: <20251218013910.459045-6-ttabi@nvidia.com> X-MailFrom: dakr@kernel.org X-Mailman-Rule-Hits: implicit-dest X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header Message-ID-Hash: PIQ7WBSZEVHHBDG3WMF4PBPGMBBG72PH X-Message-ID-Hash: PIQ7WBSZEVHHBDG3WMF4PBPGMBBG72PH X-Mailman-Approved-At: Thu, 18 Dec 2025 14:48:10 +0000 CC: Gary Guo , rust-for-linux@vger.kernel.org, Joel Fernandes , Alexandre Courbot , nouveau@lists.freedesktop.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 Thu Dec 18, 2025 at 2:39 AM CET, Timur Tabi wrote: > diff --git a/drivers/gpu/nova-core/nova_core.rs b/drivers/gpu/nova-core/n= ova_core.rs > index b98a1c03f13d..01353be103ca 100644 > --- a/drivers/gpu/nova-core/nova_core.rs > +++ b/drivers/gpu/nova-core/nova_core.rs > @@ -2,6 +2,9 @@ > =20 > //! Nova Core GPU Driver > =20 > +use kernel::{error::Error, pci, prelude::*, InPlaceModule}; > +use pin_init::{PinInit, pinned_drop}; Please use kernel vertical style [1]. [1] https://docs.kernel.org/rust/coding-guidelines.html#imports > + > #[macro_use] > mod bitfield; > =20 > @@ -21,13 +24,27 @@ > =20 > pub(crate) const MODULE_NAME: &kernel::str::CStr =3D ::NAME; > =20 > -kernel::module_pci_driver! { > - type: driver::NovaCore, > +#[pin_data(PinnedDrop)] > +struct NovaCoreModule { > + #[pin] > + _driver: kernel::driver::Registration= >, > +} > + > +impl InPlaceModule for NovaCoreModule { > + fn init(module: &'static kernel::ThisModule) -> impl PinInit { > + pr_info!("NovaCore GPU driver loaded\n"); Please don't add such print statements, drivers should be silent when they = work properly. > + try_pin_init!(Self { > + _driver <- kernel::driver::Registration::new(MODULE_NAME, mo= dule), > + }) > + } > +} > + > +module! { > + type: NovaCoreModule, > name: "NovaCore", > authors: ["Danilo Krummrich"], > description: "Nova Core GPU driver", > license: "GPL v2", > - firmware: [], This change seems unrelated, please send a separate patch for this. > } > =20 > kernel::module_firmware!(firmware::ModInfoBuilder); > --=20 > 2.52.0 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 1067B23F27B for ; Thu, 18 Dec 2025 09:01:19 +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=1766048480; cv=none; b=AoBtJ3v/QP1ANigoYj2I49Dme5aHa2ZHOwu4MsfQma2MCxXRKfWYvgu5om2T8g7Z4aGHqGkmGeTFMDdPA03QnueH3VneuTaM2KHimD3iFcdCVwInO2ICLwtXVqTruRTgbGkCQ8pkj/FHUNqJwdu8DVvS3V0u1Xe7Yhufek7K5Wc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766048480; c=relaxed/simple; bh=afeAQJRCnu4GRHnu5E5kfLOK1xWhPyYLbd+eFtITJ+w=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:Cc:To:From: References:In-Reply-To; b=TTLagifp/+Y2WSXqKEnkHJCK7/WJq5osy9PF85IO5s2sWvBMvhu4Fj3A8U2pNyeFOl1OQN5KkYT8GJFvQ2+dQrcp6M2RkZIH6AncSROxf+VO4PlejMIt9A13eqGZNEz0fINIMXk+ylKYQDpbBs/blKVZL0zUZvpdF4j1NBLgnbs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sBEbtPot; 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="sBEbtPot" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26A25C4CEFB; Thu, 18 Dec 2025 09:01:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1766048479; bh=afeAQJRCnu4GRHnu5E5kfLOK1xWhPyYLbd+eFtITJ+w=; h=Date:Subject:Cc:To:From:References:In-Reply-To:From; b=sBEbtPotMzYJvW58gLZbIA2sN4jEkILwBFePD5sTuF8TqonBXGW4QYxLuCvusY7gI U/9bFCey1JZhHUyfb5zyHXNcyvVxlwjRjmlww/6IflJuJNGwsEC/y8AVlPNB/aPCPW PL4oG/YylRUKKTfgypYpUN0FpISqhjrmlI7GGLZ0MQuu6TRQvwvvRfSJiqwSVIyXQA RSE6QRmp5bWu1VeRhsshxE9wNCD2Yi34uah2mTiTbugyZqE8mRdZ3ZNk/Mbk/nc4zN GfmFcosRvKDbOv0MXWQLFV22MashEyvjpmIk0oaB+jaywLnt760m1oArdLowTi9ipo tz3m4ksujvphQ== 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: Thu, 18 Dec 2025 10:01:16 +0100 Message-Id: Subject: Re: [PATCH v3 5/9] gpu: nova-core: Replace module_pci_driver! with explicit module init Cc: "Gary Guo" , , "John Hubbard" , "Joel Fernandes" , "Alexandre Courbot" , "Lyude Paul" , To: "Timur Tabi" From: "Danilo Krummrich" References: <20251218013910.459045-1-ttabi@nvidia.com> <20251218013910.459045-6-ttabi@nvidia.com> In-Reply-To: <20251218013910.459045-6-ttabi@nvidia.com> On Thu Dec 18, 2025 at 2:39 AM CET, Timur Tabi wrote: > diff --git a/drivers/gpu/nova-core/nova_core.rs b/drivers/gpu/nova-core/n= ova_core.rs > index b98a1c03f13d..01353be103ca 100644 > --- a/drivers/gpu/nova-core/nova_core.rs > +++ b/drivers/gpu/nova-core/nova_core.rs > @@ -2,6 +2,9 @@ > =20 > //! Nova Core GPU Driver > =20 > +use kernel::{error::Error, pci, prelude::*, InPlaceModule}; > +use pin_init::{PinInit, pinned_drop}; Please use kernel vertical style [1]. [1] https://docs.kernel.org/rust/coding-guidelines.html#imports > + > #[macro_use] > mod bitfield; > =20 > @@ -21,13 +24,27 @@ > =20 > pub(crate) const MODULE_NAME: &kernel::str::CStr =3D ::NAME; > =20 > -kernel::module_pci_driver! { > - type: driver::NovaCore, > +#[pin_data(PinnedDrop)] > +struct NovaCoreModule { > + #[pin] > + _driver: kernel::driver::Registration= >, > +} > + > +impl InPlaceModule for NovaCoreModule { > + fn init(module: &'static kernel::ThisModule) -> impl PinInit { > + pr_info!("NovaCore GPU driver loaded\n"); Please don't add such print statements, drivers should be silent when they = work properly. > + try_pin_init!(Self { > + _driver <- kernel::driver::Registration::new(MODULE_NAME, mo= dule), > + }) > + } > +} > + > +module! { > + type: NovaCoreModule, > name: "NovaCore", > authors: ["Danilo Krummrich"], > description: "Nova Core GPU driver", > license: "GPL v2", > - firmware: [], This change seems unrelated, please send a separate patch for this. > } > =20 > kernel::module_firmware!(firmware::ModInfoBuilder); > --=20 > 2.52.0