From nobody Thu Jun 11 01:40:33 2026 Received: from MW6PR02CU001.outbound.protection.outlook.com (mail-westus2azon11012054.outbound.protection.outlook.com [52.101.48.54]) (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 037A233BBD0; Fri, 17 Apr 2026 15:33:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.48.54 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776440019; cv=fail; b=SirdJDwcqXRFYTJM2gNU9Jjh7TxduQjaOgF/93OCkvxeVF30XfNQPIXSP5wXKmueM1sH4EQbhroh2UCf0VXSOYnjbcqqveUUKCWKMBfvkTJJ4iJQVV6bvIh30ntXNZhM8eBTG8k+rFvWzwi+wCI4AQqPPnhpHw6F1fjpaAVfUkc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776440019; c=relaxed/simple; bh=mBl6H9DXvweo1yoJQYyYzlE+DuI/s8k9XOKWjEBDLLE=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=HlfPEOPVvMGaMqvKmNbVcykl+lDUT5e9B51ADM02z/caSydG0VYGkTbCWt8ZDQqe/86Bx3gplmVCh5giG5rV1Y5DASf6z44+ro2n7ueVThUzB1jqfPh2g8QgcXXZ1V55fzGNJYGRDiXlnOK2zS73JJcG0a1JryhPOnBHiByIxWI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=aIFvvR2P; arc=fail smtp.client-ip=52.101.48.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="aIFvvR2P" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=U3niIko38qyHkqzFjBcw+jf494i2dOsnkgSNkVATFaGwlW8Ro0xvlxQG0V0dJL0mdQRrDzp9Iwr91Zh4k6qS5LPBzvU1GB2IxtM81TndJMCtTI/FjMNKlOOcm1lf6WOXcbc3QpZhx0sjd5XmXqCuzeMqbCZI9YmKfgHVCOC/nI/nn0CM1TdzAy5CCt0cWQ7zICsUvjAMUoEpibLo1URyKSzg6LKQ4WNTCz1fOeMIwWUXab2z2oEcLndAx1zhSpk4UBNhu5u1H/NqndRNiW1/7PZdhcpGAB3p4OFAP8TIyQIK/Oja74tUl7FDscBQEmCf/3jUUETXnTolJndNHtnTfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SdE0hiFNZoD2/5avIlk9I3tBhV7eKZ7QaryF5h05bAg=; b=MsGZt1dVlGh9FVZgoPt+IrR3KgWUKuU6j/g7v/JY7wXvBtZP+YrXgy/o/GU+6aHYJoC4agQzm6jwIPceseFgBvy142aNk0O1HFSDlu+sUUOs31ADdNEaEaaljHhrXeCeKIQzTNhVb1CqGF0w5L2MhLkwZegGQ6T+OZ+tchJ888ny6mbxkZ4xXvFIlwfl4ZpTkR0iuECpqx/AHGw0rR+d0pxHYs6G6SHCOh34//K+bq/MkXrBslKrXvX2zp6KsoHHt6mgsGLOUsHorRdAZEOrw6FHKH40CxCKqJuyPMlcQCcHJX2QL0glqOwiQ6JJSDMKwX7JHOGt/qEDuEMUPz//8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SdE0hiFNZoD2/5avIlk9I3tBhV7eKZ7QaryF5h05bAg=; b=aIFvvR2Pbfl5cC7R52vEiZ3VInIQP9s3WCVQnV7utbOTBkNwJI6/WWLWkn4t9MyFrCEkEHEaO6Y79vFAW5TZReF3R/Jt+MNfuKWSL9Ph405cNMgdDsjqT6VtBARd/721L7/nGx4oD8qyFxSyaX/k9FMJ9cheY6N2q3yY9rCtkizb6ZGqMwKqYbp67oOBKAyMLAiNp8wrVakfx6ZLm/LazmAqxNIkCfQMIe0bYOHt6LpsGjVEekGnlK5n24Tu9TNi9uNiyyF9YxTMkSkkVY6T71OajeZrASnXTXhYsp566Bewp2Ebb1DCt11b0j3WRE4PELgCnwSUdksk9BBO6NqOpg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BL0PR12MB2353.namprd12.prod.outlook.com (2603:10b6:207:4c::31) by DM3PR12MB9389.namprd12.prod.outlook.com (2603:10b6:0:46::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9818.25; Fri, 17 Apr 2026 15:33:35 +0000 Received: from BL0PR12MB2353.namprd12.prod.outlook.com ([fe80::99b:dcff:8d6d:78e0]) by BL0PR12MB2353.namprd12.prod.outlook.com ([fe80::99b:dcff:8d6d:78e0%4]) with mapi id 15.20.9818.023; Fri, 17 Apr 2026 15:33:35 +0000 From: Eliot Courtney Date: Sat, 18 Apr 2026 00:29:19 +0900 Subject: [PATCH v4 1/8] gpu: nova-core: gsp: add NV_STATUS error code bindings Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260418-rmcontrol-v4-1-fda8c76dbb95@nvidia.com> References: <20260418-rmcontrol-v4-0-fda8c76dbb95@nvidia.com> In-Reply-To: <20260418-rmcontrol-v4-0-fda8c76dbb95@nvidia.com> To: Danilo Krummrich , Alice Ryhl , Alexandre Courbot , David Airlie , Simona Vetter Cc: John Hubbard , Alistair Popple , Joel Fernandes , Timur Tabi , rust-for-linux@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Eliot Courtney X-Mailer: b4 0.15.2 X-ClientProxiedBy: TYXPR01CA0062.jpnprd01.prod.outlook.com (2603:1096:403:a::32) To BL0PR12MB2353.namprd12.prod.outlook.com (2603:10b6:207:4c::31) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL0PR12MB2353:EE_|DM3PR12MB9389:EE_ X-MS-Office365-Filtering-Correlation-Id: b36a8f75-ba4e-4249-eb54-08de9c96b019 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|376014|366016|1800799024|22082099003|18002099003|56012099003; X-Microsoft-Antispam-Message-Info: 91zW1ffOI9drU4ON7HpQHhN9iIJPTrzoSj7E+F6y2D32YkDQouH5MlwnQ4JEO6lZ0EZpR06rtWdp0j+Opdr4Hrb11VT9BKgF+BSJvXWslJ9/DppEmYIKDe3e4kUzvDfpps4/yegQbI9I3jLmkkfLYG3s3yV9iepE49i7k547Im9Cd2uQKaYlc1cxl3SQw1t+NRMtJPkD/aQsHLf+CXPKJUgXT5cclqDXmWdqPKiXa9chO/DMgw8GcFNHg/dRA6GJfo5tu5JSknFvv1JLo/b4zvSoGN2Ix9oOlZFeGFsmSKYiV4uQzQ38hnQY6ina1iyulryLQL0mvMWFVtdQ9QCVU8GVMhx5o8XJq7Frht43R0fAqtn2WH4Zb4+a4XRNFzQjEN2URaDJZujqQe2swLBY7Cps0hJe9BJ0xAOUVj8nO+EbFwdvpeDsqooLgpznkPskS9E5KQilhx7FOVJxgfMEfjZCyQPG9il3Sa40uLSJ/yVGCs7Qmqugo0pxKA+vmlWEAxs9izxnDxNx1Bcfbr3+13Q/MQQj8QskqNjcSS9/w63NGZjNyg0miqV3IfSMJ81nyMg/laeezJf7W8T1QL3LZN0PYI/AsXRJw8sW3sXKqFEoUqQUukjTG9eZ4ZRM2IM/LlQNODNokcb+1S+2kQwUqgEdTM7BKieCBmdiGvoZ6N5X1ov2GHFOr2wuMsVChH5FVykQ3RoMFJM19bRDCx4QUNWctVioE76Sdg4HXJaEz/4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR12MB2353.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(376014)(366016)(1800799024)(22082099003)(18002099003)(56012099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?T2RNMXdqbzFNTWF1NjZ1TW0vdlAvbUt2eTdjNjVrMmQ5NFdzM094Ynh0MlVs?= =?utf-8?B?UHZOS0NPNEwzamJ1T1Z0MnJ2N2xMZGNsNnR3NFNHalNveHVVNllTNGp4Wmxq?= =?utf-8?B?eitQVklobVdDYzRlbnhjeXdXVnhtY3NCbXBXdFVkcWlOT0w5cnVQS1ZyanpS?= =?utf-8?B?eXpDQlJ5cm1IQ0d4Uk13YzNSdXlZU1huM04zcXJsTUd5bmVIVmFHanJCdnA4?= =?utf-8?B?dzI3WnpLN2Fid3dqL1FjNVhZTXVrak8zWDI3bjVLVkR0RFUzUW1vS2dvaDB5?= =?utf-8?B?MXI2S2RBeUw4eTBkVGZ6bHZYbTFJSWFhWldoWkhKdmVZOTJYOHlOc2tXbXFF?= =?utf-8?B?U2F1OGptSmFKK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I3RW9pZ3BtS2hrZjRS?= =?utf-8?B?NXNSUWM5Z0ZMMlJtNHF1alY2RlNWRWJ5N04vZERKd3pmT3pFMnp4YzFEK09M?= =?utf-8?B?dDlsVVRsdi9EZzdvK20vRHA3SkJQUXB1MENUbk5yVnBoK0xQVnBEOW4zbTJD?= =?utf-8?B?SUt2YUhlNk5QcGthRUxEdVd4c2R1dlBoUHRNV1RMejQyRDJsMkpBL0x6NUhI?= =?utf-8?Q?1m8wshy/lnn5sUC6+eQWFBKlVQWMAkSQk4QuzZIHqyf5k?= X-MS-Exchange-AntiSpam-MessageData-1: P7XS6bAMvwR/Vg== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: b36a8f75-ba4e-4249-eb54-08de9c96b019 X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB2353.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Apr 2026 15:33:34.9306 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xti0vTbRxPFAToMR9mlpHqGa4Z4PFHvBGeDbRZ+ypMFPIwhYqKInCl81T27a4gcGJvepDi39WEPX1/4QnlBkww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB9389 Add bindgen generated constants for NV_STATUS. This is used for RM control messages and also generic RPC status. Reviewed-by: Joel Fernandes Signed-off-by: Eliot Courtney --- drivers/gpu/nova-core/gsp/fw/r570_144/bindings.rs | 144 ++++++++++++++++++= ++++ 1 file changed, 144 insertions(+) diff --git a/drivers/gpu/nova-core/gsp/fw/r570_144/bindings.rs b/drivers/gp= u/nova-core/gsp/fw/r570_144/bindings.rs index 334e8be5fde8..dd37a7fd58c6 100644 --- a/drivers/gpu/nova-core/gsp/fw/r570_144/bindings.rs +++ b/drivers/gpu/nova-core/gsp/fw/r570_144/bindings.rs @@ -379,6 +379,150 @@ pub struct NV2080_CTRL_CMD_FB_GET_FB_REGION_INFO_PARA= MS { pub __bindgen_padding_0: [u8; 4usize], pub fbRegion: [NV2080_CTRL_CMD_FB_GET_FB_REGION_FB_REGION_INFO; 16usiz= e], } +pub const NV_OK: _bindgen_ty_4 =3D 0; +pub const NV_ERR_GENERIC: _bindgen_ty_4 =3D 65535; +pub const NV_ERR_BROKEN_FB: _bindgen_ty_4 =3D 1; +pub const NV_ERR_BUFFER_TOO_SMALL: _bindgen_ty_4 =3D 2; +pub const NV_ERR_BUSY_RETRY: _bindgen_ty_4 =3D 3; +pub const NV_ERR_CALLBACK_NOT_SCHEDULED: _bindgen_ty_4 =3D 4; +pub const NV_ERR_CARD_NOT_PRESENT: _bindgen_ty_4 =3D 5; +pub const NV_ERR_CYCLE_DETECTED: _bindgen_ty_4 =3D 6; +pub const NV_ERR_DMA_IN_USE: _bindgen_ty_4 =3D 7; +pub const NV_ERR_DMA_MEM_NOT_LOCKED: _bindgen_ty_4 =3D 8; +pub const NV_ERR_DMA_MEM_NOT_UNLOCKED: _bindgen_ty_4 =3D 9; +pub const NV_ERR_DUAL_LINK_INUSE: _bindgen_ty_4 =3D 10; +pub const NV_ERR_ECC_ERROR: _bindgen_ty_4 =3D 11; +pub const NV_ERR_FIFO_BAD_ACCESS: _bindgen_ty_4 =3D 12; +pub const NV_ERR_FREQ_NOT_SUPPORTED: _bindgen_ty_4 =3D 13; +pub const NV_ERR_GPU_DMA_NOT_INITIALIZED: _bindgen_ty_4 =3D 14; +pub const NV_ERR_GPU_IS_LOST: _bindgen_ty_4 =3D 15; +pub const NV_ERR_GPU_IN_FULLCHIP_RESET: _bindgen_ty_4 =3D 16; +pub const NV_ERR_GPU_NOT_FULL_POWER: _bindgen_ty_4 =3D 17; +pub const NV_ERR_GPU_UUID_NOT_FOUND: _bindgen_ty_4 =3D 18; +pub const NV_ERR_HOT_SWITCH: _bindgen_ty_4 =3D 19; +pub const NV_ERR_I2C_ERROR: _bindgen_ty_4 =3D 20; +pub const NV_ERR_I2C_SPEED_TOO_HIGH: _bindgen_ty_4 =3D 21; +pub const NV_ERR_ILLEGAL_ACTION: _bindgen_ty_4 =3D 22; +pub const NV_ERR_IN_USE: _bindgen_ty_4 =3D 23; +pub const NV_ERR_INFLATE_COMPRESSED_DATA_FAILED: _bindgen_ty_4 =3D 24; +pub const NV_ERR_INSERT_DUPLICATE_NAME: _bindgen_ty_4 =3D 25; +pub const NV_ERR_INSUFFICIENT_RESOURCES: _bindgen_ty_4 =3D 26; +pub const NV_ERR_INSUFFICIENT_PERMISSIONS: _bindgen_ty_4 =3D 27; +pub const NV_ERR_INSUFFICIENT_POWER: _bindgen_ty_4 =3D 28; +pub const NV_ERR_INVALID_ACCESS_TYPE: _bindgen_ty_4 =3D 29; +pub const NV_ERR_INVALID_ADDRESS: _bindgen_ty_4 =3D 30; +pub const NV_ERR_INVALID_ARGUMENT: _bindgen_ty_4 =3D 31; +pub const NV_ERR_INVALID_BASE: _bindgen_ty_4 =3D 32; +pub const NV_ERR_INVALID_CHANNEL: _bindgen_ty_4 =3D 33; +pub const NV_ERR_INVALID_CLASS: _bindgen_ty_4 =3D 34; +pub const NV_ERR_INVALID_CLIENT: _bindgen_ty_4 =3D 35; +pub const NV_ERR_INVALID_COMMAND: _bindgen_ty_4 =3D 36; +pub const NV_ERR_INVALID_DATA: _bindgen_ty_4 =3D 37; +pub const NV_ERR_INVALID_DEVICE: _bindgen_ty_4 =3D 38; +pub const NV_ERR_INVALID_DMA_SPECIFIER: _bindgen_ty_4 =3D 39; +pub const NV_ERR_INVALID_EVENT: _bindgen_ty_4 =3D 40; +pub const NV_ERR_INVALID_FLAGS: _bindgen_ty_4 =3D 41; +pub const NV_ERR_INVALID_FUNCTION: _bindgen_ty_4 =3D 42; +pub const NV_ERR_INVALID_HEAP: _bindgen_ty_4 =3D 43; +pub const NV_ERR_INVALID_INDEX: _bindgen_ty_4 =3D 44; +pub const NV_ERR_INVALID_IRQ_LEVEL: _bindgen_ty_4 =3D 45; +pub const NV_ERR_INVALID_LIMIT: _bindgen_ty_4 =3D 46; +pub const NV_ERR_INVALID_LOCK_STATE: _bindgen_ty_4 =3D 47; +pub const NV_ERR_INVALID_METHOD: _bindgen_ty_4 =3D 48; +pub const NV_ERR_INVALID_OBJECT: _bindgen_ty_4 =3D 49; +pub const NV_ERR_INVALID_OBJECT_BUFFER: _bindgen_ty_4 =3D 50; +pub const NV_ERR_INVALID_OBJECT_HANDLE: _bindgen_ty_4 =3D 51; +pub const NV_ERR_INVALID_OBJECT_NEW: _bindgen_ty_4 =3D 52; +pub const NV_ERR_INVALID_OBJECT_OLD: _bindgen_ty_4 =3D 53; +pub const NV_ERR_INVALID_OBJECT_PARENT: _bindgen_ty_4 =3D 54; +pub const NV_ERR_INVALID_OFFSET: _bindgen_ty_4 =3D 55; +pub const NV_ERR_INVALID_OPERATION: _bindgen_ty_4 =3D 56; +pub const NV_ERR_INVALID_OWNER: _bindgen_ty_4 =3D 57; +pub const NV_ERR_INVALID_PARAM_STRUCT: _bindgen_ty_4 =3D 58; +pub const NV_ERR_INVALID_PARAMETER: _bindgen_ty_4 =3D 59; +pub const NV_ERR_INVALID_PATH: _bindgen_ty_4 =3D 60; +pub const NV_ERR_INVALID_POINTER: _bindgen_ty_4 =3D 61; +pub const NV_ERR_INVALID_REGISTRY_KEY: _bindgen_ty_4 =3D 62; +pub const NV_ERR_INVALID_REQUEST: _bindgen_ty_4 =3D 63; +pub const NV_ERR_INVALID_STATE: _bindgen_ty_4 =3D 64; +pub const NV_ERR_INVALID_STRING_LENGTH: _bindgen_ty_4 =3D 65; +pub const NV_ERR_INVALID_READ: _bindgen_ty_4 =3D 66; +pub const NV_ERR_INVALID_WRITE: _bindgen_ty_4 =3D 67; +pub const NV_ERR_INVALID_XLATE: _bindgen_ty_4 =3D 68; +pub const NV_ERR_IRQ_NOT_FIRING: _bindgen_ty_4 =3D 69; +pub const NV_ERR_IRQ_EDGE_TRIGGERED: _bindgen_ty_4 =3D 70; +pub const NV_ERR_MEMORY_TRAINING_FAILED: _bindgen_ty_4 =3D 71; +pub const NV_ERR_MISMATCHED_SLAVE: _bindgen_ty_4 =3D 72; +pub const NV_ERR_MISMATCHED_TARGET: _bindgen_ty_4 =3D 73; +pub const NV_ERR_MISSING_TABLE_ENTRY: _bindgen_ty_4 =3D 74; +pub const NV_ERR_MODULE_LOAD_FAILED: _bindgen_ty_4 =3D 75; +pub const NV_ERR_MORE_DATA_AVAILABLE: _bindgen_ty_4 =3D 76; +pub const NV_ERR_MORE_PROCESSING_REQUIRED: _bindgen_ty_4 =3D 77; +pub const NV_ERR_MULTIPLE_MEMORY_TYPES: _bindgen_ty_4 =3D 78; +pub const NV_ERR_NO_FREE_FIFOS: _bindgen_ty_4 =3D 79; +pub const NV_ERR_NO_INTR_PENDING: _bindgen_ty_4 =3D 80; +pub const NV_ERR_NO_MEMORY: _bindgen_ty_4 =3D 81; +pub const NV_ERR_NO_SUCH_DOMAIN: _bindgen_ty_4 =3D 82; +pub const NV_ERR_NO_VALID_PATH: _bindgen_ty_4 =3D 83; +pub const NV_ERR_NOT_COMPATIBLE: _bindgen_ty_4 =3D 84; +pub const NV_ERR_NOT_READY: _bindgen_ty_4 =3D 85; +pub const NV_ERR_NOT_SUPPORTED: _bindgen_ty_4 =3D 86; +pub const NV_ERR_OBJECT_NOT_FOUND: _bindgen_ty_4 =3D 87; +pub const NV_ERR_OBJECT_TYPE_MISMATCH: _bindgen_ty_4 =3D 88; +pub const NV_ERR_OPERATING_SYSTEM: _bindgen_ty_4 =3D 89; +pub const NV_ERR_OTHER_DEVICE_FOUND: _bindgen_ty_4 =3D 90; +pub const NV_ERR_OUT_OF_RANGE: _bindgen_ty_4 =3D 91; +pub const NV_ERR_OVERLAPPING_UVM_COMMIT: _bindgen_ty_4 =3D 92; +pub const NV_ERR_PAGE_TABLE_NOT_AVAIL: _bindgen_ty_4 =3D 93; +pub const NV_ERR_PID_NOT_FOUND: _bindgen_ty_4 =3D 94; +pub const NV_ERR_PROTECTION_FAULT: _bindgen_ty_4 =3D 95; +pub const NV_ERR_RC_ERROR: _bindgen_ty_4 =3D 96; +pub const NV_ERR_REJECTED_VBIOS: _bindgen_ty_4 =3D 97; +pub const NV_ERR_RESET_REQUIRED: _bindgen_ty_4 =3D 98; +pub const NV_ERR_STATE_IN_USE: _bindgen_ty_4 =3D 99; +pub const NV_ERR_SIGNAL_PENDING: _bindgen_ty_4 =3D 100; +pub const NV_ERR_TIMEOUT: _bindgen_ty_4 =3D 101; +pub const NV_ERR_TIMEOUT_RETRY: _bindgen_ty_4 =3D 102; +pub const NV_ERR_TOO_MANY_PRIMARIES: _bindgen_ty_4 =3D 103; +pub const NV_ERR_UVM_ADDRESS_IN_USE: _bindgen_ty_4 =3D 104; +pub const NV_ERR_MAX_SESSION_LIMIT_REACHED: _bindgen_ty_4 =3D 105; +pub const NV_ERR_LIB_RM_VERSION_MISMATCH: _bindgen_ty_4 =3D 106; +pub const NV_ERR_PRIV_SEC_VIOLATION: _bindgen_ty_4 =3D 107; +pub const NV_ERR_GPU_IN_DEBUG_MODE: _bindgen_ty_4 =3D 108; +pub const NV_ERR_FEATURE_NOT_ENABLED: _bindgen_ty_4 =3D 109; +pub const NV_ERR_RESOURCE_LOST: _bindgen_ty_4 =3D 110; +pub const NV_ERR_PMU_NOT_READY: _bindgen_ty_4 =3D 111; +pub const NV_ERR_FLCN_ERROR: _bindgen_ty_4 =3D 112; +pub const NV_ERR_FATAL_ERROR: _bindgen_ty_4 =3D 113; +pub const NV_ERR_MEMORY_ERROR: _bindgen_ty_4 =3D 114; +pub const NV_ERR_INVALID_LICENSE: _bindgen_ty_4 =3D 115; +pub const NV_ERR_NVLINK_INIT_ERROR: _bindgen_ty_4 =3D 116; +pub const NV_ERR_NVLINK_MINION_ERROR: _bindgen_ty_4 =3D 117; +pub const NV_ERR_NVLINK_CLOCK_ERROR: _bindgen_ty_4 =3D 118; +pub const NV_ERR_NVLINK_TRAINING_ERROR: _bindgen_ty_4 =3D 119; +pub const NV_ERR_NVLINK_CONFIGURATION_ERROR: _bindgen_ty_4 =3D 120; +pub const NV_ERR_RISCV_ERROR: _bindgen_ty_4 =3D 121; +pub const NV_ERR_FABRIC_MANAGER_NOT_PRESENT: _bindgen_ty_4 =3D 122; +pub const NV_ERR_ALREADY_SIGNALLED: _bindgen_ty_4 =3D 123; +pub const NV_ERR_QUEUE_TASK_SLOT_NOT_AVAILABLE: _bindgen_ty_4 =3D 124; +pub const NV_ERR_KEY_ROTATION_IN_PROGRESS: _bindgen_ty_4 =3D 125; +pub const NV_ERR_TEST_ONLY_CODE_NOT_ENABLED: _bindgen_ty_4 =3D 126; +pub const NV_ERR_SECURE_BOOT_FAILED: _bindgen_ty_4 =3D 127; +pub const NV_ERR_INSUFFICIENT_ZBC_ENTRY: _bindgen_ty_4 =3D 128; +pub const NV_ERR_NVLINK_FABRIC_NOT_READY: _bindgen_ty_4 =3D 129; +pub const NV_ERR_NVLINK_FABRIC_FAILURE: _bindgen_ty_4 =3D 130; +pub const NV_ERR_GPU_MEMORY_ONLINING_FAILURE: _bindgen_ty_4 =3D 131; +pub const NV_ERR_REDUCTION_MANAGER_NOT_AVAILABLE: _bindgen_ty_4 =3D 132; +pub const NV_ERR_RESOURCE_RETIREMENT_ERROR: _bindgen_ty_4 =3D 134; +pub const NV_WARN_HOT_SWITCH: _bindgen_ty_4 =3D 65537; +pub const NV_WARN_INCORRECT_PERFMON_DATA: _bindgen_ty_4 =3D 65538; +pub const NV_WARN_MISMATCHED_SLAVE: _bindgen_ty_4 =3D 65539; +pub const NV_WARN_MISMATCHED_TARGET: _bindgen_ty_4 =3D 65540; +pub const NV_WARN_MORE_PROCESSING_REQUIRED: _bindgen_ty_4 =3D 65541; +pub const NV_WARN_NOTHING_TO_DO: _bindgen_ty_4 =3D 65542; +pub const NV_WARN_NULL_OBJECT: _bindgen_ty_4 =3D 65543; +pub const NV_WARN_OUT_OF_RANGE: _bindgen_ty_4 =3D 65544; +pub type _bindgen_ty_4 =3D ffi::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone, MaybeZeroable)] pub struct NV2080_CTRL_GPU_GET_GID_INFO_PARAMS { --=20 2.53.0 From nobody Thu Jun 11 01:40:33 2026 Received: from BYAPR05CU005.outbound.protection.outlook.com (mail-westusazon11010026.outbound.protection.outlook.com [52.101.85.26]) (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 7B98833554F; Fri, 17 Apr 2026 15:33:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.85.26 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776440026; cv=fail; b=Zi6pW7Rnb988/fFQSZ8hhpim+FEVDyyRhJYo1UPwMAC+kEYPVMjIEbLe+xiTTvSKLSyyt+LPCi+YIlMp53Sx6yKGppBw6L/A/lJ4GnPgI6EjWu1P60xwFwGU5ktLjGlcrwRjzsvuDuoJ1iq/5/KStlO48PBrdD33TB9vLG+UD88= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776440026; c=relaxed/simple; bh=ltEQGAtP+hacEJCGHo8JZi6pQX63mpotcViRrTdYUro=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=pGJSuCV/Jyr4l68vE51+o/BA9B+wvjatkUM95aRo2G//o/sPYji9HaTQDNt4p1oWzQWlqUeNZp0Lx466T1G7pRgQ5W42uDzPaLI349d5sSvRi2qZvt2hFyDPXQ9IQc6HiUGKhXips0SRPrSFrRfcNvJy6gLvJgKTSaqSg/wo+mM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=ioPEjSiO; arc=fail smtp.client-ip=52.101.85.26 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="ioPEjSiO" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xNz8vy8vzCHe41zLcTlPw2tRdCcyjqV8RMV/A+zUPQfUVxYTiQ94bVieux8X9lZzsf/p0Ln3Og4AHr5tDIcUP0uPTOAIzGB8P2SWMAp68+Ivj8OZPYDPweXBMD4Nqr+ADOvlHV7xCdkWqASK+sFKBJ9HA46PUy8eukEA0LOc/eZq+4zKcoKB6fKtL8UjLgH9d4uaXr3CvReJkvv/dR30LjtWXkqZ5MDlFQZko0Ssi55XmDDwSgpoywNkSHmpztOtj35dr2LXKiJKs1N1Mz0/iCAivsnDfkyD1UmyXer32IcTDb4wUZKL8gzwbxjqY2IywVjyTmtZcHnvt+zD8jIBhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ALajJxd5/K9gpLivWMZE8K4Hp3WGYGJlAqZ1jA5XO4k=; b=Dn8QpckFfL5Off1RWwfqI7rWR2UK2yk/lhNH8eP05P0JwqqI8mjTBJZg4zfPCzV01rrygMUCNlLSS7NY1LiKG7e0Jmb863p1vxp9cfn94wHcsPKNyYS1GxDaTi6OTkDoQzDI7pzb7HIdz+wYZrTgbFiODCEzhnyO1aMjDi80UWJfrC8T9bbCTmRDKOxHAKvidOILPmRwSzFP4phpnZlpRoood7F/jkDFNEHHptqjYNY0OK0r1J8Pk0a2HGJ822YGxJ7GZOeYH6u1sqAsCtJTtPEdMZqtk1gQ0EeASYh3zSsAtny/YshBHoOLhkLj5js1eaL6TvUa0SdISy6bgmfFeQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ALajJxd5/K9gpLivWMZE8K4Hp3WGYGJlAqZ1jA5XO4k=; b=ioPEjSiOjYphDO+GzzH7DD9qURJdhAI/fbU69eu/xkg4Y8er//dF/FvqxQxi/9dNh6P3WS8eu3KMZQFRPU7bRSMbvwcEbx3RmxYgxh++9PuzSZDNzE3xMrgSAamg50IiVDa926uwnAyUrmYTIWYGlHt+w2h8/vsP20VIb9kR4N3YV1/qpNXY8AIPyWgwfwPzgnUfanj2Kwnpr5kp8r1/we+Wkr1Y3xi0Gm15WQNoKL2wtcdkP1oV4e9L1U8oMPsPOrq9fxwGH41O+jz/pnOkhn5FElcPqUX6l696cTGxmMZjXRrYW0RmvRix439iMsPyNTm99NhuUzjkT237jYTW5w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BL0PR12MB2353.namprd12.prod.outlook.com (2603:10b6:207:4c::31) by DM3PR12MB9389.namprd12.prod.outlook.com (2603:10b6:0:46::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9818.25; Fri, 17 Apr 2026 15:33:39 +0000 Received: from BL0PR12MB2353.namprd12.prod.outlook.com ([fe80::99b:dcff:8d6d:78e0]) by BL0PR12MB2353.namprd12.prod.outlook.com ([fe80::99b:dcff:8d6d:78e0%4]) with mapi id 15.20.9818.023; Fri, 17 Apr 2026 15:33:39 +0000 From: Eliot Courtney Date: Sat, 18 Apr 2026 00:29:20 +0900 Subject: [PATCH v4 2/8] gpu: nova-core: gsp: add GSP-RM status types Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260418-rmcontrol-v4-2-fda8c76dbb95@nvidia.com> References: <20260418-rmcontrol-v4-0-fda8c76dbb95@nvidia.com> In-Reply-To: <20260418-rmcontrol-v4-0-fda8c76dbb95@nvidia.com> To: Danilo Krummrich , Alice Ryhl , Alexandre Courbot , David Airlie , Simona Vetter Cc: John Hubbard , Alistair Popple , Joel Fernandes , Timur Tabi , rust-for-linux@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Eliot Courtney X-Mailer: b4 0.15.2 X-ClientProxiedBy: TY4PR01CA0095.jpnprd01.prod.outlook.com (2603:1096:405:37d::6) To BL0PR12MB2353.namprd12.prod.outlook.com (2603:10b6:207:4c::31) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL0PR12MB2353:EE_|DM3PR12MB9389:EE_ X-MS-Office365-Filtering-Correlation-Id: c339f355-fc53-4a73-cf05-08de9c96b2d1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|376014|366016|1800799024|22082099003|18002099003|56012099003; X-Microsoft-Antispam-Message-Info: gYrsQVYdEkoo31P2TaVlqO91vy/ctW6Mg8FinGbwPPH7SDRSIyBz+8TwZoseQr7bUEleU8pl+x0iNSsH0xasl5ltEGTnpjuF8vTziILbo2bi7NtspPs2AQ6D5gw/TBiAW1sQE6oYq/qc0Iy5ovCjwrlwZM/xYVqwFPJ3vlhux402LNzk9yefdsyLUQ0oYHxR6MtS2iNdOu7TH7kZOXlFz8NaeWL5PMIdOS32h0Wp16fuslzamVMILefQHjfr6+htcG6Q57q/i1BSVWtCbSTZbYHdlwZGtcOPK26rpMXYJqF5Jr4HgRypdktd+LhH8LPdGyLMRS9HIWRuF45Q6uLVG80y7bcXJAHGtVntJi+zEJF6d7gUIYecqIdotzYYYan515hasFgPQ128zBuuGpx9WNnc3QX0UFcKGgEp+wFfzAp2mmaY2dWnFcRT05PWgCj9MWiS15rumGTB0DWuVAXmFN4ZEMZWG4XvzI2n05YxZ9HtUa9C0g9g4Z1cnoHDTLFJdA61bV0Vv1bSVY3iHRa2ylbXOQJgig75uweN/UO2x6HV8MV6TZvuQJT+uGbnO5z+lgciTUUjYbg7AYC9JH1YzWAJBMEZu2gNgJgWTM6HG7jV9l3zISDUy7RNu55i5Y32wcUGx8JDhJ7ecOj3lAOM+LPL8iUF/g6DtaEZsGeeWjs2VoQ5fAjSnui3h3KxDpY83gsEFTAlVzsGf9CRRvaCxm8TwvU5sCWrJAUUwD5Rix8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR12MB2353.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(376014)(366016)(1800799024)(22082099003)(18002099003)(56012099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SmtIYmpFQURGRlMyWjRGd0x6SUp4UEhreitjQzZnRndXY0VzYVMzSnFRRXZ3?= =?utf-8?B?RzhSVHNLVmR6YXVsajA5NnZSakJoRjlNZVZIdUloMlk3b0JlQVRHZmJBYlNp?= =?utf-8?B?eTJpQUpsY092SExLMmhYLzcyRnR2OUM0ejhZUUk5ZG8xRXFnRFl5di80a3hr?= =?utf-8?B?bW5QU295QU1UQVNrRGgwQWZwcE16cllkejNMQTU3a0txcUtIZnVka2VNeG1v?= =?utf-8?B?L1Jvc093b1ZhTUFsaEUw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f-8?B?NXBXcFo3OVdhWG1BRGxpYm9RdWw1ZU9LWkNUVG5IelRtSFBFajNHQStPSlRF?= =?utf-8?B?dnBSanVDMy8vOGM5UmxXeklYc3FFdHNoNVpXcmhkM1c5WXN5UGhrWlh0djVz?= =?utf-8?B?Q3JkZ3orendsaGJ2R3BCMDUxMXFITExZSm55bEV1VHF3cVVreTNLRDVBOVZI?= =?utf-8?B?MHpRTksvQTZVOVE3RUZ4d1RxTVNFRW1RQTJWdWNETWlmR0VHaFF3TmNzcjRy?= =?utf-8?B?M3R6WmlLcTRVSVpFOFc0aysyNE5RUmhyeGJQb091WmxBY3lVRUkwcitKTThJ?= =?utf-8?Q?e2xJY8CA7wFcI2vrCZjeYdUmkClGBKpdTgNU/613ontHR?= X-MS-Exchange-AntiSpam-MessageData-1: eHtbdd8IZ/L33w== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: c339f355-fc53-4a73-cf05-08de9c96b2d1 X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB2353.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Apr 2026 15:33:39.5117 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: KkwcEL2ohakG0xrJXCDoD4xdnabuyMIdxflkpjMlWwlXZuP3IYtm/3/i+xH+xEcmjTEBE3ECrrCXlWgcFGLzpw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB9389 These types represent the status value returned by GSP-RM for generic RPCs and also for RM control messages. These are split into a success status, a warning status, and an error status. Give a rust side type to each of these, which lets errors be mapped to a rust `Error`. Signed-off-by: Eliot Courtney --- drivers/gpu/nova-core/gsp/fw.rs | 508 ++++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 508 insertions(+) diff --git a/drivers/gpu/nova-core/gsp/fw.rs b/drivers/gpu/nova-core/gsp/fw= .rs index 0c8a74f0e8ac..a8d7c62af097 100644 --- a/drivers/gpu/nova-core/gsp/fw.rs +++ b/drivers/gpu/nova-core/gsp/fw.rs @@ -97,6 +97,514 @@ pub(in crate::gsp) fn advance_cpu_write_ptr(qs: &Cohere= nt, count: u32) { pub(crate) const GSP_MSG_QUEUE_ELEMENT_SIZE_MAX: usize =3D num::u32_as_usize(bindings::GSP_MSG_QUEUE_ELEMENT_SIZE_MAX); =20 +/// Status code returned by GSP-RM operations. +#[derive(Copy, Clone, Debug, PartialEq, Eq)] +#[expect(dead_code)] +pub(crate) enum GspMsgRmStatus { + /// The operation succeeded. + Ok, + /// The operation completed with a non-fatal warning. + Warning(GspMsgRmWarning), + /// The operation failed with a GSP-RM-specific error. + Error(GspMsgRmError), +} + +/// Warning code returned by GSP-RM RPCs. +#[derive(Copy, Clone, Debug, PartialEq, Eq)] +#[repr(u32)] +pub(crate) enum GspMsgRmWarning { + HotSwitch =3D bindings::NV_WARN_HOT_SWITCH, + IncorrectPerfmonData =3D bindings::NV_WARN_INCORRECT_PERFMON_DATA, + MismatchedSlave =3D bindings::NV_WARN_MISMATCHED_SLAVE, + MismatchedTarget =3D bindings::NV_WARN_MISMATCHED_TARGET, + MoreProcessingRequired =3D bindings::NV_WARN_MORE_PROCESSING_REQUIRED, + NothingToDo =3D bindings::NV_WARN_NOTHING_TO_DO, + NullObject =3D bindings::NV_WARN_NULL_OBJECT, + OutOfRange =3D bindings::NV_WARN_OUT_OF_RANGE, +} + +// TODO[FPRI]: This is a temporary solution to be replaced with the corres= ponding derive macros +// once they land. +impl TryFrom for GspMsgRmWarning { + type Error =3D Error; + + fn try_from(value: u32) -> Result { + match value { + bindings::NV_WARN_HOT_SWITCH =3D> Ok(Self::HotSwitch), + bindings::NV_WARN_INCORRECT_PERFMON_DATA =3D> Ok(Self::Incorre= ctPerfmonData), + bindings::NV_WARN_MISMATCHED_SLAVE =3D> Ok(Self::MismatchedSla= ve), + bindings::NV_WARN_MISMATCHED_TARGET =3D> Ok(Self::MismatchedTa= rget), + bindings::NV_WARN_MORE_PROCESSING_REQUIRED =3D> Ok(Self::MoreP= rocessingRequired), + bindings::NV_WARN_NOTHING_TO_DO =3D> Ok(Self::NothingToDo), + bindings::NV_WARN_NULL_OBJECT =3D> Ok(Self::NullObject), + bindings::NV_WARN_OUT_OF_RANGE =3D> Ok(Self::OutOfRange), + _ =3D> Err(EINVAL), + } + } +} + +/// Error code returned by GSP-RM RPCs. +#[derive(Copy, Clone, Debug, PartialEq, Eq)] +#[repr(u32)] +pub(crate) enum GspMsgRmError { + AlreadySignalled =3D bindings::NV_ERR_ALREADY_SIGNALLED, + BrokenFb =3D bindings::NV_ERR_BROKEN_FB, + BufferTooSmall =3D bindings::NV_ERR_BUFFER_TOO_SMALL, + BusyRetry =3D bindings::NV_ERR_BUSY_RETRY, + CallbackNotScheduled =3D bindings::NV_ERR_CALLBACK_NOT_SCHEDULED, + CardNotPresent =3D bindings::NV_ERR_CARD_NOT_PRESENT, + CycleDetected =3D bindings::NV_ERR_CYCLE_DETECTED, + DmaInUse =3D bindings::NV_ERR_DMA_IN_USE, + DmaMemNotLocked =3D bindings::NV_ERR_DMA_MEM_NOT_LOCKED, + DmaMemNotUnlocked =3D bindings::NV_ERR_DMA_MEM_NOT_UNLOCKED, + DualLinkInuse =3D bindings::NV_ERR_DUAL_LINK_INUSE, + EccError =3D bindings::NV_ERR_ECC_ERROR, + FabricManagerNotPresent =3D bindings::NV_ERR_FABRIC_MANAGER_NOT_PRESEN= T, + FatalError =3D bindings::NV_ERR_FATAL_ERROR, + FeatureNotEnabled =3D bindings::NV_ERR_FEATURE_NOT_ENABLED, + FifoBadAccess =3D bindings::NV_ERR_FIFO_BAD_ACCESS, + FlcnError =3D bindings::NV_ERR_FLCN_ERROR, + FreqNotSupported =3D bindings::NV_ERR_FREQ_NOT_SUPPORTED, + Generic =3D bindings::NV_ERR_GENERIC, + GpuDmaNotInitialized =3D bindings::NV_ERR_GPU_DMA_NOT_INITIALIZED, + GpuInDebugMode =3D bindings::NV_ERR_GPU_IN_DEBUG_MODE, + GpuInFullchipReset =3D bindings::NV_ERR_GPU_IN_FULLCHIP_RESET, + GpuIsLost =3D bindings::NV_ERR_GPU_IS_LOST, + GpuMemoryOnliningFailure =3D bindings::NV_ERR_GPU_MEMORY_ONLINING_FAIL= URE, + GpuNotFullPower =3D bindings::NV_ERR_GPU_NOT_FULL_POWER, + GpuUuidNotFound =3D bindings::NV_ERR_GPU_UUID_NOT_FOUND, + HotSwitch =3D bindings::NV_ERR_HOT_SWITCH, + I2cError =3D bindings::NV_ERR_I2C_ERROR, + I2cSpeedTooHigh =3D bindings::NV_ERR_I2C_SPEED_TOO_HIGH, + IllegalAction =3D bindings::NV_ERR_ILLEGAL_ACTION, + InUse =3D bindings::NV_ERR_IN_USE, + InflateCompressedDataFailed =3D bindings::NV_ERR_INFLATE_COMPRESSED_DA= TA_FAILED, + InsertDuplicateName =3D bindings::NV_ERR_INSERT_DUPLICATE_NAME, + InsufficientPermissions =3D bindings::NV_ERR_INSUFFICIENT_PERMISSIONS, + InsufficientPower =3D bindings::NV_ERR_INSUFFICIENT_POWER, + InsufficientResources =3D bindings::NV_ERR_INSUFFICIENT_RESOURCES, + InsufficientZbcEntry =3D bindings::NV_ERR_INSUFFICIENT_ZBC_ENTRY, + InvalidAccessType =3D bindings::NV_ERR_INVALID_ACCESS_TYPE, + InvalidAddress =3D bindings::NV_ERR_INVALID_ADDRESS, + InvalidArgument =3D bindings::NV_ERR_INVALID_ARGUMENT, + InvalidBase =3D bindings::NV_ERR_INVALID_BASE, + InvalidChannel =3D bindings::NV_ERR_INVALID_CHANNEL, + InvalidClass =3D bindings::NV_ERR_INVALID_CLASS, + InvalidClient =3D bindings::NV_ERR_INVALID_CLIENT, + InvalidCommand =3D bindings::NV_ERR_INVALID_COMMAND, + InvalidData =3D bindings::NV_ERR_INVALID_DATA, + InvalidDevice =3D bindings::NV_ERR_INVALID_DEVICE, + InvalidDmaSpecifier =3D bindings::NV_ERR_INVALID_DMA_SPECIFIER, + InvalidEvent =3D bindings::NV_ERR_INVALID_EVENT, + InvalidFlags =3D bindings::NV_ERR_INVALID_FLAGS, + InvalidFunction =3D bindings::NV_ERR_INVALID_FUNCTION, + InvalidHeap =3D bindings::NV_ERR_INVALID_HEAP, + InvalidIndex =3D bindings::NV_ERR_INVALID_INDEX, + InvalidIrqLevel =3D bindings::NV_ERR_INVALID_IRQ_LEVEL, + InvalidLicense =3D bindings::NV_ERR_INVALID_LICENSE, + InvalidLimit =3D bindings::NV_ERR_INVALID_LIMIT, + InvalidLockState =3D bindings::NV_ERR_INVALID_LOCK_STATE, + InvalidMethod =3D bindings::NV_ERR_INVALID_METHOD, + InvalidObject =3D bindings::NV_ERR_INVALID_OBJECT, + InvalidObjectBuffer =3D bindings::NV_ERR_INVALID_OBJECT_BUFFER, + InvalidObjectHandle =3D bindings::NV_ERR_INVALID_OBJECT_HANDLE, + InvalidObjectNew =3D bindings::NV_ERR_INVALID_OBJECT_NEW, + InvalidObjectOld =3D bindings::NV_ERR_INVALID_OBJECT_OLD, + InvalidObjectParent =3D bindings::NV_ERR_INVALID_OBJECT_PARENT, + InvalidOffset =3D bindings::NV_ERR_INVALID_OFFSET, + InvalidOperation =3D bindings::NV_ERR_INVALID_OPERATION, + InvalidOwner =3D bindings::NV_ERR_INVALID_OWNER, + InvalidParamStruct =3D bindings::NV_ERR_INVALID_PARAM_STRUCT, + InvalidParameter =3D bindings::NV_ERR_INVALID_PARAMETER, + InvalidPath =3D bindings::NV_ERR_INVALID_PATH, + InvalidPointer =3D bindings::NV_ERR_INVALID_POINTER, + InvalidRead =3D bindings::NV_ERR_INVALID_READ, + InvalidRegistryKey =3D bindings::NV_ERR_INVALID_REGISTRY_KEY, + InvalidRequest =3D bindings::NV_ERR_INVALID_REQUEST, + InvalidState =3D bindings::NV_ERR_INVALID_STATE, + InvalidStringLength =3D bindings::NV_ERR_INVALID_STRING_LENGTH, + InvalidWrite =3D bindings::NV_ERR_INVALID_WRITE, + InvalidXlate =3D bindings::NV_ERR_INVALID_XLATE, + IrqEdgeTriggered =3D bindings::NV_ERR_IRQ_EDGE_TRIGGERED, + IrqNotFiring =3D bindings::NV_ERR_IRQ_NOT_FIRING, + KeyRotationInProgress =3D bindings::NV_ERR_KEY_ROTATION_IN_PROGRESS, + LibRmVersionMismatch =3D bindings::NV_ERR_LIB_RM_VERSION_MISMATCH, + MaxSessionLimitReached =3D bindings::NV_ERR_MAX_SESSION_LIMIT_REACHED, + MemoryError =3D bindings::NV_ERR_MEMORY_ERROR, + MemoryTrainingFailed =3D bindings::NV_ERR_MEMORY_TRAINING_FAILED, + MismatchedSlave =3D bindings::NV_ERR_MISMATCHED_SLAVE, + MismatchedTarget =3D bindings::NV_ERR_MISMATCHED_TARGET, + MissingTableEntry =3D bindings::NV_ERR_MISSING_TABLE_ENTRY, + ModuleLoadFailed =3D bindings::NV_ERR_MODULE_LOAD_FAILED, + MoreDataAvailable =3D bindings::NV_ERR_MORE_DATA_AVAILABLE, + MoreProcessingRequired =3D bindings::NV_ERR_MORE_PROCESSING_REQUIRED, + MultipleMemoryTypes =3D bindings::NV_ERR_MULTIPLE_MEMORY_TYPES, + NoFreeFifos =3D bindings::NV_ERR_NO_FREE_FIFOS, + NoIntrPending =3D bindings::NV_ERR_NO_INTR_PENDING, + NoMemory =3D bindings::NV_ERR_NO_MEMORY, + NoSuchDomain =3D bindings::NV_ERR_NO_SUCH_DOMAIN, + NoValidPath =3D bindings::NV_ERR_NO_VALID_PATH, + NotCompatible =3D bindings::NV_ERR_NOT_COMPATIBLE, + NotReady =3D bindings::NV_ERR_NOT_READY, + NotSupported =3D bindings::NV_ERR_NOT_SUPPORTED, + NvlinkClockError =3D bindings::NV_ERR_NVLINK_CLOCK_ERROR, + NvlinkConfigurationError =3D bindings::NV_ERR_NVLINK_CONFIGURATION_ERR= OR, + NvlinkFabricFailure =3D bindings::NV_ERR_NVLINK_FABRIC_FAILURE, + NvlinkFabricNotReady =3D bindings::NV_ERR_NVLINK_FABRIC_NOT_READY, + NvlinkInitError =3D bindings::NV_ERR_NVLINK_INIT_ERROR, + NvlinkMinionError =3D bindings::NV_ERR_NVLINK_MINION_ERROR, + NvlinkTrainingError =3D bindings::NV_ERR_NVLINK_TRAINING_ERROR, + ObjectNotFound =3D bindings::NV_ERR_OBJECT_NOT_FOUND, + ObjectTypeMismatch =3D bindings::NV_ERR_OBJECT_TYPE_MISMATCH, + OperatingSystem =3D bindings::NV_ERR_OPERATING_SYSTEM, + OtherDeviceFound =3D bindings::NV_ERR_OTHER_DEVICE_FOUND, + OutOfRange =3D bindings::NV_ERR_OUT_OF_RANGE, + OverlappingUvmCommit =3D bindings::NV_ERR_OVERLAPPING_UVM_COMMIT, + PageTableNotAvail =3D bindings::NV_ERR_PAGE_TABLE_NOT_AVAIL, + PidNotFound =3D bindings::NV_ERR_PID_NOT_FOUND, + PmuNotReady =3D bindings::NV_ERR_PMU_NOT_READY, + PrivSecViolation =3D bindings::NV_ERR_PRIV_SEC_VIOLATION, + ProtectionFault =3D bindings::NV_ERR_PROTECTION_FAULT, + QueueTaskSlotNotAvailable =3D bindings::NV_ERR_QUEUE_TASK_SLOT_NOT_AVA= ILABLE, + RcError =3D bindings::NV_ERR_RC_ERROR, + ReductionManagerNotAvailable =3D bindings::NV_ERR_REDUCTION_MANAGER_NO= T_AVAILABLE, + RejectedVbios =3D bindings::NV_ERR_REJECTED_VBIOS, + ResetRequired =3D bindings::NV_ERR_RESET_REQUIRED, + ResourceLost =3D bindings::NV_ERR_RESOURCE_LOST, + ResourceRetirementError =3D bindings::NV_ERR_RESOURCE_RETIREMENT_ERROR, + RiscvError =3D bindings::NV_ERR_RISCV_ERROR, + SecureBootFailed =3D bindings::NV_ERR_SECURE_BOOT_FAILED, + SignalPending =3D bindings::NV_ERR_SIGNAL_PENDING, + StateInUse =3D bindings::NV_ERR_STATE_IN_USE, + TestOnlyCodeNotEnabled =3D bindings::NV_ERR_TEST_ONLY_CODE_NOT_ENABLED, + Timeout =3D bindings::NV_ERR_TIMEOUT, + TimeoutRetry =3D bindings::NV_ERR_TIMEOUT_RETRY, + TooManyPrimaries =3D bindings::NV_ERR_TOO_MANY_PRIMARIES, + UvmAddressInUse =3D bindings::NV_ERR_UVM_ADDRESS_IN_USE, +} + +impl From for Error { + fn from(status: GspMsgRmError) -> Self { + match status { + GspMsgRmError::BufferTooSmall | GspMsgRmError::MoreDataAvailab= le =3D> ETOOSMALL, + + GspMsgRmError::DmaInUse + | GspMsgRmError::DmaMemNotUnlocked + | GspMsgRmError::DualLinkInuse + | GspMsgRmError::GpuInDebugMode + | GspMsgRmError::GpuInFullchipReset + | GspMsgRmError::KeyRotationInProgress + | GspMsgRmError::NotReady + | GspMsgRmError::NvlinkFabricNotReady + | GspMsgRmError::PmuNotReady + | GspMsgRmError::StateInUse + | GspMsgRmError::UvmAddressInUse =3D> EBUSY, + + GspMsgRmError::CardNotPresent + | GspMsgRmError::FabricManagerNotPresent + | GspMsgRmError::GpuDmaNotInitialized + | GspMsgRmError::GpuIsLost + | GspMsgRmError::GpuUuidNotFound + | GspMsgRmError::OtherDeviceFound + | GspMsgRmError::ReductionManagerNotAvailable + | GspMsgRmError::ResetRequired =3D> ENODEV, + + GspMsgRmError::FeatureNotEnabled + | GspMsgRmError::FreqNotSupported + | GspMsgRmError::NotSupported + | GspMsgRmError::TestOnlyCodeNotEnabled =3D> ENOTSUPP, + + GspMsgRmError::CallbackNotScheduled + | GspMsgRmError::MissingTableEntry + | GspMsgRmError::NoIntrPending + | GspMsgRmError::NoSuchDomain + | GspMsgRmError::NoValidPath + | GspMsgRmError::ObjectNotFound + | GspMsgRmError::ResourceLost =3D> ENOENT, + + GspMsgRmError::DmaMemNotLocked + | GspMsgRmError::I2cSpeedTooHigh + | GspMsgRmError::InflateCompressedDataFailed + | GspMsgRmError::InvalidArgument + | GspMsgRmError::InvalidBase + | GspMsgRmError::InvalidChannel + | GspMsgRmError::InvalidClass + | GspMsgRmError::InvalidClient + | GspMsgRmError::InvalidCommand + | GspMsgRmError::InvalidData + | GspMsgRmError::InvalidDevice + | GspMsgRmError::InvalidDmaSpecifier + | GspMsgRmError::InvalidEvent + | GspMsgRmError::InvalidFlags + | GspMsgRmError::InvalidFunction + | GspMsgRmError::InvalidHeap + | GspMsgRmError::InvalidIndex + | GspMsgRmError::InvalidIrqLevel + | GspMsgRmError::InvalidLimit + | GspMsgRmError::InvalidLockState + | GspMsgRmError::InvalidMethod + | GspMsgRmError::InvalidObject + | GspMsgRmError::InvalidObjectBuffer + | GspMsgRmError::InvalidObjectHandle + | GspMsgRmError::InvalidObjectNew + | GspMsgRmError::InvalidObjectOld + | GspMsgRmError::InvalidObjectParent + | GspMsgRmError::InvalidOffset + | GspMsgRmError::InvalidOperation + | GspMsgRmError::InvalidOwner + | GspMsgRmError::InvalidParamStruct + | GspMsgRmError::InvalidParameter + | GspMsgRmError::InvalidPath + | GspMsgRmError::InvalidRegistryKey + | GspMsgRmError::InvalidRequest + | GspMsgRmError::InvalidState + | GspMsgRmError::InvalidStringLength + | GspMsgRmError::InvalidXlate + | GspMsgRmError::LibRmVersionMismatch + | GspMsgRmError::MismatchedSlave + | GspMsgRmError::MismatchedTarget + | GspMsgRmError::MultipleMemoryTypes + | GspMsgRmError::NotCompatible + | GspMsgRmError::ObjectTypeMismatch + | GspMsgRmError::OverlappingUvmCommit + | GspMsgRmError::RejectedVbios =3D> EINVAL, + + GspMsgRmError::IllegalAction | GspMsgRmError::InsufficientPerm= issions =3D> EPERM, + + GspMsgRmError::AlreadySignalled + | GspMsgRmError::InUse + | GspMsgRmError::InsertDuplicateName =3D> EEXIST, + + GspMsgRmError::FifoBadAccess + | GspMsgRmError::InvalidAccessType + | GspMsgRmError::InvalidLicense + | GspMsgRmError::PrivSecViolation + | GspMsgRmError::SecureBootFailed =3D> EACCES, + + GspMsgRmError::GpuMemoryOnliningFailure + | GspMsgRmError::InsufficientResources + | GspMsgRmError::NoMemory + | GspMsgRmError::PageTableNotAvail =3D> ENOMEM, + + GspMsgRmError::InsufficientZbcEntry + | GspMsgRmError::MaxSessionLimitReached + | GspMsgRmError::NoFreeFifos + | GspMsgRmError::QueueTaskSlotNotAvailable + | GspMsgRmError::TooManyPrimaries =3D> ENOSPC, + + GspMsgRmError::InvalidAddress + | GspMsgRmError::InvalidPointer + | GspMsgRmError::InvalidRead + | GspMsgRmError::InvalidWrite + | GspMsgRmError::ProtectionFault =3D> EFAULT, + + GspMsgRmError::BusyRetry + | GspMsgRmError::GpuNotFullPower + | GspMsgRmError::HotSwitch + | GspMsgRmError::InsufficientPower + | GspMsgRmError::MoreProcessingRequired =3D> EAGAIN, + + GspMsgRmError::OutOfRange =3D> EOVERFLOW, + + GspMsgRmError::PidNotFound =3D> ESRCH, + + GspMsgRmError::SignalPending =3D> EINTR, + + GspMsgRmError::Timeout | GspMsgRmError::TimeoutRetry =3D> ETIM= EDOUT, + + GspMsgRmError::ModuleLoadFailed =3D> ENXIO, + + GspMsgRmError::BrokenFb + | GspMsgRmError::CycleDetected + | GspMsgRmError::EccError + | GspMsgRmError::FatalError + | GspMsgRmError::FlcnError + | GspMsgRmError::Generic + | GspMsgRmError::I2cError + | GspMsgRmError::IrqEdgeTriggered + | GspMsgRmError::IrqNotFiring + | GspMsgRmError::MemoryError + | GspMsgRmError::MemoryTrainingFailed + | GspMsgRmError::NvlinkClockError + | GspMsgRmError::NvlinkConfigurationError + | GspMsgRmError::NvlinkFabricFailure + | GspMsgRmError::NvlinkInitError + | GspMsgRmError::NvlinkMinionError + | GspMsgRmError::NvlinkTrainingError + | GspMsgRmError::OperatingSystem + | GspMsgRmError::RcError + | GspMsgRmError::ResourceRetirementError + | GspMsgRmError::RiscvError =3D> EIO, + } + } +} + +// TODO[FPRI]: This is a temporary solution to be replaced with the corres= ponding derive macros +// once they land. +impl TryFrom for GspMsgRmError { + type Error =3D Error; + + fn try_from(value: u32) -> Result { + match value { + bindings::NV_ERR_ALREADY_SIGNALLED =3D> Ok(Self::AlreadySignal= led), + bindings::NV_ERR_BROKEN_FB =3D> Ok(Self::BrokenFb), + bindings::NV_ERR_BUFFER_TOO_SMALL =3D> Ok(Self::BufferTooSmall= ), + bindings::NV_ERR_BUSY_RETRY =3D> Ok(Self::BusyRetry), + bindings::NV_ERR_CALLBACK_NOT_SCHEDULED =3D> Ok(Self::Callback= NotScheduled), + bindings::NV_ERR_CARD_NOT_PRESENT =3D> Ok(Self::CardNotPresent= ), + bindings::NV_ERR_CYCLE_DETECTED =3D> Ok(Self::CycleDetected), + bindings::NV_ERR_DMA_IN_USE =3D> Ok(Self::DmaInUse), + bindings::NV_ERR_DMA_MEM_NOT_LOCKED =3D> Ok(Self::DmaMemNotLoc= ked), + bindings::NV_ERR_DMA_MEM_NOT_UNLOCKED =3D> Ok(Self::DmaMemNotU= nlocked), + bindings::NV_ERR_DUAL_LINK_INUSE =3D> Ok(Self::DualLinkInuse), + bindings::NV_ERR_ECC_ERROR =3D> Ok(Self::EccError), + bindings::NV_ERR_FABRIC_MANAGER_NOT_PRESENT =3D> Ok(Self::Fabr= icManagerNotPresent), + bindings::NV_ERR_FATAL_ERROR =3D> Ok(Self::FatalError), + bindings::NV_ERR_FEATURE_NOT_ENABLED =3D> Ok(Self::FeatureNotE= nabled), + bindings::NV_ERR_FIFO_BAD_ACCESS =3D> Ok(Self::FifoBadAccess), + bindings::NV_ERR_FLCN_ERROR =3D> Ok(Self::FlcnError), + bindings::NV_ERR_FREQ_NOT_SUPPORTED =3D> Ok(Self::FreqNotSuppo= rted), + bindings::NV_ERR_GENERIC =3D> Ok(Self::Generic), + bindings::NV_ERR_GPU_DMA_NOT_INITIALIZED =3D> Ok(Self::GpuDmaN= otInitialized), + bindings::NV_ERR_GPU_IN_DEBUG_MODE =3D> Ok(Self::GpuInDebugMod= e), + bindings::NV_ERR_GPU_IN_FULLCHIP_RESET =3D> Ok(Self::GpuInFull= chipReset), + bindings::NV_ERR_GPU_IS_LOST =3D> Ok(Self::GpuIsLost), + bindings::NV_ERR_GPU_MEMORY_ONLINING_FAILURE =3D> Ok(Self::Gpu= MemoryOnliningFailure), + bindings::NV_ERR_GPU_NOT_FULL_POWER =3D> Ok(Self::GpuNotFullPo= wer), + bindings::NV_ERR_GPU_UUID_NOT_FOUND =3D> Ok(Self::GpuUuidNotFo= und), + bindings::NV_ERR_HOT_SWITCH =3D> Ok(Self::HotSwitch), + bindings::NV_ERR_I2C_ERROR =3D> Ok(Self::I2cError), + bindings::NV_ERR_I2C_SPEED_TOO_HIGH =3D> Ok(Self::I2cSpeedTooH= igh), + bindings::NV_ERR_ILLEGAL_ACTION =3D> Ok(Self::IllegalAction), + bindings::NV_ERR_IN_USE =3D> Ok(Self::InUse), + bindings::NV_ERR_INFLATE_COMPRESSED_DATA_FAILED =3D> { + Ok(Self::InflateCompressedDataFailed) + } + bindings::NV_ERR_INSERT_DUPLICATE_NAME =3D> Ok(Self::InsertDup= licateName), + bindings::NV_ERR_INSUFFICIENT_PERMISSIONS =3D> Ok(Self::Insuff= icientPermissions), + bindings::NV_ERR_INSUFFICIENT_POWER =3D> Ok(Self::Insufficient= Power), + bindings::NV_ERR_INSUFFICIENT_RESOURCES =3D> Ok(Self::Insuffic= ientResources), + bindings::NV_ERR_INSUFFICIENT_ZBC_ENTRY =3D> Ok(Self::Insuffic= ientZbcEntry), + bindings::NV_ERR_INVALID_ACCESS_TYPE =3D> Ok(Self::InvalidAcce= ssType), + bindings::NV_ERR_INVALID_ADDRESS =3D> Ok(Self::InvalidAddress), + bindings::NV_ERR_INVALID_ARGUMENT =3D> Ok(Self::InvalidArgumen= t), + bindings::NV_ERR_INVALID_BASE =3D> Ok(Self::InvalidBase), + bindings::NV_ERR_INVALID_CHANNEL =3D> Ok(Self::InvalidChannel), + bindings::NV_ERR_INVALID_CLASS =3D> Ok(Self::InvalidClass), + bindings::NV_ERR_INVALID_CLIENT =3D> Ok(Self::InvalidClient), + bindings::NV_ERR_INVALID_COMMAND =3D> Ok(Self::InvalidCommand), + bindings::NV_ERR_INVALID_DATA =3D> Ok(Self::InvalidData), + bindings::NV_ERR_INVALID_DEVICE =3D> Ok(Self::InvalidDevice), + bindings::NV_ERR_INVALID_DMA_SPECIFIER =3D> Ok(Self::InvalidDm= aSpecifier), + bindings::NV_ERR_INVALID_EVENT =3D> Ok(Self::InvalidEvent), + bindings::NV_ERR_INVALID_FLAGS =3D> Ok(Self::InvalidFlags), + bindings::NV_ERR_INVALID_FUNCTION =3D> Ok(Self::InvalidFunctio= n), + bindings::NV_ERR_INVALID_HEAP =3D> Ok(Self::InvalidHeap), + bindings::NV_ERR_INVALID_INDEX =3D> Ok(Self::InvalidIndex), + bindings::NV_ERR_INVALID_IRQ_LEVEL =3D> Ok(Self::InvalidIrqLev= el), + bindings::NV_ERR_INVALID_LICENSE =3D> Ok(Self::InvalidLicense), + bindings::NV_ERR_INVALID_LIMIT =3D> Ok(Self::InvalidLimit), + bindings::NV_ERR_INVALID_LOCK_STATE =3D> Ok(Self::InvalidLockS= tate), + bindings::NV_ERR_INVALID_METHOD =3D> Ok(Self::InvalidMethod), + bindings::NV_ERR_INVALID_OBJECT =3D> Ok(Self::InvalidObject), + bindings::NV_ERR_INVALID_OBJECT_BUFFER =3D> Ok(Self::InvalidOb= jectBuffer), + bindings::NV_ERR_INVALID_OBJECT_HANDLE =3D> Ok(Self::InvalidOb= jectHandle), + bindings::NV_ERR_INVALID_OBJECT_NEW =3D> Ok(Self::InvalidObjec= tNew), + bindings::NV_ERR_INVALID_OBJECT_OLD =3D> Ok(Self::InvalidObjec= tOld), + bindings::NV_ERR_INVALID_OBJECT_PARENT =3D> Ok(Self::InvalidOb= jectParent), + bindings::NV_ERR_INVALID_OFFSET =3D> Ok(Self::InvalidOffset), + bindings::NV_ERR_INVALID_OPERATION =3D> Ok(Self::InvalidOperat= ion), + bindings::NV_ERR_INVALID_OWNER =3D> Ok(Self::InvalidOwner), + bindings::NV_ERR_INVALID_PARAM_STRUCT =3D> Ok(Self::InvalidPar= amStruct), + bindings::NV_ERR_INVALID_PARAMETER =3D> Ok(Self::InvalidParame= ter), + bindings::NV_ERR_INVALID_PATH =3D> Ok(Self::InvalidPath), + bindings::NV_ERR_INVALID_POINTER =3D> Ok(Self::InvalidPointer), + bindings::NV_ERR_INVALID_READ =3D> Ok(Self::InvalidRead), + bindings::NV_ERR_INVALID_REGISTRY_KEY =3D> Ok(Self::InvalidReg= istryKey), + bindings::NV_ERR_INVALID_REQUEST =3D> Ok(Self::InvalidRequest), + bindings::NV_ERR_INVALID_STATE =3D> Ok(Self::InvalidState), + bindings::NV_ERR_INVALID_STRING_LENGTH =3D> Ok(Self::InvalidSt= ringLength), + bindings::NV_ERR_INVALID_WRITE =3D> Ok(Self::InvalidWrite), + bindings::NV_ERR_INVALID_XLATE =3D> Ok(Self::InvalidXlate), + bindings::NV_ERR_IRQ_EDGE_TRIGGERED =3D> Ok(Self::IrqEdgeTrigg= ered), + bindings::NV_ERR_IRQ_NOT_FIRING =3D> Ok(Self::IrqNotFiring), + bindings::NV_ERR_KEY_ROTATION_IN_PROGRESS =3D> Ok(Self::KeyRot= ationInProgress), + bindings::NV_ERR_LIB_RM_VERSION_MISMATCH =3D> Ok(Self::LibRmVe= rsionMismatch), + bindings::NV_ERR_MAX_SESSION_LIMIT_REACHED =3D> Ok(Self::MaxSe= ssionLimitReached), + bindings::NV_ERR_MEMORY_ERROR =3D> Ok(Self::MemoryError), + bindings::NV_ERR_MEMORY_TRAINING_FAILED =3D> Ok(Self::MemoryTr= ainingFailed), + bindings::NV_ERR_MISMATCHED_SLAVE =3D> Ok(Self::MismatchedSlav= e), + bindings::NV_ERR_MISMATCHED_TARGET =3D> Ok(Self::MismatchedTar= get), + bindings::NV_ERR_MISSING_TABLE_ENTRY =3D> Ok(Self::MissingTabl= eEntry), + bindings::NV_ERR_MODULE_LOAD_FAILED =3D> Ok(Self::ModuleLoadFa= iled), + bindings::NV_ERR_MORE_DATA_AVAILABLE =3D> Ok(Self::MoreDataAva= ilable), + bindings::NV_ERR_MORE_PROCESSING_REQUIRED =3D> Ok(Self::MorePr= ocessingRequired), + bindings::NV_ERR_MULTIPLE_MEMORY_TYPES =3D> Ok(Self::MultipleM= emoryTypes), + bindings::NV_ERR_NO_FREE_FIFOS =3D> Ok(Self::NoFreeFifos), + bindings::NV_ERR_NO_INTR_PENDING =3D> Ok(Self::NoIntrPending), + bindings::NV_ERR_NO_MEMORY =3D> Ok(Self::NoMemory), + bindings::NV_ERR_NO_SUCH_DOMAIN =3D> Ok(Self::NoSuchDomain), + bindings::NV_ERR_NO_VALID_PATH =3D> Ok(Self::NoValidPath), + bindings::NV_ERR_NOT_COMPATIBLE =3D> Ok(Self::NotCompatible), + bindings::NV_ERR_NOT_READY =3D> Ok(Self::NotReady), + bindings::NV_ERR_NOT_SUPPORTED =3D> Ok(Self::NotSupported), + bindings::NV_ERR_NVLINK_CLOCK_ERROR =3D> Ok(Self::NvlinkClockE= rror), + bindings::NV_ERR_NVLINK_CONFIGURATION_ERROR =3D> Ok(Self::Nvli= nkConfigurationError), + bindings::NV_ERR_NVLINK_FABRIC_FAILURE =3D> Ok(Self::NvlinkFab= ricFailure), + bindings::NV_ERR_NVLINK_FABRIC_NOT_READY =3D> Ok(Self::NvlinkF= abricNotReady), + bindings::NV_ERR_NVLINK_INIT_ERROR =3D> Ok(Self::NvlinkInitErr= or), + bindings::NV_ERR_NVLINK_MINION_ERROR =3D> Ok(Self::NvlinkMinio= nError), + bindings::NV_ERR_NVLINK_TRAINING_ERROR =3D> Ok(Self::NvlinkTra= iningError), + bindings::NV_ERR_OBJECT_NOT_FOUND =3D> Ok(Self::ObjectNotFound= ), + bindings::NV_ERR_OBJECT_TYPE_MISMATCH =3D> Ok(Self::ObjectType= Mismatch), + bindings::NV_ERR_OPERATING_SYSTEM =3D> Ok(Self::OperatingSyste= m), + bindings::NV_ERR_OTHER_DEVICE_FOUND =3D> Ok(Self::OtherDeviceF= ound), + bindings::NV_ERR_OUT_OF_RANGE =3D> Ok(Self::OutOfRange), + bindings::NV_ERR_OVERLAPPING_UVM_COMMIT =3D> Ok(Self::Overlapp= ingUvmCommit), + bindings::NV_ERR_PAGE_TABLE_NOT_AVAIL =3D> Ok(Self::PageTableN= otAvail), + bindings::NV_ERR_PID_NOT_FOUND =3D> Ok(Self::PidNotFound), + bindings::NV_ERR_PMU_NOT_READY =3D> Ok(Self::PmuNotReady), + bindings::NV_ERR_PRIV_SEC_VIOLATION =3D> Ok(Self::PrivSecViola= tion), + bindings::NV_ERR_PROTECTION_FAULT =3D> Ok(Self::ProtectionFaul= t), + bindings::NV_ERR_QUEUE_TASK_SLOT_NOT_AVAILABLE =3D> Ok(Self::Q= ueueTaskSlotNotAvailable), + bindings::NV_ERR_RC_ERROR =3D> Ok(Self::RcError), + bindings::NV_ERR_REDUCTION_MANAGER_NOT_AVAILABLE =3D> { + Ok(Self::ReductionManagerNotAvailable) + } + bindings::NV_ERR_REJECTED_VBIOS =3D> Ok(Self::RejectedVbios), + bindings::NV_ERR_RESET_REQUIRED =3D> Ok(Self::ResetRequired), + bindings::NV_ERR_RESOURCE_LOST =3D> Ok(Self::ResourceLost), + bindings::NV_ERR_RESOURCE_RETIREMENT_ERROR =3D> Ok(Self::Resou= rceRetirementError), + bindings::NV_ERR_RISCV_ERROR =3D> Ok(Self::RiscvError), + bindings::NV_ERR_SECURE_BOOT_FAILED =3D> Ok(Self::SecureBootFa= iled), + bindings::NV_ERR_SIGNAL_PENDING =3D> Ok(Self::SignalPending), + bindings::NV_ERR_STATE_IN_USE =3D> Ok(Self::StateInUse), + bindings::NV_ERR_TEST_ONLY_CODE_NOT_ENABLED =3D> Ok(Self::Test= OnlyCodeNotEnabled), + bindings::NV_ERR_TIMEOUT =3D> Ok(Self::Timeout), + bindings::NV_ERR_TIMEOUT_RETRY =3D> Ok(Self::TimeoutRetry), + bindings::NV_ERR_TOO_MANY_PRIMARIES =3D> Ok(Self::TooManyPrima= ries), + bindings::NV_ERR_UVM_ADDRESS_IN_USE =3D> Ok(Self::UvmAddressIn= Use), + _ =3D> Err(EINVAL), + } + } +} + +impl TryFrom for GspMsgRmStatus { + type Error =3D Error; + + fn try_from(value: u32) -> Result { + if value =3D=3D bindings::NV_OK { + return Ok(Self::Ok); + } + + if let Ok(warning) =3D GspMsgRmWarning::try_from(value) { + return Ok(Self::Warning(warning)); + } + + Ok(Self::Error(GspMsgRmError::try_from(value)?)) + } +} + /// Empty type to group methods related to heap parameters for running the= GSP firmware. enum GspFwHeapParams {} =20 --=20 2.53.0 From nobody Thu Jun 11 01:40:33 2026 Received: from PH0PR06CU001.outbound.protection.outlook.com (mail-westus3azon11011017.outbound.protection.outlook.com [40.107.208.17]) (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 8B8FC2DB781; Fri, 17 Apr 2026 15:33:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.208.17 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776440030; cv=fail; b=V+xZYLk8EoaXSOOA4Cc9gdkr3FqzFNajqGAt0EPMGT7NjuJiHsk9oM/WoE3y46T6+5gTsPfgBTWUnysi/8mqINMFcwv+7n6crKptblwXLc5Nz2sCWC5vH4PfhHLWpdGNwGIpD1KcWATtQo4xN212VIj3dpJI8scxr2htrzjlXzQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776440030; c=relaxed/simple; bh=H1BLAK8J8b7UCNhUTa9w4YTSxq42o2mHqQbBLgLEU3w=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=OnUOswwwFaYD3yvbjMn4L8QbhNT1SQdYd5wcgq/bm33VDNVKm2hLqNxDtOA8XxaZthd6GZXCXUMqAD5s01gZLoPS9ReWL+7OVTWJ9s7JMWMYMjfe3WFhuoxOC1TAfVCbdst2Hyw9X0g9tTb7Er0hpD4GfUVdFAMIMSWwWUgDIx0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=QCassdyP; arc=fail smtp.client-ip=40.107.208.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="QCassdyP" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TdtUk5YSg1WX1yCU66vqHIDUKAipplwdaQ9LAFR1OWXVH9ZLv5A40ZX9nc1zM/YQrNdvS0BOZePqA7HtjIdEqFRd5k2/G8gL+sEMTmjZaoVCih8RbupjEkPV1Pwd3UidlHnNNoqIcaya4rFvUqqcC8tFYjhlB2yjnoNvN0rTABtoQykgzNWPT1fnmn5UrUi+4Egtsj1XLp0GaOCPuusUjZaXFhhVqY68JH3wca7/awUcLmJmu0GqZLYqyvE/7ev6s6x//1Fm+JLz+ejb+iTTTOPg5FProhHW9ZJq8cqPkAmVhjQdsEt4JX5aSRTdZ1iuBOexsiqtD3Ktiw0HkFdfFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=c6SUhARgFZQSkn6ItCwuhj2KFGqFY2tSL2W/ygskVDM=; b=AcfAUq2oN5RK7Z+F3eZQ/75czBS3vvkBO1LzmuIzfYqRvJ+C+cQ03F7QIetOgqGK4cNTBbmWAgmEZpHoAZn2RlQVhMjtYtKwIvAM4ctFkB/0mH8vWA/1eJhA5KQHxY+xD3hgchrcQF2YgYOXzWhokcmufiJl20WS+s2aqMY8syYUyHApimSWQyXt03Gva8vkgRTnkU40vbqvbj211y1ro7wnDjWjfCwWZqSWhvX0+SruutUdizxFrf5Dw/y4yPcMmwKqj9rOvUWv8cZspCyGAG0MYZwTYq9QUzsg2g85OZfBw2EXM60LwUefBypS4bxqaXptgCjjWB5FtMfCey1xkg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=c6SUhARgFZQSkn6ItCwuhj2KFGqFY2tSL2W/ygskVDM=; b=QCassdyPu8gACpeXGK6cNhAew+TJ+xmGv/U6U+zQnOCvQB0QdR4sm779ekBciWUzFkSijU1WkpvI8VZ1Jmpf3u9A8P6JzGbE3mEApciok9DVDmYmqx3ppjr6pgjsNdEu72U6w8YPR8EIbjneYrZVlTGknnKmxnG3vzBoVRoIjr4rKLwxTrX6vqk16V9qtZET7g2QFNhGr/N2L5bvjK7zRraHPK0WnveIpjZP06kIvG+XR3+5IeNMSTHBgqVmMEJwGhkF6zxsGJpx1cxi4cUtH7+vwdwCCMGsIjtNHH+4KSBCpLz5AFchMxrzE3XzFQT5cDSBO5cSFFhCJ8Ps0+2wbw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BL0PR12MB2353.namprd12.prod.outlook.com (2603:10b6:207:4c::31) by DM3PR12MB9389.namprd12.prod.outlook.com (2603:10b6:0:46::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9818.25; Fri, 17 Apr 2026 15:33:44 +0000 Received: from BL0PR12MB2353.namprd12.prod.outlook.com ([fe80::99b:dcff:8d6d:78e0]) by BL0PR12MB2353.namprd12.prod.outlook.com ([fe80::99b:dcff:8d6d:78e0%4]) with mapi id 15.20.9818.023; Fri, 17 Apr 2026 15:33:43 +0000 From: Eliot Courtney Date: Sat, 18 Apr 2026 00:29:21 +0900 Subject: [PATCH v4 3/8] gpu: nova-core: gsp: add GspRpcError for Cmdq RPC error handling Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260418-rmcontrol-v4-3-fda8c76dbb95@nvidia.com> References: <20260418-rmcontrol-v4-0-fda8c76dbb95@nvidia.com> In-Reply-To: <20260418-rmcontrol-v4-0-fda8c76dbb95@nvidia.com> To: Danilo Krummrich , Alice Ryhl , Alexandre Courbot , David Airlie , Simona Vetter Cc: John Hubbard , Alistair Popple , Joel Fernandes , Timur Tabi , rust-for-linux@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Eliot Courtney X-Mailer: b4 0.15.2 X-ClientProxiedBy: TYCP286CA0173.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c6::16) To BL0PR12MB2353.namprd12.prod.outlook.com (2603:10b6:207:4c::31) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL0PR12MB2353:EE_|DM3PR12MB9389:EE_ X-MS-Office365-Filtering-Correlation-Id: 982a715c-61e0-4562-231f-08de9c96b583 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|376014|366016|1800799024|22082099003|18002099003|56012099003; X-Microsoft-Antispam-Message-Info: Ufc66otSq/g3pJhL5nyhu/R1qQM+geNhkqZlGu0UAp3MeqhDqzyWibNGwZCGDbHKbeAeYkG8whIk4I836tocIYkRmgtQ8sIwmkri8Zc/DIre1NWlc3u2hvXbBfRJjflw05B7Bt65pVR21D4x3cUdBZB3wPcR/1UCFwyJKa4aapx/qMi43UKciEgvUq1xbvorhqVW0/QV4cMFlXGEHhXHdWCfya50amSTiTMCu0KcYpOWWLrytwITIX8GCTUiAUWrslpm7nM/ejRpCn+2tCp6PUwKH2qkjSyZllJsaEZbXBbgMyhF7i16BVJQWCrlcLhec6OAXoFfTgN3z8XMHOmeYgxdpgNZVoDJC3Kk6fXvd2WZgl3Qszjrb6fymYh/PLJKPjo2zLOe7EViXlN2UmBTW9C3SS5mcji6yR9nGUxeVVum4ogvNzhmIwBHQ/gWDpr47ewOXxApCEkE65ZUeG8DhyCtn0k4oaTmOvZYRN6nCMiwQ+06iduqizwBFRvnFEQht8u0y6+Vrnm1fHErEhFPN3UUDqmM+FDSWch7GRxxnMTRjMt2dTp+tt4sEdVISRa5HsdopgAGCA6upUNkGJOnw/694dr4HXXSeFot2PR+fKNTuJC3M0JqOZB5HNWplKePo4d+td60kGCWCga2eVrrfFn62Q0LLLNtSxhKPH+XxOcIS0WAqw+FWLuScrNpT1Fx7a9Z4LYWduiYU8ai4ajPEbqZRuWEOo0EbSu/0oYNkvQ= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR12MB2353.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(376014)(366016)(1800799024)(22082099003)(18002099003)(56012099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bUNPWWI4YXplMElkWmUrdWxwOFBEWWs4L3M2RkE4bHl6K1pPSlJwQlRYTjcv?= =?utf-8?B?aDcwOUMrdWN3Q0xsbXNxeUh4bU1RNU16R3pXSzZubHM0aFovSEFOSkFzUlU2?=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LVmZGN3FGRnFDSjJuSjF0TURX?= =?utf-8?B?eTYyTjhvUHpRMG1XTHBFbDF3eXUvTEdMTmdYdFJiMDJkUFUxTnNodHZjTmdp?= =?utf-8?B?K2dDd1dCZURhSHhlMTlHcDhBUkRVMFpKaU9YakpMM3NxQzgxQlVtS1RzQ1oy?= =?utf-8?B?WGd2aTVaSlZOOU5RSkhYMzZSUkh3bDhWeWxtZENJampKQWxib0plbDhlMXc3?= =?utf-8?B?ZTR6S1crdFI5TVpoMTFZcjk1dWpQazFUTFEzUm5rK2JWS2ErRGdoKytsaFo5?= =?utf-8?B?MVFUSE5vL1hjK2UwazJwZFgxcUd4OGdCY1NqQmVacjVwZTgvZ0MrMERuNGpl?= =?utf-8?B?MXFrdVcyWVlEWnQ3VWEyR0J5K2p2VnlOOHZDWDR2SC9BbnJpNWs0MTI4MUxO?= =?utf-8?B?NkxING5rLzZYRW5kNGFuZVoxcEpQK05zT3B0S1VIVWlEUUx2elAxRVdFNmQy?= =?utf-8?Q?Z6bdOuo7d0OZy4SFlhUJT62vZZQNfPLvC31Q12yhSK7jN?= X-MS-Exchange-AntiSpam-MessageData-1: 8ABYiurTyFyg5w== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 982a715c-61e0-4562-231f-08de9c96b583 X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB2353.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Apr 2026 15:33:43.8836 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8zdmcV470Qtqrb2k9lYB5RVg2j/5p6BeQg724maUI0p06gU63hgnEyPsiI6TkQMHdhDFE5YQjUD9VsNN/vwlDA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB9389 Currently, the RPC status value is ignored, but it can actually indicate failure from GSP-RM. Add a new error type used by `Cmdq` to surface this failure mode. Signed-off-by: Eliot Courtney --- drivers/gpu/nova-core/gsp/cmdq.rs | 112 ++++++++++++++++++++++-------= ---- drivers/gpu/nova-core/gsp/commands.rs | 7 ++- drivers/gpu/nova-core/gsp/fw.rs | 37 ++++++++++- drivers/gpu/nova-core/gsp/sequencer.rs | 5 +- 4 files changed, 117 insertions(+), 44 deletions(-) diff --git a/drivers/gpu/nova-core/gsp/cmdq.rs b/drivers/gpu/nova-core/gsp/= cmdq.rs index 569bb1a2501c..501d01e2bedd 100644 --- a/drivers/gpu/nova-core/gsp/cmdq.rs +++ b/drivers/gpu/nova-core/gsp/cmdq.rs @@ -41,6 +41,7 @@ gsp::{ fw::{ GspMsgElement, + GspMsgRmError, MsgFunction, MsgqRxHeader, MsgqTxHeader, @@ -55,6 +56,24 @@ sbuffer::SBufferIter, // }; =20 +/// Error returned by GSP RPC operations. +#[derive(Debug)] +pub(crate) enum GspRpcError { + /// The command transport or reply decoding failed. + Transport(Error), + /// The GSP-RM RPC returned an RM-specific error status. + Rm(GspMsgRmError), +} + +impl From for Error { + fn from(err: GspRpcError) -> Self { + match err { + GspRpcError::Transport(err) =3D> err, + GspRpcError::Rm(status) =3D> status.into(), + } + } +} + /// Marker type representing the absence of a reply for a command. Command= s using this as their /// reply type are sent using [`Cmdq::send_command_no_wait`]. pub(crate) struct NoReply; @@ -547,13 +566,14 @@ fn notify_gsp(bar: &Bar0) { /// /// # Errors /// - /// - `ETIMEDOUT` if space does not become available to send the comma= nd, or if the reply is - /// not received within the timeout. - /// - `EIO` if the variable payload requested by the command has not b= een entirely + /// - `Transport(ETIMEDOUT)` if space does not become available to sen= d the command, or if the + /// reply is not received within the timeout. + /// - `Transport(EIO)` if the variable payload requested by the comman= d has not been entirely /// written to by its [`CommandToGsp::init_variable_payload`] method. + /// - `Rm(status)` if GSP-RM returned an error for this RPC. /// - /// Error codes returned by the command and reply initializers are pro= pagated as-is. - pub(crate) fn send_command(&self, bar: &Bar0, command: M) -> Result= + /// Error codes returned by the command and reply initializers are pro= pagated as `Transport`. + pub(crate) fn send_command(&self, bar: &Bar0, command: M) -> Result= where M: CommandToGsp, M::Reply: MessageFromGsp, @@ -561,12 +581,14 @@ pub(crate) fn send_command(&self, bar: &Bar0, comm= and: M) -> Result Error: From<::InitError>, { let mut inner =3D self.inner.lock(); - inner.send_command(bar, command)?; + inner + .send_command(bar, command) + .map_err(GspRpcError::Transport)?; =20 loop { match inner.receive_msg::(Self::RECEIVE_TIMEOUT) { Ok(reply) =3D> break Ok(reply), - Err(ERANGE) =3D> continue, + Err(GspRpcError::Transport(ERANGE)) =3D> continue, Err(e) =3D> break Err(e), } } @@ -592,7 +614,7 @@ pub(crate) fn send_command_no_wait(&self, bar: &Bar0= , command: M) -> Result /// Receive a message from the GSP. /// /// See [`CmdqInner::receive_msg`] for details. - pub(crate) fn receive_msg(&self, timeout: Delta) ->= Result + pub(crate) fn receive_msg(&self, timeout: Delta) ->= Result where // This allows all error types, including `Infallible`, to be used= for `M::InitError`. Error: From, @@ -801,52 +823,68 @@ fn wait_for_msg(&self, timeout: Delta) -> Result> { /// Receive a message from the GSP. /// /// The expected message type is specified using the `M` generic param= eter. If the pending - /// message has a different function code, `ERANGE` is returned and th= e message is consumed. + /// message has a different function code, `Transport(ERANGE)` is retu= rned and the message is + /// consumed. /// /// The read pointer is always advanced past the message, regardless o= f whether it matched. /// /// # Errors /// - /// - `ETIMEDOUT` if `timeout` has elapsed before any message becomes = available. - /// - `EIO` if there was some inconsistency (e.g. message shorter than= advertised) on the - /// message queue. - /// - `EINVAL` if the function code of the message was not recognized. - /// - `ERANGE` if the message had a recognized but non-matching functi= on code. + /// - `Transport(ETIMEDOUT)` if `timeout` has elapsed before any messa= ge becomes available. + /// - `Transport(EIO)` if there was some inconsistency (e.g. message s= horter than advertised) + /// on the message queue. + /// - `Transport(EINVAL)` if the function code of the message was not = recognized. + /// - `Transport(ERANGE)` if the message had a recognized but non-matc= hing function code. + /// - `Rm(status)` if GSP-RM returned an error for this RPC. /// - /// Error codes returned by [`MessageFromGsp::read`] are propagated as= -is. - fn receive_msg(&mut self, timeout: Delta) -> Result= + /// Error codes returned by [`MessageFromGsp::read`] are propagated as= `Transport`. + fn receive_msg(&mut self, timeout: Delta) -> Result= where // This allows all error types, including `Infallible`, to be used= for `M::InitError`. Error: From, { - let message =3D self.wait_for_msg(timeout)?; - let function =3D message.header.function().map_err(|_| EINVAL)?; + let message =3D self.wait_for_msg(timeout).map_err(GspRpcError::Tr= ansport)?; + let function =3D message + .header + .function() + .map_err(|_| GspRpcError::Transport(EINVAL))?; =20 // Extract the message. Store the result as we want to advance the= read pointer even in // case of failure. - let result =3D if function =3D=3D M::FUNCTION { - let (cmd, contents_1) =3D M::Message::from_bytes_prefix(messag= e.contents.0).ok_or(EIO)?; + let result =3D (|| -> Result { + message + .header + .status() + .map_err(GspRpcError::Transport)? + .log_if_warning(&self.dev, function) + .map_err(GspRpcError::Rm)?; + + if function !=3D M::FUNCTION { + return Err(GspRpcError::Transport(ERANGE)); + } + + let (cmd, contents_1) =3D M::Message::from_bytes_prefix(messag= e.contents.0) + .ok_or(GspRpcError::Transport(EIO))?; let mut sbuffer =3D SBufferIter::new_reader([contents_1, messa= ge.contents.1]); =20 - M::read(cmd, &mut sbuffer) - .map_err(|e| e.into()) - .inspect(|_| { - if !sbuffer.is_empty() { - dev_warn!( - &self.dev, - "GSP message {:?} has unprocessed data\n", - function - ); - } - }) - } else { - Err(ERANGE) - }; + let msg =3D M::read(cmd, &mut sbuffer).map_err(|e| GspRpcError= ::Transport(e.into()))?; + + if !sbuffer.is_empty() { + dev_warn!( + &self.dev, + "GSP message {:?} has unprocessed data\n", + function + ); + } + + Ok(msg) + })(); =20 // Advance the read pointer past this message. - self.gsp_mem.advance_cpu_read_ptr(u32::try_from( - message.header.length().div_ceil(GSP_PAGE_SIZE), - )?); + self.gsp_mem.advance_cpu_read_ptr( + u32::try_from(message.header.length().div_ceil(GSP_PAGE_SIZE)) + .map_err(|_| GspRpcError::Transport(EINVAL))?, + ); =20 result } diff --git a/drivers/gpu/nova-core/gsp/commands.rs b/drivers/gpu/nova-core/= gsp/commands.rs index c89c7b57a751..b8f64bfe9313 100644 --- a/drivers/gpu/nova-core/gsp/commands.rs +++ b/drivers/gpu/nova-core/gsp/commands.rs @@ -23,6 +23,7 @@ cmdq::{ Cmdq, CommandToGsp, + GspRpcError, MessageFromGsp, NoReply, // }, @@ -169,8 +170,8 @@ pub(crate) fn wait_gsp_init_done(cmdq: &Cmdq) -> Result= { loop { match cmdq.receive_msg::(Cmdq::RECEIVE_TIMEOUT) { Ok(_) =3D> break Ok(()), - Err(ERANGE) =3D> continue, - Err(e) =3D> break Err(e), + Err(GspRpcError::Transport(ERANGE)) =3D> continue, + Err(e) =3D> break Err(e.into()), } } } @@ -234,6 +235,6 @@ pub(crate) fn gpu_name(&self) -> core::result::Result<&= str, GpuNameError> { } =20 /// Send the [`GetGspInfo`] command and awaits for its reply. -pub(crate) fn get_gsp_info(cmdq: &Cmdq, bar: &Bar0) -> Result { +pub(crate) fn get_gsp_info(cmdq: &Cmdq, bar: &Bar0) -> Result { cmdq.send_command(bar, GetGspStaticInfo) } diff --git a/drivers/gpu/nova-core/gsp/fw.rs b/drivers/gpu/nova-core/gsp/fw= .rs index a8d7c62af097..5fabb815a919 100644 --- a/drivers/gpu/nova-core/gsp/fw.rs +++ b/drivers/gpu/nova-core/gsp/fw.rs @@ -6,9 +6,13 @@ // Alias to avoid repeating the version number with every use. use r570_144 as bindings; =20 -use core::ops::Range; +use core::{ + fmt, + ops::Range, // +}; =20 use kernel::{ + device, dma::Coherent, prelude::*, ptr::{ @@ -99,7 +103,6 @@ pub(in crate::gsp) fn advance_cpu_write_ptr(qs: &Coheren= t, count: u32) { =20 /// Status code returned by GSP-RM operations. #[derive(Copy, Clone, Debug, PartialEq, Eq)] -#[expect(dead_code)] pub(crate) enum GspMsgRmStatus { /// The operation succeeded. Ok, @@ -605,6 +608,31 @@ fn try_from(value: u32) -> Result { } } =20 +impl GspMsgRmStatus { + /// Converts [`GspMsgRmStatus`] to a [`Result`], logging if the status= is a warning. + /// + /// `rpc_name` identifies the RPC for the log message. + pub(super) fn log_if_warning( + self, + dev: &device::Device, + rpc_name: impl fmt::Debug, + ) -> Result<(), GspMsgRmError> { + match self { + Self::Ok =3D> Ok(()), + Self::Warning(warning) =3D> { + dev_warn!( + dev, + "GSP RPC {:?} returned warning {:?}\n", + rpc_name, + warning + ); + Ok(()) + } + Self::Error(status) =3D> Err(status), + } + } +} + /// Empty type to group methods related to heap parameters for running the= GSP firmware. enum GspFwHeapParams {} =20 @@ -1347,6 +1375,11 @@ pub(crate) fn function(&self) -> Result { .map_err(|_| self.inner.rpc.function) } =20 + /// Returns the RPC status from the message header. + pub(super) fn status(&self) -> Result { + self.inner.rpc.rpc_result.try_into() + } + // Returns the number of elements (i.e. memory pages) used by this mes= sage. pub(crate) fn element_count(&self) -> u32 { self.inner.elemCount diff --git a/drivers/gpu/nova-core/gsp/sequencer.rs b/drivers/gpu/nova-core= /gsp/sequencer.rs index 474e4c8021db..672c7d6c3cf6 100644 --- a/drivers/gpu/nova-core/gsp/sequencer.rs +++ b/drivers/gpu/nova-core/gsp/sequencer.rs @@ -29,6 +29,7 @@ gsp::{ cmdq::{ Cmdq, + GspRpcError, MessageFromGsp, // }, fw, @@ -360,8 +361,8 @@ pub(crate) fn run(cmdq: &Cmdq, params: GspSequencerPara= ms<'a>) -> Result { let seq_info =3D loop { match cmdq.receive_msg::(Cmdq::RECEIVE_TIMEOUT) { Ok(seq_info) =3D> break seq_info, - Err(ERANGE) =3D> continue, - Err(e) =3D> return Err(e), + Err(GspRpcError::Transport(ERANGE)) =3D> continue, + Err(e) =3D> return Err(e.into()), } }; =20 --=20 2.53.0 From nobody Thu Jun 11 01:40:33 2026 Received: from BYAPR05CU005.outbound.protection.outlook.com (mail-westusazon11010036.outbound.protection.outlook.com [52.101.85.36]) (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 A9FAE33FE12; Fri, 17 Apr 2026 15:33:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.85.36 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776440033; cv=fail; b=i8XamYC5aCQRV+jK8c/ZLBXN7CET4j+gDDSd3o/uSwjH7Nw+SH3BXzjLu+CUBAi453n29SZL8Hl+qy9p6ovZnYqTyEBuRaxcyWYP74xxRRetjZlilVGoF9Z2lc/odS2T+6Jqyol+jJKlYgY+Inhjqe2WnuSI0qj4yMpfv1M8bNE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776440033; c=relaxed/simple; bh=glbSMOlYw/upAHeW/MbAPuxJAZJCdIVg7pjcM6MUmi4=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=lKqsmMNSOheLXgHT/0FCGt7sjiS8OF+yLA2NQT09H3d9Tg/mHRxx4xt7RPWAKWB/BpdS89n30e+aK4P028eIl7APA5FUdjS+oy3KDTtSdWyb2uxd6yfk4uBXWuhi1qYNzDhSyChg8cLykLek4lXJuB2CVO2R04d5MX0XjQ7Fckc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=Rzgp3YYs; arc=fail smtp.client-ip=52.101.85.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="Rzgp3YYs" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UoEAdnl8SMx0scNWS4Bj6RajOKUIGqMA4dfcTjrLAhOe+JeLGNZEK4KHOsjZleMrOitfHJnIvhjqDd6SWjgrNW1kP3uJqaMielsMCV1ZqmaKhNe0aA1Q/v8heHM19sF0ZPinqTnHmgfz2XcPdeLnqFvbPoeTq5P/j2wgWEjrUIQKIB4d5RVf/VC8pOCElRV5gag/9q9AF3hrzVc8FAwSA3dUD4F7RpJzHw8MDQw3IIvD7x5nEvx7oCdFqJ/IUTFNBLCgjB/kHAi7rQwZrH1D3JuFS4J7+fQcJkVcb6ec7zkYVfseihI85yc5g4l9KeuoHNXJMnWbT61nAj2q+FFd0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qtBnRxLvtH7eqPhgMtyj3U5Um7xYlqzvbRKtu5TBQig=; b=e1+Rj92j94KXaHDf31YrYSay9WKApkh/DnxqXZEucEkunSSrmZu0aTTT+Ivw3tteS10GmqVyL7wawSYiBQOuqid7bDJBaGvqDjo3f/nSN2k6rcEiix77Dx8UgS91/uLx28rlrQV6H27IFTl9V3J7xe2eMMapVskmmd4T37nYvo2Kmse80aBwA6quHvRshDTDbGzzzDbGw2O+LHPezu/HnebMGgjtM5ZiMky5qbFN49tnAHKhMw+5fHNQ4STvRPYh67tYYMFZ9LddYKYdUaurl2u+QHS0UOoLc1QoDnX6hC3/yA98ld+LQ8jQd0DDDpd+TfiN4z7PZc0L2LMetXXSmA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qtBnRxLvtH7eqPhgMtyj3U5Um7xYlqzvbRKtu5TBQig=; b=Rzgp3YYs7wqtiI+NeyaiMelerhurpPCHEW906W7SwenseJP89Zi0gTJPmT4ciwXX8qWQn7hN8I72zFkhS9A9xMw/k8bVT6sJ00DwF34U3Vg5hb2SSpRWIIa78gaoSWWx5Vb5yFN+Ids7Ti/8llvCqDJ7aIBY1qE1DHFYtBKMB9bafw/ijG/nzzTZOaNYdofjD2/ILZluJlOq1bRN76+lv53YfX1ElC7M8908mu7TAgdS8/+bbgEpHK+8HpkBfmwiuTLEEreegFrkoFxJPjYmniaH5bmO9zb6xegIM/JnHncdzR+lgAMVsTuzTImXbhLtvKaGwr1NAQpQvOUEP1e1Ew== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BL0PR12MB2353.namprd12.prod.outlook.com (2603:10b6:207:4c::31) by DM3PR12MB9389.namprd12.prod.outlook.com (2603:10b6:0:46::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9818.25; Fri, 17 Apr 2026 15:33:48 +0000 Received: from BL0PR12MB2353.namprd12.prod.outlook.com ([fe80::99b:dcff:8d6d:78e0]) by BL0PR12MB2353.namprd12.prod.outlook.com ([fe80::99b:dcff:8d6d:78e0%4]) with mapi id 15.20.9818.023; Fri, 17 Apr 2026 15:33:48 +0000 From: Eliot Courtney Date: Sat, 18 Apr 2026 00:29:22 +0900 Subject: [PATCH v4 4/8] gpu: nova-core: gsp: expose GSP-RM internal client and subdevice handles Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260418-rmcontrol-v4-4-fda8c76dbb95@nvidia.com> References: <20260418-rmcontrol-v4-0-fda8c76dbb95@nvidia.com> In-Reply-To: <20260418-rmcontrol-v4-0-fda8c76dbb95@nvidia.com> To: Danilo Krummrich , Alice Ryhl , Alexandre Courbot , David Airlie , Simona Vetter Cc: John Hubbard , Alistair Popple , Joel Fernandes , Timur Tabi , rust-for-linux@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Eliot Courtney X-Mailer: b4 0.15.2 X-ClientProxiedBy: TYCPR01CA0179.jpnprd01.prod.outlook.com (2603:1096:400:2b2::14) To BL0PR12MB2353.namprd12.prod.outlook.com (2603:10b6:207:4c::31) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL0PR12MB2353:EE_|DM3PR12MB9389:EE_ X-MS-Office365-Filtering-Correlation-Id: 37a2f607-af4d-4b1f-e749-08de9c96b818 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|376014|366016|1800799024|22082099003|18002099003|56012099003; X-Microsoft-Antispam-Message-Info: Jy3taqNaZkYSab8k96ppt6zlIc0tXGe/E79U0gVki4n4+0Hf0GiyYSubBxj8WW1ZNWkx8pHRDriNk5iT2OZ486zbm+IuWdbFP2pH2w86iEHVxfgLLBNew92oxt9bu08yw5j4wD98R5vidPkzCDbYwK24IEsYxWEujSYG7zV4/TObZXqg69vYygFF8OnSQLJIME5uousx05mzEnz+ihzexvEKf8J9VCpl/t6wi6ZgyQ6K3UDuOZ9XufCSNrrmXemj2rDEqcjasoO37DUCc5ftWZMJ9fMx1dTOgO8CRLJgvXbhnlmsTmeBzwL2PMjRVPrSs7vAHhUOeCLtWHSDeg2g9iWoz7CErS1ulFY5l+9gbw4trwF3khfutPpVITteGWsDxHB2nnR47L+Kz0i0fkgKdutFur8bkbvjqRhHhpGI+mG+Suclrtb6OrVqd4GcJ6Pa5maklH34pRyL0pZN0P7J3zC/qecvH3ZyNXQJNL3Oen8k/EzeIyjG6SSM0V3IVBX5Tu/PVxRaHSUTk9Z+jaAV9WWRc5LKlqF68eSgdKQonvphwTOsDmojexCV/zoxhuQ972QSIGUYpxSv2jVEElY5z24MlWbu9WjIsbCjAn0gD/F+wwODUfv3og2lQfNMLILQiGFwb6ghMZh5wXof2e1NZyQV0jH2FTvzKNplrrBL8wsiYF4HlwXOY69fIcdRAxwTbhzt0M8toejBv5u/41K4mtT2WcSUjhJPfPq+iXOp2So= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR12MB2353.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(376014)(366016)(1800799024)(22082099003)(18002099003)(56012099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?c3psZWJsYUU3QTQxb2RuWEJVMUNzVE42Nk8zWDBHWXRCTHU0c1ZOZGxVNDV1?= =?utf-8?B?TU4yNWoya0NXNDQxRjQzZVpodDFiOEI3VFJRUUtRUWp1bDBnQW1HSWt4SHdw?= =?utf-8?B?b1RYWmhOcVR5WENCdDU1NkUrVk1uRUZCaFJJNGJkUmduYlNpMUlWQnhRN3Ex?= =?utf-8?B?QmFLVTYxUEh4SWN3Sm5wN0h3bkxVK3M3d2tVTldDTE55NmJjUFNqdTErVlhE?= =?utf-8?B?VlprYlFKc3BqbzlYaE5RbGxrN0MxdmxhZ3N5U1ppcnJyNEV6cFFhcnplc3Zz?= =?utf-8?B?Vk1SMFY3bzFQelQyTGZLQytYSUIzdWowSlpOa1MrUzVCTzNtWlE4SGtQc2Rw?= =?utf-8?B?MnVjSkZDbGVCTnpUR2FvdVZWU0NqbzIvOXNiTzBERzlDbGx4RDlyZ2pVN1lw?= =?utf-8?B?dUcybHJCVTZ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mhXY3BDMEw0MFByZXEzMnBl?= =?utf-8?B?cnV4OVlaSHVRZXlORy9lcW9MS2xEZWk2cGRVNmFqd0hCa3J3Um5mU2Y5bnR6?= =?utf-8?B?MWxyY0VITEUwaUIwaFJmTFZWNzFUOW1MS1hVT0dObU9LNldRZmNSOHNpalkx?= =?utf-8?Q?gna085NLiqVFTpQtcXRhgNdnLeDUCJMj0sdSSv6cYBSV2?= X-MS-Exchange-AntiSpam-MessageData-1: Kx8U0911xS9axg== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 37a2f607-af4d-4b1f-e749-08de9c96b818 X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB2353.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Apr 2026 15:33:48.1907 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DODRLmlvm7WISXpx3A/jMd8K2yfrb+2iFCfTRslPvo46b9cQfPwh7VLtbQ8FEJ7rZ67CuIAfsQascrTGkRXMlg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB9389 Expose the `hInternalClient` and `hInternalSubdevice` handles. These are needed for RM control calls. Reviewed-by: Joel Fernandes Signed-off-by: Eliot Courtney --- drivers/gpu/nova-core/gsp/commands.rs | 65 ++++++++++++++++++++++++++++= ++++ drivers/gpu/nova-core/gsp/fw/commands.rs | 19 +++++++++- 2 files changed, 83 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nova-core/gsp/commands.rs b/drivers/gpu/nova-core/= gsp/commands.rs index b8f64bfe9313..8a19ef689731 100644 --- a/drivers/gpu/nova-core/gsp/commands.rs +++ b/drivers/gpu/nova-core/gsp/commands.rs @@ -4,6 +4,7 @@ array, convert::Infallible, ffi::FromBytesUntilNulError, + marker::PhantomData, str::Utf8Error, // }; =20 @@ -35,6 +36,54 @@ sbuffer::SBufferIter, }; =20 +/// Marker type for a GSP-RM client handle. +/// +/// A client handle identifies a client which provides a namespace for RM = objects. Lookup of objects +/// happens within the client namespace. +pub(crate) struct Client; + +/// Marker type for a GSP-RM device handle. +/// +/// A device handle identifies a logical GPU device instance under a clien= t. In multi-GPU +/// configurations it can represent a grouped or logical device. +#[expect(dead_code)] +pub(crate) struct Device; + +/// Marker type for a GSP-RM subdevice handle. +/// +/// A subdevice handle identifies a child of a device that selects one spe= cific GPU within that +/// device. +pub(crate) struct Subdevice; + +/// A typed GSP-RM object handle. +/// +/// These handles form a tree structure with different types of RM objects= , with client at the root. +/// An RM object is anything identified by a valid handle. For example, th= e tree may look like +/// Client -> Device -> Subdevice, where there may be multiple devices und= er each client, and +/// multiple subdevices under each device. +#[derive(Debug)] +pub(crate) struct Handle(u32, PhantomData); + +impl Clone for Handle { + fn clone(&self) -> Self { + *self + } +} +impl Copy for Handle {} + +impl Handle { + /// Creates a new handle from a raw value. + pub(crate) fn new(raw: u32) -> Self { + Self(raw, PhantomData) + } + + /// Returns the raw handle value. + #[expect(dead_code)] + pub(crate) fn as_raw(self) -> u32 { + self.0 + } +} + /// The `GspSetSystemInfo` command. pub(crate) struct SetSystemInfo<'a> { pdev: &'a pci::Device, @@ -193,6 +242,8 @@ fn init(&self) -> impl Init { /// The reply from the GSP to the [`GetGspInfo`] command. pub(crate) struct GetGspStaticInfoReply { gpu_name: [u8; 64], + client: Handle, + subdevice: Handle, } =20 impl MessageFromGsp for GetGspStaticInfoReply { @@ -206,6 +257,8 @@ fn read( ) -> Result { Ok(GetGspStaticInfoReply { gpu_name: msg.gpu_name_str(), + client: msg.client(), + subdevice: msg.subdevice(), }) } } @@ -232,6 +285,18 @@ pub(crate) fn gpu_name(&self) -> core::result::Result<= &str, GpuNameError> { .to_str() .map_err(GpuNameError::InvalidUtf8) } + + /// Returns the client handle allocated by GSP-RM. + #[expect(dead_code)] + pub(crate) fn client(&self) -> Handle { + self.client + } + + /// Returns the subdevice handle allocated by GSP-RM. + #[expect(dead_code)] + pub(crate) fn subdevice(&self) -> Handle { + self.subdevice + } } =20 /// Send the [`GetGspInfo`] command and awaits for its reply. diff --git a/drivers/gpu/nova-core/gsp/fw/commands.rs b/drivers/gpu/nova-co= re/gsp/fw/commands.rs index db46276430be..9fce6ffefbce 100644 --- a/drivers/gpu/nova-core/gsp/fw/commands.rs +++ b/drivers/gpu/nova-core/gsp/fw/commands.rs @@ -10,7 +10,14 @@ }, // }; =20 -use crate::gsp::GSP_PAGE_SIZE; +use crate::gsp::{ + commands::{ + Client, + Handle, + Subdevice, // + }, + GSP_PAGE_SIZE, // +}; =20 use super::bindings; =20 @@ -121,6 +128,16 @@ impl GspStaticConfigInfo { pub(crate) fn gpu_name_str(&self) -> [u8; 64] { self.0.gpuNameString } + + /// Returns the client handle allocated by GSP-RM. + pub(crate) fn client(&self) -> Handle { + Handle::new(self.0.hInternalClient) + } + + /// Returns the subdevice handle allocated by GSP-RM. + pub(crate) fn subdevice(&self) -> Handle { + Handle::new(self.0.hInternalSubdevice) + } } =20 // SAFETY: Padding is explicit and will not contain uninitialized data. --=20 2.53.0 From nobody Thu Jun 11 01:40:33 2026 Received: from BYAPR05CU005.outbound.protection.outlook.com (mail-westusazon11010004.outbound.protection.outlook.com [52.101.85.4]) (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 877CF3314C4; Fri, 17 Apr 2026 15:33:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.85.4 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776440037; cv=fail; b=Cxjw/LMaQUU0hzPhp9c8GoCSk+7HKhUPnm69hysNIekR514HjU9LV0/NEvIzhPvoVTE2851S8/r7pY5iL+X8Rw58+03LXjzLPa/DoTnb+nuR+lGlHXn05B65Pc26YM1pBRRXKyqXVvOl6m7KIyggCbXFc2Qkxe8GEV4oTDtRsAI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776440037; c=relaxed/simple; bh=BOjFilxU7GN2GknjV2eTinfbqdEAg6O9jVoQURHU3vM=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=DzPS3wGc2DCML5nVsu94kiemJDplAe0wEIJOCGPTag6jEMshaegX0z7HL+ollu2EmT4zrfhGC7mAYcP0mQwusmWqntyvnXZHL26Mb9FZSjnNhi4VAOG/MsrQ0284ngPHYot9pKAmArNbvlY6uBkpP1luZIloI8FvQ3w9cLAacYE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=pkYkMAzy; arc=fail smtp.client-ip=52.101.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="pkYkMAzy" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=F9UUMZUHyMAu6PfjohiK68IGXbVhay3gVQcvbRtkaFlidhCLyMzGEXQPu1jm24vx/S4NOiqGd6Ml0JHZ7Rije4uREG8uK+gK7sZl0/VZ+ljDcbznYMIC/JNtC28vfWhDHSpWddia1XDSf0y6oCJhMMkxQ4iQnR76n8H2DV+G19hRdPTBT1XVUiTUh/MQrBMM8Faq6ZJG7LkhENFTaLqsfqvrsrIPzZcLnnbbqnNJvN3Cdi5QG+NyjAGut1m8yzEljGfClqLCjJR0Tt5VsMwERhhf08gWTqBAjshQfbVoGXxtwKNSQtVZGkuHwZ+9QDFSSuLRmQXquhPGJaMjq1h9Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HjXzuZYc5YKdS0JH7/rOa2zGw8esB22OxK2M4uT+qe8=; b=K+F/KlLWe6W7gZV6vtE797t7mlQ3fp8iVZyqHu6ebK5QE8FdYbwFSLj/sqAP41UkQqFqaE304FCUeLw9zld67Re7wJiqHqf3qGq9lXrWVLrGejXRigQKF6x/nm5IKrlcYekmWvK90tVf1W3tve+V18PSzN7la5LoxKKH3dgacuYzl44LQUqUTqcH/aUsFi3O695IeqKZknHpBGUugLbzR8zRc9SKwoIFCIO8HoQFuRjAMmuQOlRCgbxrolarvsQg5wZYAr93x9UjpvIF7q/b95ee5t4fOtai9yXFkD5N9+I3YHnGndyAUn6aFBbI7BixCezVp7/tWT1ZWNqCFApNdA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HjXzuZYc5YKdS0JH7/rOa2zGw8esB22OxK2M4uT+qe8=; b=pkYkMAzy59eANOCwncMK7KT7SQ1MppTfP7HHt3cjWPLYrB2uv8KLqPcg736B8YnJltpkimTxwbHaGzZMAPrtk7UtzYukGPkmFxOrKjxDvIn4l1DgRbT0/TWTrHtltHpPYGJbtHgHuDIwY6Ng1r93YZmRItjQat5c4+UyPNW8PlgJM0r28MLALN8MlngygJ7ljCepQ0K50HAPEEzB1nSXMi6RL40YGh9BRjEOWwi0ZWfNOptVYpe+iCvK23UNiIrRmxKfXDRgwsrRTYT74ecQFTMOPTltiHLGtZYzlwVkyHX9/WSUsY+fo9NCFh/ulMBh/2jySVQmIV9XaIuwLuF89Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BL0PR12MB2353.namprd12.prod.outlook.com (2603:10b6:207:4c::31) by DM3PR12MB9389.namprd12.prod.outlook.com (2603:10b6:0:46::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9818.25; Fri, 17 Apr 2026 15:33:52 +0000 Received: from BL0PR12MB2353.namprd12.prod.outlook.com ([fe80::99b:dcff:8d6d:78e0]) by BL0PR12MB2353.namprd12.prod.outlook.com ([fe80::99b:dcff:8d6d:78e0%4]) with mapi id 15.20.9818.023; Fri, 17 Apr 2026 15:33:52 +0000 From: Eliot Courtney Date: Sat, 18 Apr 2026 00:29:23 +0900 Subject: [PATCH v4 5/8] gpu: nova-core: gsp: add RM control RPC structure binding Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260418-rmcontrol-v4-5-fda8c76dbb95@nvidia.com> References: <20260418-rmcontrol-v4-0-fda8c76dbb95@nvidia.com> In-Reply-To: <20260418-rmcontrol-v4-0-fda8c76dbb95@nvidia.com> To: Danilo Krummrich , Alice Ryhl , Alexandre Courbot , David Airlie , Simona Vetter Cc: John Hubbard , Alistair Popple , Joel Fernandes , Timur Tabi , rust-for-linux@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Eliot Courtney X-Mailer: b4 0.15.2 X-ClientProxiedBy: TYCP286CA0260.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:455::18) To BL0PR12MB2353.namprd12.prod.outlook.com (2603:10b6:207:4c::31) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL0PR12MB2353:EE_|DM3PR12MB9389:EE_ X-MS-Office365-Filtering-Correlation-Id: b8e32e25-e082-4f04-b3cf-08de9c96ba66 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|376014|366016|1800799024|22082099003|18002099003|56012099003; X-Microsoft-Antispam-Message-Info: VafsnPSUoAehz5bPul0XHAKWK1JpIFF3nKm5/QglppTzyEcqNHGrdsGXCi/twfOYNGJPNgPM4pNBCvpkNC/npLZ2lstjukEGPyYS/xoRZYyxDEP0DcE2XKdBQAxzLRSaIfpwjAEIaGlIhGIJPXo/Z24tP4JZVc/FlmvAs88J9z7kgqfyUtovSRju56JIpdUmZm2rK/8nhoo1SVo2kjIlNV9bBxeU5w3kYkvhbn4gNQPPpJVFnMMKiVf/RBcp0Cp15aoN9VdAvL8s9QSOYvet/NxTYc3uhI86jSjol199C9vIDlMd5C+SRYzgbHpYW35r790u2MRTJftLpI9pCNeOorcAy9WvEBYXMhziWEtbl+zQY9OqbKkW8rh3WD+Zh22RoBIt2OmoRVehC+8ulthOFETqUrp1uGNPCMZa73LRzij0djoHIRmcIVzND8Wfuvkjtehmg+wnSHKhAEsGJ7ybwvtadCGZzu6fFeEETPpcqsImPPXGL/515xmHJwPh2B+6tag8DeeMFID6QUghBJf+TtpuqRBH1yGNncNPBAU6L+aWWyQ6QabD2prLAT6V+xJQJKT8/uhe2sMsFaauOAwjvlYq0XgyRrH9qXXOyqdkDHcGHe7+UIcw5TUPs5Y3ITjTcZVoT3NBzTDzUjFvJ2pj5Co1tcsnH0e7+QHptgGGpFWngYIafrRgw0CYoElTJxg5Jo+VP/s3alSm3PyDaX3FEyQVSxnadb1yJBaSOQd5Lo4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR12MB2353.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(376014)(366016)(1800799024)(22082099003)(18002099003)(56012099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TGhrUGd1WnA4NndPb0lkaVU0b3lGUkpKTEhqZnRad2RKeHRwVytPYWw3eFg5?= =?utf-8?B?dGsvV2hiZVFjNU1TSEtKQVBXblQ0eEtGY1lTaW9SaGlBb0E0QlZJRHRrZ1c3?= =?utf-8?B?VFNEMU5YbWhLSDIwWVZES2hwdStXbys0a2xHV1J0NXY2ckdRRGJodis2MmZX?= =?utf-8?B?QjhYWTlKMDNYcjNRbUJkd3NWZVY5KzNzRGtHVVdBRjhkVzc0cDRXMlRnQXBN?= =?utf-8?B?cktVQ3kzZmhkM3JvZkozOFBMNnNiMGJGTDJiYjBoWU1zcTlXWU1EdHBrL2dl?= =?utf-8?B?NVVZeE9yeEt1QkxDbXVGNFhxWVcvSVJ1NHpNTjNYL3VRWHlDT1owMkxseVNT?= =?utf-8?B?WlptZFc1MWM0Z3NKVmFuWi9aWk96SFM1Y1RUaTdqLzluenZJSGVycG40UytD?= =?utf-8?B?NkRTYXNOaS9RZktTcGZNYjJWYkxwSk83MUc4RzJOaGVPZlZzd25QVHlCT2Nr?= =?utf-8?B?VEVYdUVJdDNCdTJiZktxaFFsSVRnU3ZORUNTN05iREhuZVJoT0MzbldmZnYv?= =?utf-8?B?ZEt2M3FtT283QjJJVlZ1WUd6WnRNbm5KdWJrME5McS85RFZ2NERpU3RBdzlr?= =?utf-8?B?M1dkanJtbzIyeTNjdFZKaUpxYmlPMFJUS1JTV2F0ckdhLzRPb2ZYUXVkVTRo?= =?utf-8?B?ZUJaVE05R2FtWHg5Tk1mM2QzcEhsbDl5SmsvUXlBYkVpZHNHb2ZUU2xpVlEx?= =?utf-8?B?Qkp4MmhpREtYS3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?OWwwQ05ZOTV4Y2cxQzdsMS9qTzZoZm5URUxNTUhPS01IS2RnMDBZN2YwUWxy?= =?utf-8?B?cUViVG43c2p0L1UzZU4vTnE5ZWZPTDYyRkxCMit1UDhsei80bGJ3TkhKRzZT?= =?utf-8?B?OFdzanNmVFVUMGFYMytVSXdDVHRQZkp6MXJPa1Y0OCtDb0hER3ZvQVFqaDJs?= =?utf-8?B?NG9rOVJnbTBnMCthY2tHcVdidGFabzZBRFk2SzRpUGk1ampoSzdpejZaQ2FV?= =?utf-8?B?TUZCUEpYdmFPQVozZGljRVl2SkU2ci8wT1lVbmdHaGNzOUJhYTFmNHF2ZVBN?= =?utf-8?B?bnA2UHlsN0dubE5uc0NOQkpHZ3g1dVVTa3hURTg0aXZyUkJHUzZudXI5M0oz?= =?utf-8?B?RUx2RGgzNzQ5SEFsSUFWYmVkR1JqRHVHbWxEekRRTU9NYU93N3hzTkhrNzFk?= =?utf-8?B?WjNGRXRjOXFDR2FHNVdJSlR5RC9BNnFmUlRJcS8wUlRCRmJKaE9BMW11UUpD?= =?utf-8?B?NEwvV1A3TGd0anVnRWlmVUJxb3R2NytmUVJYMVo3a0twcUZzaUt4dWN1UUpS?= =?utf-8?B?QTZwNDJJeWxtN0xhN2pLTS9tdndrUW1FSGRtRTNnNGdhQlEvWDRIZjJ1d0xp?= =?utf-8?B?eWJtTDZVNmRNT2prcWdVOFlPRzFhaUVQMjZvVzNMeFJxVXFBRTI5UGhLeHBZ?= =?utf-8?B?bSsrV1hnL2lpbjRFRG9tUGRWKzVwSi9UOGVVNFhRVytzd3NYK2lzeW5CTDBP?= =?utf-8?Q?Nx7N3jnBpBY/rRllIeZgcG+yY2n4RrZls2j7sZ8AmMAO8?= X-MS-Exchange-AntiSpam-MessageData-1: 0XJcM7bBLR+7qQ== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: b8e32e25-e082-4f04-b3cf-08de9c96ba66 X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB2353.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Apr 2026 15:33:52.0423 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1iiKs2+7FRwjB8Qcpyk1hu0O0Mp2buvXCicKn040zkqcNqsQo0oNZTGU+hMZaTBC+mDBO0pFqByjKSGVYIn29Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB9389 Add the bindgen rpc_gsp_rm_control_v03_00 structure. This is the structure for sending RM control commands. Reviewed-by: Joel Fernandes Signed-off-by: Eliot Courtney --- drivers/gpu/nova-core/gsp/fw/r570_144/bindings.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/nova-core/gsp/fw/r570_144/bindings.rs b/drivers/gp= u/nova-core/gsp/fw/r570_144/bindings.rs index dd37a7fd58c6..05e205e6dc58 100644 --- a/drivers/gpu/nova-core/gsp/fw/r570_144/bindings.rs +++ b/drivers/gpu/nova-core/gsp/fw/r570_144/bindings.rs @@ -1025,6 +1025,17 @@ fn default() -> Self { } #[repr(C)] #[derive(Debug, Default, MaybeZeroable)] +pub struct rpc_gsp_rm_control_v03_00 { + pub hClient: u32_, + pub hObject: u32_, + pub cmd: u32_, + pub status: u32_, + pub paramsSize: u32_, + pub flags: u32_, + pub params: __IncompleteArrayField, +} +#[repr(C)] +#[derive(Debug, Default, MaybeZeroable)] pub struct rpc_run_cpu_sequencer_v17_00 { pub bufferSizeDWord: u32_, pub cmdIndex: u32_, --=20 2.53.0 From nobody Thu Jun 11 01:40:33 2026 Received: from SN4PR2101CU001.outbound.protection.outlook.com (mail-southcentralusazon11012006.outbound.protection.outlook.com [40.93.195.6]) (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 3FC22349B19; Fri, 17 Apr 2026 15:33:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.195.6 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776440042; cv=fail; b=DnDAKX7khFK6YkeDHCKFXBxwyUPA0QjW3BbF2WtRNIvtKfVXYorieJuXoZeMsqGjtZ0EQReF1h1i2hDwkwkuGCPjElMSTj7Gz3Z0N7bZKEAq4pzkUa226RfsqDUMZdRu8TyGmy526x0RQHCHhutmjbXN6FK/mwNU19o9qBzWHsQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776440042; c=relaxed/simple; bh=t5C0cMosoyh07iE1OtDJkiFh+ODuao0gXl9CbCpN6Pw=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=B85a4mjM9yKJesWrFHe8E37+EWQWRpR5clYWEkAcwPZ0WBQYX4I1IOb0I70SIZmLXS920eJJwvbpxLuPiRd7D0gMAztyrL4d2hFn+0A16jAoQDWbHcAepKuDD040Xw801xpcnDRLCZ224yyIeeR2m3pUS4/733l45bggRATyd10= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=bWssCTHA; arc=fail smtp.client-ip=40.93.195.6 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="bWssCTHA" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pLDDQ5S886n6ztso8KfkCGxucXN+YpsYcsi4wtQO5sVyOTB7VVwDr/6JS/LBbgih1buTg3EGmbE+xc6zOSmGeGubR5Ksiuw1WFiiIw+9qREt4+AZhFZzrQB/0grF4EFa4haw0KMBeXh5JfVvD6V9W85k3De3pl2E2N1g3CgVn1Hl/5Sd4GtwHQc3c42XVoX6FS/KPriwFGpYWBAQR/badRBvjOz/HixJ54OV/BH4Y3U17UBdh8tnOXzEgbkfLq723tC5SDOBd5tKgB3449k0//j3729GunSE4/w1zwxFscglc6RZb6W0Lz551eTHwtPpO6UbJdoYnFUe97uVYL0XKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LkOra6zC8Uvl4Y/q7ktlCTsZwxeEUukVraS3BUrAG/k=; b=a6AuhJz3IYztBZS3RjjaWCHzj5WxCekao7/K2CDuC65KtzkJNPVoFdaW9Hkd6wCShhXSu0lXeZDCjGGEUPHA4ZFH7h9bGzPMDLsMZQ1bOxLQkAvIqlk6ukHbC1GgbSdZRqOSffaki9caPrw1dQN70St04HEeQJd/ktZLM4Ws1rE2vtVpxRdN/2Hl3/33g3rDuOS7Ly8gFCP0hPvtMvADibmh/EeCfMe9k9d1JVyCY1FXSZoDOIgI7bhjfYH24cIWG7mg0uAdLuvQEvkYeR/odqrgXHUEO4Zh6YKdlCU5QG/GvPKMXZCfUnRWVBHLc+8KonxgTVGDHg8wAjbXPYJycA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LkOra6zC8Uvl4Y/q7ktlCTsZwxeEUukVraS3BUrAG/k=; b=bWssCTHA+P28ij0w8eQJUiZdVa6tNda0RKZxxmyzTKILJ/G+HDI7yY5NO+TuamBqa0fMjVm957Ns2Gk2D5YD/8tlS/HOXruTsuZ5mxW+J8PDNuLMwGLLObP0wnbiRe6e1lltRemaRli72jUx5h1+sjCoUV0jb76i38n6EYbzff7xfmcbzaZNa07SWvtESEbmALy0zRzlWRLkcyjAndNb0p9x6P19rKuLj1jTuzLYFlZm3ZrHgjhQfra1WChsl6U3RTh6p/Yev8Oqj8g2Uz2rJh9AvDnHTL9lfVtLb9BwYLIsi2bNFStzEUc0Zv6UrICveBWN6G/no+KzhEA5tVMJHw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BL0PR12MB2353.namprd12.prod.outlook.com (2603:10b6:207:4c::31) by DM3PR12MB9389.namprd12.prod.outlook.com (2603:10b6:0:46::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9818.25; Fri, 17 Apr 2026 15:33:55 +0000 Received: from BL0PR12MB2353.namprd12.prod.outlook.com ([fe80::99b:dcff:8d6d:78e0]) by BL0PR12MB2353.namprd12.prod.outlook.com ([fe80::99b:dcff:8d6d:78e0%4]) with mapi id 15.20.9818.023; Fri, 17 Apr 2026 15:33:55 +0000 From: Eliot Courtney Date: Sat, 18 Apr 2026 00:29:24 +0900 Subject: [PATCH v4 6/8] gpu: nova-core: gsp: add types for RM control RPCs Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260418-rmcontrol-v4-6-fda8c76dbb95@nvidia.com> References: <20260418-rmcontrol-v4-0-fda8c76dbb95@nvidia.com> In-Reply-To: <20260418-rmcontrol-v4-0-fda8c76dbb95@nvidia.com> To: Danilo Krummrich , Alice Ryhl , Alexandre Courbot , David Airlie , Simona Vetter Cc: John Hubbard , Alistair Popple , Joel Fernandes , Timur Tabi , rust-for-linux@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Eliot Courtney X-Mailer: b4 0.15.2 X-ClientProxiedBy: DS7PR03CA0267.namprd03.prod.outlook.com (2603:10b6:5:3b3::32) To BL0PR12MB2353.namprd12.prod.outlook.com (2603:10b6:207:4c::31) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL0PR12MB2353:EE_|DM3PR12MB9389:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d72bdb0-66f3-44b3-be75-08de9c96bc2d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|376014|366016|1800799024|22082099003|18002099003|56012099003; X-Microsoft-Antispam-Message-Info: R6Z7HGtJl4Z2Y0ywC8PbVpaCjg5zZg0fDMh9wrpnMDN+FZQm6lxbYbpbAVGooZPxOkGKYZrhfJEnV5xOdkFfjFa6qRAwHQ5e7GSt6ZKg6LADajPN/lR+WAinLZWx0okYZ/BjPvKuWVov8yeUyJSOfZMOWEPhh7WM+dY/NzNIm54N5UexOwrjJszlIBMwiw3vJKCxJWTmrC18nR0h/N6Q6OjGgFZDVJywMYSqPyOjcqlEeznG+g4kis21AGjjBcTgYe65IFZYfZTWXZ05dJKwnbgP6+iyfEq76oo0MNGOuZhJRvp/NqOgbXPiE4Ns608zmJjDuzvhtkEgeOyxANjIH7mL37GmLK3136a/qBNAurbqYUdOi6glkc4fDRH6bZ9ZVCmcp/nqrRqA0JM1/GQ2J0UAeZf8qW7bLLqYmhJNAZyF0kJci6yWdf/0Xhsx3syJZAcA7EPhS2FHTkMqYTsngR34hr3PP/HwjAdIYPqoLmGSMpF1yhrBwT/0XhwsHhnP/SrUgXhAtuurT81Ua6VRd//UFMCLLiXJrHSm9omg6l3i8yBnO5FviGPjvlG32C0IfZe33BfxmlNVbUo1QtWPvaEkkocP72E0eSscrpOpsoxqwKG2TQMqA42MabPg4qk15ipBym1zYNnDjKSMZCDzCsKesxUiPgxwu95XJ8dT5oSGbCIdoxqOw+2TF+axWrsNafsxcNAEk/ZPem+bDkTx1REWoUIwesGePsyyt/TLaS4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR12MB2353.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(376014)(366016)(1800799024)(22082099003)(18002099003)(56012099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aXRJV2Z3ckJvSFlEWnhrRmNXVVBwVUUzaG94QjcvOXVlZWtBSzlkZzNubHFU?= =?utf-8?B?bFRXZlNRSDZZcTBSUDQyUDJ3d2tYYnNGUFZYRkhVT1UyemZlT3pXNWNPR2Ez?= =?utf-8?B?RnFlUVE4WXo4eTNBc0Jtcy8zRko3ZzdKRFVmSTVzY0htMndZcTlPWWptV2to?= =?utf-8?B?OEE0bmVldllGNUYvY0VmdjAwSlN0dHFRdHNHaTY0cnlBc0JIZC9pRUdkRXFT?= =?utf-8?B?RUhkdGI5SVg1em5yZEM5b0tpa0dpeUFoK1BIVHdZRlVZcURCR2FzSlN2TGZY?= =?utf-8?B?TjlnNDF1SHdFUCtkOHdLa2p0aXZvUnpoWU92MVB2ZWxCRzNRcHdOU2RDNSsy?= =?utf-8?B?S1FiN0ZqUWtsVnZWU29DVGdMWGtiYmtUWHRKMDgwbThKSGNmKzMwTVRhQmx6?= =?utf-8?B?K3BiVUY5eWNZMUcyamZIQWdWajJKWUVQQStLdjNHTkJyNDgvMmtLZTdqSmJ2?= =?utf-8?B?YWVreFFkTXdoK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1VStPNE1GYzN1?= =?utf-8?B?QjkydEh3NlduQjdFNG9pbDcwOVNkbGwzK0dpWXBTczhzazZSTERqdG85N0t2?= =?utf-8?Q?+ImOOvSVOdhy10MXMIaVMo5f4CM2IBgiZnLcjL1fjJw23?= X-MS-Exchange-AntiSpam-MessageData-1: f7Hf6I10mlH0rg== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d72bdb0-66f3-44b3-be75-08de9c96bc2d X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB2353.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Apr 2026 15:33:55.0466 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: JwVuPn9pGpwvPXGWLeygtBf9GcRtXBD1knGME1E5qvEe6wCYfLt7sDkPSpXkZxOjITh1+ZYExC0Kk0Ej8VapLA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB9389 Add `RmControlMsgFunction` which mirrors `MsgFunction` in fw.rs. This denotes the type of RM control RPC. For now it contains a single discriminant only (which will be used later), which is needed to prevent compile errors when using an otherwise empty enum. Add `GspRmControl` which wraps the RM control RPC structure from the bindings. Signed-off-by: Eliot Courtney --- drivers/gpu/nova-core/gsp/commands.rs | 1 - drivers/gpu/nova-core/gsp/fw.rs | 1 + drivers/gpu/nova-core/gsp/fw/r570_144/bindings.rs | 1 + drivers/gpu/nova-core/gsp/fw/rm.rs | 91 +++++++++++++++++++= ++++ 4 files changed, 93 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nova-core/gsp/commands.rs b/drivers/gpu/nova-core/= gsp/commands.rs index 8a19ef689731..bf0e8533a71c 100644 --- a/drivers/gpu/nova-core/gsp/commands.rs +++ b/drivers/gpu/nova-core/gsp/commands.rs @@ -78,7 +78,6 @@ pub(crate) fn new(raw: u32) -> Self { } =20 /// Returns the raw handle value. - #[expect(dead_code)] pub(crate) fn as_raw(self) -> u32 { self.0 } diff --git a/drivers/gpu/nova-core/gsp/fw.rs b/drivers/gpu/nova-core/gsp/fw= .rs index 5fabb815a919..1f5c61bea645 100644 --- a/drivers/gpu/nova-core/gsp/fw.rs +++ b/drivers/gpu/nova-core/gsp/fw.rs @@ -2,6 +2,7 @@ =20 pub(crate) mod commands; mod r570_144; +pub(crate) mod rm; =20 // Alias to avoid repeating the version number with every use. use r570_144 as bindings; diff --git a/drivers/gpu/nova-core/gsp/fw/r570_144/bindings.rs b/drivers/gp= u/nova-core/gsp/fw/r570_144/bindings.rs index 05e205e6dc58..ece31cc32f5b 100644 --- a/drivers/gpu/nova-core/gsp/fw/r570_144/bindings.rs +++ b/drivers/gpu/nova-core/gsp/fw/r570_144/bindings.rs @@ -44,6 +44,7 @@ fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::= core::fmt::Result { pub const GSP_FW_WPR_META_MAGIC: i64 =3D -2577556379034558285; pub const REGISTRY_TABLE_ENTRY_TYPE_DWORD: u32 =3D 1; pub const GSP_MSG_QUEUE_ELEMENT_SIZE_MAX: u32 =3D 65536; +pub const NV2080_CTRL_CMD_CE_GET_FAULT_METHOD_BUFFER_SIZE: u32 =3D 5452702= 80; pub type __u8 =3D ffi::c_uchar; pub type __u16 =3D ffi::c_ushort; pub type __u32 =3D ffi::c_uint; diff --git a/drivers/gpu/nova-core/gsp/fw/rm.rs b/drivers/gpu/nova-core/gsp= /fw/rm.rs new file mode 100644 index 000000000000..e51fdcec1f27 --- /dev/null +++ b/drivers/gpu/nova-core/gsp/fw/rm.rs @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: GPL-2.0 + +use kernel::{ + prelude::*, + transmute::{ + AsBytes, + FromBytes, // + }, // +}; + +use crate::gsp::commands::{ + Client, + Handle, // +}; + +use super::{ + bindings, + GspMsgRmStatus, // +}; + +/// Command code for RM control RPCs sent using [`MsgFunction::GspRmContro= l`]. +#[derive(Copy, Clone, Debug, PartialEq)] +#[repr(u32)] +pub(crate) enum RmControlMsgFunction { + /// Get the CE fault method buffer size. + CeGetFaultMethodBufferSize =3D bindings::NV2080_CTRL_CMD_CE_GET_FAULT_= METHOD_BUFFER_SIZE, +} + +// TODO[FPRI]: This is a temporary solution to be replaced with the corres= ponding derive macros +// once they land. +impl TryFrom for RmControlMsgFunction { + type Error =3D kernel::error::Error; + + fn try_from(value: u32) -> Result { + match value { + bindings::NV2080_CTRL_CMD_CE_GET_FAULT_METHOD_BUFFER_SIZE =3D>= { + Ok(Self::CeGetFaultMethodBufferSize) + } + _ =3D> Err(EINVAL), + } + } +} + +impl From for u32 { + fn from(value: RmControlMsgFunction) -> Self { + // CAST: `RmControlMsgFunction` is `repr(u32)` and can thus be cas= t losslessly. + value as u32 + } +} + +/// RM control message element structure. +#[repr(transparent)] +pub(crate) struct GspRmControl { + inner: bindings::rpc_gsp_rm_control_v03_00, +} + +#[expect(dead_code)] +impl GspRmControl { + /// Creates a new RM control command. + pub(crate) fn new( + client: Handle, + object: Handle, + cmd: RmControlMsgFunction, + params_size: u32, + ) -> Self { + Self { + inner: bindings::rpc_gsp_rm_control_v03_00 { + hClient: client.as_raw(), + hObject: object.as_raw(), + cmd: u32::from(cmd), + status: 0, + paramsSize: params_size, + flags: 0, + params: Default::default(), + }, + } + } + + /// Returns the status from the RM control response. + /// + /// This is distinct from the RPC transport status in the RPC message = header. + pub(crate) fn status(&self) -> Result { + self.inner.status.try_into() + } +} + +// SAFETY: This struct only contains integer types for which all bit patte= rns are valid. +unsafe impl FromBytes for GspRmControl {} + +// SAFETY: This struct contains no padding. +unsafe impl AsBytes for GspRmControl {} --=20 2.53.0 From nobody Thu Jun 11 01:40:33 2026 Received: from SN4PR2101CU001.outbound.protection.outlook.com (mail-southcentralusazon11012006.outbound.protection.outlook.com [40.93.195.6]) (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 128B2359A70; Fri, 17 Apr 2026 15:34:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.195.6 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776440045; cv=fail; b=IaUSOP3JH34QqcRN42A+p0jprEDD/Nt8ZjDwhaaHgdcn3ajDO9rcTe3u0wU8Hs7Q0JKbjXn0Ek39t5Xb0magFC66ScIxTS7euvuCkbZxmj8a03w8+uvr+0hvOYWhblELJtLQNfuWzbKHrFB9ZdYqAaTbicLyfa62MOS1QvYakgM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776440045; c=relaxed/simple; bh=zaWbR1eYVVvK5qnEh2QP8hzK0Mj84hY7Omnz/snnKHw=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=T8AZ8ApbvajlxQtVAhcUrovV3MVY/hHfbHqAP91YFGIYvIukQI9LgnYxkvIJfbX7PwoimbkWCLQXzeMfPrwMlTBxSVW8unGTL3dwWZwMq2S6pZd115fewMsDNI/IE7yOx8GjXKpK84f8/YRz7gwNwM3p0033h914ze1uOCVYDb4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=Vh45ZKsx; arc=fail smtp.client-ip=40.93.195.6 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="Vh45ZKsx" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RUnvXSzgD8OyPZE8S2ljGKJunFod3gvRDZeNjRut+T4Y1O5wMIafQV/xgSoQhVuLIYQzOnDY9OfigVS+gtK4NCzmSLIgSE6Dvkw/aLVbHx8v+r8Ytir8bjwqoYNZtzhjm4EryjcPJElSlttZ79OoK44jdCfdJ85iy9nZ77UKYjkuBQ4Z14qBs/43L3m/b2xkbGQomk1uzfC9mB4rfDnYJlt7+GzSRhUVC3DlTDUM0Lyp+e7Zj8zHspnBq5EeoXr1d3if+5yr0C0gAZi1hcnXXbrJYOxjo7XWrLV+I2Hvm4cx7PNXPF7QrUFnOa8sI4OQcWYTIggATKFwEmHkEmZBaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kL8APXnDlLX95vpD9YtCmQFLBfTezkb/NWK05oABTko=; b=ujwF2CZPyrRKAZu5VPYNSJkA4ygiV7N5d0huksIQvUfxX/UIsltd/W6lHNH30KhTYTSDnkc3YKLw3kHRGSH+aV1e6m3rFsO29Jz+tbnPrF2BMcRIjYuWtXWoZ3/p85U0UmgibwhgleFE+3OnECHeD6U+4HKX6BALxvpt2X/kVQLD2k8ZkbJquZffO/76HCNDPbcQvrFGPuvXEYJxfmGfDcFB6Q05w0dsfialcfFXrmVJUF6KbbqBmlHJRBRWlrCDFidaetCNttRYj52nL8qdu02o0C9G4uxXrIxiZuoAItAUDUoJN98MVbA53+6bJvFtUDjJHJSDGFycZ2Y81kFtFg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kL8APXnDlLX95vpD9YtCmQFLBfTezkb/NWK05oABTko=; b=Vh45ZKsxiLpL/XseFkZi1EH6WEoLjEqUi2UaS7EmEDUOzwFrYc4zZhPOhX2GVgpYcgZrsTR2WcBYi2dYMRA/SRRLlKg+sUc0whUmtJF/rit72AhMg5zvDUoEo+1RSAwsqJrjt+yNGdBCwJd4A4NFpE22HBQprlZKNUZXV0h4BU0hqFeV/4i0El9md4+IfxQvIp67ihBbj4TT4bVv8JrWO3WUjSRVuUb4SRx1Rkzm7DI9dDstfGShkKBrcu6AHAQ14tIHwvI0Kkuvz3NGo9x9xpMaJCK/MdB/xDsd4kjSknazuV37K3qDOnHF9oQu7Kj2SSeBiEu/09mPA/JtDhvwkw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BL0PR12MB2353.namprd12.prod.outlook.com (2603:10b6:207:4c::31) by DM3PR12MB9389.namprd12.prod.outlook.com (2603:10b6:0:46::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9818.25; Fri, 17 Apr 2026 15:33:58 +0000 Received: from BL0PR12MB2353.namprd12.prod.outlook.com ([fe80::99b:dcff:8d6d:78e0]) by BL0PR12MB2353.namprd12.prod.outlook.com ([fe80::99b:dcff:8d6d:78e0%4]) with mapi id 15.20.9818.023; Fri, 17 Apr 2026 15:33:58 +0000 From: Eliot Courtney Date: Sat, 18 Apr 2026 00:29:25 +0900 Subject: [PATCH v4 7/8] gpu: nova-core: use KVVec for SBufferIter flush Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260418-rmcontrol-v4-7-fda8c76dbb95@nvidia.com> References: <20260418-rmcontrol-v4-0-fda8c76dbb95@nvidia.com> In-Reply-To: <20260418-rmcontrol-v4-0-fda8c76dbb95@nvidia.com> To: Danilo Krummrich , Alice Ryhl , Alexandre Courbot , David Airlie , Simona Vetter Cc: John Hubbard , Alistair Popple , Joel Fernandes , Timur Tabi , rust-for-linux@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Eliot Courtney X-Mailer: b4 0.15.2 X-ClientProxiedBy: DS7PR03CA0243.namprd03.prod.outlook.com (2603:10b6:5:3b3::8) To BL0PR12MB2353.namprd12.prod.outlook.com (2603:10b6:207:4c::31) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL0PR12MB2353:EE_|DM3PR12MB9389:EE_ X-MS-Office365-Filtering-Correlation-Id: f63fd262-eafd-48f1-a1c0-08de9c96be06 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|376014|366016|1800799024|22082099003|18002099003|56012099003; X-Microsoft-Antispam-Message-Info: LNfCyqJ0wRCTbnz9StWbT6I3bQmHRCQRkY9hY/SHbqoAMx/48KhI9F99WsWHL8XiRoKxEXj9B5p5qww7l0N7JTFn51inl/xnQC+PnHmXyFV9ODVdMXyQYabKzmy11doFFX/NlhkeIC2vfdOnR1/qAjatSZ9O7cBS0nNO9F7h3lJX3c3crb4IyfMInD6DgLNI3ZS6XkyVYBNX2gfA9DUqyGqpIjSj6YTVA9mWt3cXL7Ogpob3i/lz2Fbr4e387O89Yl8x9yANDM5iJm5gS0YuUkjY7rZin1NQKulOPZJRblffm/hGc+b4czxZqMiW6K8R9Wf8cD4QNw39fWCMVxyBO3IAijHVUIPDhIrbY4YT/DrjH4T5yln+/1FkXC78uZxffcdQXz9l0axoDUCwifNNH5LT2J+B6I0/W9wGXpXyQoBJVy1G2Uv0/0CZ1kQcVa+jD969agIwSsZRmzpBHRgBQRboBRv4Y0iOWvsPyUrYTP0fm4Jm7a6+7fan/uTcht7KWzgYKBpbhG9pgLEudqncnAfQL8MUJwuNlzrN5W5lPTCsn8gId/9kivmpaefRXL4t+HjYd07mxoQ9YJBL9Vx31VS3AVmeM+gCK7IHUouXXbLXCmhGnCCjWp1jZXcBrkwRe4wWJ2JlP8w0QoUEDra90aWIQTjUA0wMWPONGGE8SGDSYXMqdjNDjRyP/nQHDnrgfmhh4eVaRpd9uSrMTPcdE2zTCvZguz4+KxcYEDd8YX4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR12MB2353.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(376014)(366016)(1800799024)(22082099003)(18002099003)(56012099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?R2M3WUhXQlA3ZDJnTGtyMEFTWmgrS1psMGphUmswM0FscWgvbHNkcVpCU0Zk?= =?utf-8?B?Q1RDR2M3M0JkRjZiWVhXOVNyQmNtOEsxU2xNRTJDZ2Y0WGhMRGk2VEd4bytM?= =?utf-8?B?L094YUJUbkpnYldBUktwUGl5YmxDMmxOS055RDFyYzhnTzZMdUhlWG9KMkMy?= =?utf-8?B?TXkybEhYM0o4RXhiZUJDRlY3ZFQ0VG1ZekNqNU5XMUZRcUgzQldUd2d1dkJM?= =?utf-8?B?Uml5SmN3ZTJmek9Wdk5WQTFBK3BobmlTN3Nvbnc4RXIvWmRxNE16MkJQSW1G?= =?utf-8?B?SlE3Q1ExV0pPSytGaDMyRzhDRHNHT3VBSEJLZENFQzhlaFlNd1RlV3c3dXZY?= =?utf-8?B?R0c5azIyWExhV2Fqd1pwVHRxNHhtNDh5NWwyZlY0d1hiaUl0b3crK1I1dy9O?= =?utf-8?B?MXl5N0pKTEtGYzErTkU0MWpzMnVxUjdrNlZLM25m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xqVVNTREJsbWQyZWs5WWxJVmVSNXlJaWpPdENrbEpGMUdXZVRw?= =?utf-8?B?TVZnUHZBOURybEpNN1c4ZmlrVE9iM3F6bUVtMi9MMFJPamxPYi8wZlZ0MStB?= =?utf-8?Q?PzW+moyzs4VvDjA8VqGAcAJXx5lLFal+PrfAUrKdc279E?= X-MS-Exchange-AntiSpam-MessageData-1: naHR1pWucYVcdA== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: f63fd262-eafd-48f1-a1c0-08de9c96be06 X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB2353.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Apr 2026 15:33:58.1361 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vGh/14xkWErIv4k10+VWI6aod1aB9paNJ1PhRwi39NZoHWen2vMYfWeemi24qJqUYtilqReAdo58JtAHILaYxA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB9389 Change flush_into_kvec to return KVVec instead of KVec. KVVec uses vmalloc for large allocations, which is appropriate since RPC reply payloads can be large (>=3D20 KiB). Update GspSequence to use KVVec accordingly. Reviewed-by: Joel Fernandes Signed-off-by: Eliot Courtney --- drivers/gpu/nova-core/gsp/sequencer.rs | 4 ++-- drivers/gpu/nova-core/sbuffer.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/nova-core/gsp/sequencer.rs b/drivers/gpu/nova-core= /gsp/sequencer.rs index 672c7d6c3cf6..62aab20ce8c6 100644 --- a/drivers/gpu/nova-core/gsp/sequencer.rs +++ b/drivers/gpu/nova-core/gsp/sequencer.rs @@ -43,7 +43,7 @@ struct GspSequence { /// Current command index for error reporting. cmd_index: u32, /// Command data buffer containing the sequence of commands. - cmd_data: KVec, + cmd_data: KVVec, } =20 impl MessageFromGsp for GspSequence { @@ -55,7 +55,7 @@ fn read( msg: &Self::Message, sbuffer: &mut SBufferIter>, ) -> Result { - let cmd_data =3D sbuffer.flush_into_kvec(GFP_KERNEL)?; + let cmd_data =3D sbuffer.read_to_vec(GFP_KERNEL)?; Ok(GspSequence { cmd_index: msg.cmd_index(), cmd_data, diff --git a/drivers/gpu/nova-core/sbuffer.rs b/drivers/gpu/nova-core/sbuff= er.rs index 3a41d224c77a..ae2facdcbdd4 100644 --- a/drivers/gpu/nova-core/sbuffer.rs +++ b/drivers/gpu/nova-core/sbuffer.rs @@ -162,11 +162,11 @@ pub(crate) fn read_exact(&mut self, mut dst: &mut [u8= ]) -> Result { Ok(()) } =20 - /// Read all the remaining data into a [`KVec`]. + /// Read all the remaining data into a [`KVVec`]. /// /// `self` will be empty after this operation. - pub(crate) fn flush_into_kvec(&mut self, flags: kernel::alloc::Flags) = -> Result> { - let mut buf =3D KVec::::new(); + pub(crate) fn read_to_vec(&mut self, flags: kernel::alloc::Flags) -> R= esult> { + let mut buf =3D KVVec::::new(); =20 if let Some(slice) =3D core::mem::take(&mut self.cur_slice) { buf.extend_from_slice(slice, flags)?; --=20 2.53.0 From nobody Thu Jun 11 01:40:33 2026 Received: from SN4PR2101CU001.outbound.protection.outlook.com (mail-southcentralusazon11012006.outbound.protection.outlook.com [40.93.195.6]) (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 E476D3314C2; Fri, 17 Apr 2026 15:34:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.195.6 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776440048; cv=fail; b=a3RxJG6R+sYXyxzZA1Y8402UGU9BiuAlm8BjBceicAjkEz/RW4sasV8BBQk9GxDHqJoq+Trcsw48XrbEMaWyzqD6wQofSs5mBoQyIYLfaPB8d7yvOK+QYxFYgzQenzb6vBo+CuDv8vmWof8kUCbtA6s21S21dF0TGfI46w680Ik= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776440048; c=relaxed/simple; bh=c5azP3DcMbbJSvSLkUHNH91xWYchXnlSpwNiJXBYwvs=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=Vhd1UaNu1XXovYKCQh4lOM46y9Nk/qqtiYfC8p6n4givB0Xg72EogWuUrtpBGpEVi0EXD8WJt6M3e32O2DtdzItRAMn9qCA2Aag1SpY51BBdpqURFXiV0y1cWHLZNybS2hSwgWiLIFs+NEvkAdOWM8TO7y0lizvXOPXrKh2lre4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=DsRwyo2x; arc=fail smtp.client-ip=40.93.195.6 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="DsRwyo2x" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ljb72/DmfcltfAzTDHP5uh8enLt53F/P9k5luVIrgd2noK5g10wwTjpkOuVv0/U0paAHCDF64Bi+6va2l2UWR5Q7v7HjZ/cTgdVvC8ZgJoA3+ehZHO9tRQ2TZQgkfwhWPX5FiyTDzOeKdK06VucK3Rq86kGo7N5bQu2QgyDAWA6URiIno5N2FlF3b3a0zrZw/RUtcGvU6LUtPrQd4DOmHfBCgNCb1bUXUr4rZAZyEjpOeLniQjhPTu5jOo0wsLX7DYmJgnuXsWpkQjI8/TikiHtYiUiSqChoaPRDSdW0Ve8wopZG8dyHZ0Qz+9YwLlB45VjD1+/I5I/eDbUc2y3VzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=98AABtFxaTQwBmaeWSNV2GTK0DFahs3+qDZs4Up5nj4=; b=j+87a+M4UZY59A76Oo5UrukoCOP0tSF55ZTyFnt+O7aoavCNO5XHt8qXBtmpw9UBs07GcWYK+2l2RyhUa+2lXzXJ7fNXinBH5I7XMBHZfxIibb57S/drOSBd4HeZgzZkgsqXrsDFb0g9FvLKbQdCRGlZrW0AxpUJa23kH9b+h2fbQwlu4MMCtjvX002zL5fJKI7W0Tlk1WvfshCFJE4NMgUMj5xepclhwrAXwthJxrBtTirRU30oRUfKNpt91/VAv9naMNJLvRpgfaTEOcTD+bGU4vyqRAOkP39B1X7GOMVc18mpHQXQZErSfkn3I8jCDgw/y1uDHBNt2WTC5vkzdQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=98AABtFxaTQwBmaeWSNV2GTK0DFahs3+qDZs4Up5nj4=; b=DsRwyo2xXXAzKHisRi8LTXO/dWzG5DuTqNsqFddKEfjY+ohTnUPNeF62//1PKQm7BHfHHV5nqz1QB0sLd7GZmdt3UefSvbEkrHEO4T9B2HIJMLcM0OKpNcFzlzbWFqTVVLY4KJFLerPIbzbUL6XhM86OsQdtYiWPecw3DhbbYn/loRaC1S7hltbCe3bjhrqTLDwfE+dQm6n9OTtvtoSH6v3b9/FBEoHaAeXDpCgig7IGMSRsWCjlvJhZqKKsf/OHpKWNG6F2/ONuNqYS3x4//G24gooxaySTeBO6WgVnTGR9waqAsbhayQoigfsExfFZ8iV+QN5aCD9GsOtT4DoRTg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BL0PR12MB2353.namprd12.prod.outlook.com (2603:10b6:207:4c::31) by DM3PR12MB9389.namprd12.prod.outlook.com (2603:10b6:0:46::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9818.25; Fri, 17 Apr 2026 15:34:01 +0000 Received: from BL0PR12MB2353.namprd12.prod.outlook.com ([fe80::99b:dcff:8d6d:78e0]) by BL0PR12MB2353.namprd12.prod.outlook.com ([fe80::99b:dcff:8d6d:78e0%4]) with mapi id 15.20.9818.023; Fri, 17 Apr 2026 15:34:01 +0000 From: Eliot Courtney Date: Sat, 18 Apr 2026 00:29:26 +0900 Subject: [PATCH v4 8/8] gpu: nova-core: gsp: add RM control command infrastructure Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260418-rmcontrol-v4-8-fda8c76dbb95@nvidia.com> References: <20260418-rmcontrol-v4-0-fda8c76dbb95@nvidia.com> In-Reply-To: <20260418-rmcontrol-v4-0-fda8c76dbb95@nvidia.com> To: Danilo Krummrich , Alice Ryhl , Alexandre Courbot , David Airlie , Simona Vetter Cc: John Hubbard , Alistair Popple , Joel Fernandes , Timur Tabi , rust-for-linux@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Eliot Courtney X-Mailer: b4 0.15.2 X-ClientProxiedBy: DM6PR02CA0039.namprd02.prod.outlook.com (2603:10b6:5:177::16) To BL0PR12MB2353.namprd12.prod.outlook.com (2603:10b6:207:4c::31) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL0PR12MB2353:EE_|DM3PR12MB9389:EE_ X-MS-Office365-Filtering-Correlation-Id: fdb7a1d7-b4e0-4a41-670d-08de9c96bfef X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|376014|366016|1800799024|22082099003|18002099003|56012099003; X-Microsoft-Antispam-Message-Info: T0MI5CrZu1QH7O8K52Qp12bhV2HNtyEEdjEjzAZ3k83zcow59ORlzV9rvKxNWyyXUAIWIchRbVdkFIfgOWr16R9YfQKMeER61DKq/MgOTPJcZpeWufdzs7dwSyBfmGZObwrkhTEt1y1OMsMZudHTODU/Bd6l+Im0nBpXzDJvkEWavTQB0gyIzONPa5gnZNnIYUQ7zGOtu0s4gggR6i0jfrVOR/NR1J6IVrqGX56ulAREd4hhYsfv5rA/ZBfrC23hwmOvFB1a0ye06Q8yPIcoZhx3bqA4ei+k550BfS03OY3H5V+MfZ6NJjXegfMKNYSsi581h08hgMvmxvT3LkHoVrHL+6ZfMvwrZAYXCZviGiuVH78Tt9DrVZfXMU+ulKyGXVirpP4vvqkPmQQGf9L2Rch3OLdciCdY53ffBZyndjWWAApNwkO3LT79w+GAny2JTn3S3hhwrQ+8gZZzSew7C6UKcmKGm/cQ7rAzjjGLmq5Qf8xxOv2Wfew/uyNE21L2nKSwyQazyJLSofMz4fuq36cOfgelu4tpIQcJFQfAn+p0Sxyfd3tqutgqRfsWlVZi68BWMej3MLfnFoASmpDD48GCd8NhU1//ASedy8Id5f/5nE0HM11c0ChF6XFY+vzf7WGJ6bq4isBqHjf+X1wu+rhau6Xe4Z9E4oqRIzMavA95RoL3HkuRrHN8Trbso55qv9Mqrx5YJeAj6rOXiv+vWx9T2U3z8hT5Jnq8CO1C67c= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR12MB2353.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(376014)(366016)(1800799024)(22082099003)(18002099003)(56012099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?cENzOVhVeHh2bEladlNYZHh3dHF0ZzMwcnlCaHlrdHhCNk92MGgwM1lKU24r?= =?utf-8?B?MDJPT25YZkFtVTVPblM5bU0vK0cwYU9sK2V5R0poUUVMT1RlMXpaTU8yaEEx?= =?utf-8?B?K2xQd3NiRWdweUVUZ0hvd0t3azhtbEx1dEJXWlVadDZuNm1malpzZnFQK1NW?= =?utf-8?B?akxLYXFJeVY4VUVDNmN2Y053L00wZFI3dkVnK0k0d3ZBOHBNTFVuYml3Umtn?= =?utf-8?B?U1pnYnRUbW1sSWdYeWNzTGNQUWl1NEVRaEdRMWlSVkZwSzdySC9EMXJuTDFV?= =?utf-8?B?V2k1UTd0YmsxQ3c4UGZFZUYrTGFhSkdpenFzNS8rajlBQWROSTF6QW1qM2t3?= =?utf-8?B?dy9vaHFhN01qWDBXTTY2KzZtUFhHNngvNEVlejVDVk9vMVlTOEtSeFVmQmhk?= =?utf-8?B?N3JDKzkyRnV0R3dRRTdyMDd3bTIzOExiQTQyeE84SVB5UklDSGpqWTFmVS81?= =?utf-8?B?RVFMWHpFVnVjdGNmRmZtKzA1NWNISXFpQkxRWTlpQnV2OXlzcnV3MlNxZ0NS?= =?utf-8?B?MzBmb1ZtcFpqWDhsVnNYNXcwZUxTd1U3Zkx5bXRSdVlLVWtXMVNLWFJzZnhy?= =?utf-8?B?UmJ1M1RXdzlhY2NQSE9VOGYrbVh3ZkwyL21oVDgwV29ENFU5VTdhZkpPRTNZ?= =?utf-8?B?M2VmZW85UEY1ajFSQ05Kak5kRW5GK3h5Mk1TcUdPRVo3VTRsdF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670d-08de9c96bfef X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB2353.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Apr 2026 15:34:01.3504 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: eNC/iFVFOLcYHJpx0m2IImh5ihEZh1Wq3D+nIcp34xqH1ntXbXOodQj51ziuaVOSIk4yySWNt8JixLYgecxVgw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB9389 Add `RawRmControl` which implements CommandToGsp for sending RM control RPCs. Add `RmControlReply` which implements MessageFromGsp for getting the reply back. Add the `RmControlCommand` trait for defining an RM control message. Add `RmControl` which sends an RM control RPC via the command queue using the above structures. This gives a generic way to send each RM control RPC. Each new RM control RPC can be added by extending RmControlMsgFunction, adding its bindings wrappers and writing an implementation of `RmControlCommand` that can be sent using `RmControl`. Signed-off-by: Eliot Courtney --- drivers/gpu/nova-core/gsp.rs | 1 + drivers/gpu/nova-core/gsp/fw/rm.rs | 1 - drivers/gpu/nova-core/gsp/rm.rs | 3 + drivers/gpu/nova-core/gsp/rm/commands.rs | 155 +++++++++++++++++++++++++++= ++++ 4 files changed, 159 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nova-core/gsp.rs b/drivers/gpu/nova-core/gsp.rs index ba5b7f990031..58e3d7d21557 100644 --- a/drivers/gpu/nova-core/gsp.rs +++ b/drivers/gpu/nova-core/gsp.rs @@ -21,6 +21,7 @@ pub(crate) mod cmdq; pub(crate) mod commands; mod fw; +pub(crate) mod rm; mod sequencer; =20 pub(crate) use fw::{ diff --git a/drivers/gpu/nova-core/gsp/fw/rm.rs b/drivers/gpu/nova-core/gsp= /fw/rm.rs index e51fdcec1f27..baa3857533e5 100644 --- a/drivers/gpu/nova-core/gsp/fw/rm.rs +++ b/drivers/gpu/nova-core/gsp/fw/rm.rs @@ -54,7 +54,6 @@ pub(crate) struct GspRmControl { inner: bindings::rpc_gsp_rm_control_v03_00, } =20 -#[expect(dead_code)] impl GspRmControl { /// Creates a new RM control command. pub(crate) fn new( diff --git a/drivers/gpu/nova-core/gsp/rm.rs b/drivers/gpu/nova-core/gsp/rm= .rs new file mode 100644 index 000000000000..10e879a3e842 --- /dev/null +++ b/drivers/gpu/nova-core/gsp/rm.rs @@ -0,0 +1,3 @@ +// SPDX-License-Identifier: GPL-2.0 + +pub(crate) mod commands; diff --git a/drivers/gpu/nova-core/gsp/rm/commands.rs b/drivers/gpu/nova-co= re/gsp/rm/commands.rs new file mode 100644 index 000000000000..33be7a663a8c --- /dev/null +++ b/drivers/gpu/nova-core/gsp/rm/commands.rs @@ -0,0 +1,155 @@ +// SPDX-License-Identifier: GPL-2.0 + +use core::array; + +use kernel::{ + device, + prelude::*, // +}; + +use crate::{ + driver::Bar0, + gsp::{ + cmdq::{ + Cmdq, + CommandToGsp, + GspRpcError, + MessageFromGsp, // + }, + commands::{ + Client, + Handle, // + }, + fw::{ + rm::*, + GspMsgRmStatus, + MsgFunction, // + }, + }, + sbuffer::SBufferIter, // +}; + +/// Wraps a [`RmControl`] command to provide the infrastructure for sendin= g it on the command queue. +struct RawRmControl<'a, T>(&'a RmControl) +where + T: RmControlCommand; + +impl<'a, T: RmControlCommand> CommandToGsp for RawRmControl<'a, T> { + const FUNCTION: MsgFunction =3D MsgFunction::GspRmControl; + type Command =3D GspRmControl; + type Reply =3D RmControlReply; + type InitError =3D Error; + + fn init(&self) -> impl Init { + let params_size: u32 =3D T::LEN.try_into()?; + Ok(GspRmControl::new( + self.0.client, + self.0.object, + T::FUNCTION, + params_size, + )) + } + + fn variable_payload_len(&self) -> usize { + T::LEN + } + + fn init_variable_payload( + &self, + dst: &mut SBufferIter>, + ) -> Result { + self.0.cmd.write_payload(dst) + } +} + +/// Command for sending an RM control message to the GSP. +/// +/// RM control messages are used to query or control RM objects (see [`Han= dle`] for more info on RM +/// objects). It takes a client handle and an RM object handle identifying= the target of the +/// message, within the given client. +pub(crate) struct RmControl +where + T: RmControlCommand, +{ + /// The client handle under which `object` is allocated. + client: Handle, + /// The RM object handle to query or control. + object: Handle, + /// The specific RM control command to send. + cmd: T, +} + +#[expect(unused)] +impl RmControl { + /// Creates a new RM control command. + pub(crate) fn new(client: Handle, object: Handle, c= md: T) -> Self { + Self { + client, + object, + cmd, + } + } + + /// Sends an RM control command, checks the reply status, and returns = the reply. + pub(crate) fn send( + self, + dev: &device::Device, + cmdq: &Cmdq, + bar: &Bar0, + ) -> Result { + let reply =3D cmdq.send_command(bar, RawRmControl(&self))?; + + reply + .status + .log_if_warning(dev, T::FUNCTION) + .map_err(GspRpcError::Rm)?; + + self.cmd + .parse_reply(&reply.params) + .map_err(GspRpcError::Transport) + } +} + +/// Response from an RM control message. +struct RmControlReply { + status: GspMsgRmStatus, + params: KVVec, +} + +impl MessageFromGsp for RmControlReply { + const FUNCTION: MsgFunction =3D MsgFunction::GspRmControl; + type Message =3D GspRmControl; + type InitError =3D Error; + + fn read( + msg: &Self::Message, + sbuffer: &mut SBufferIter>, + ) -> Result { + Ok(RmControlReply { + status: msg.status()?, + params: sbuffer.read_to_vec(GFP_KERNEL)?, + }) + } +} + +/// Trait for RM control commands that can be sent using [`RmControl`]. +pub(crate) trait RmControlCommand { + /// The specific RM control message kind to send. + const FUNCTION: RmControlMsgFunction; + + /// Length of the command-specific payload to send with the RM control= message. + const LEN: usize; + + /// The type of the reply after parsing the raw bytes from the RM cont= rol reply message. + type Reply; + + /// The type of the RM object that this command targets. + type Target; + + /// Writes the payload of the command into `dst`. + fn write_payload(&self, dst: &mut SBufferIter>) -> Result; + + /// Parses the reply bytes from an RM control reply message into the c= ommand-specific + /// reply type. + fn parse_reply(&self, params: &[u8]) -> Result; +} --=20 2.53.0