# Kernel crashes on specific Orin NX modules

**URL:** <https://forums.developer.nvidia.com/t/kernel-crashes-on-specific-orin-nx-modules/329611>\
**Category:** Jetson Orin NX\
**Tags:** linux, kernel, board-design\
**Created:** [April 8, 2025, 9:54am UTC](https://forums.developer.nvidia.com/t/kernel-crashes-on-specific-orin-nx-modules/329611 "2025-04-08T09:54:17Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![AastaLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/aastalll/32/14043_2.png) [@AastaLLL](https://forums.developer.nvidia.com/u/AastaLLL)\
**Post date:** [April 17, 2025, 2:20am UTC](https://forums.developer.nvidia.com/t/kernel-crashes-on-specific-orin-nx-modules/329611/17 "2025-04-17T02:20:28Z")

</div>

Hi,

Thanks for reporting this.

Could you help to check if the below changes can fix the issue?  
We are going to merge this change to our internal branch so the future release should contain the fix by default.

```diff
diff --git a/drivers/gpu/nvgpu/common/gr/gr_config.c b/drivers/gpu/nvgpu/common/gr/gr_config.c
index c86bba6..42cf687 100644
--- a/drivers/gpu/nvgpu/common/gr/gr_config.c
+++ b/drivers/gpu/nvgpu/common/gr/gr_config.c
@@ -686,8 +667,9 @@
 	 * logical id.
 	 */
 	config->gpc_tpc_physical_id_map = nvgpu_kzalloc(g,
- nvgpu_safe_mult_u32((size_t)config->gpc_count,
- sizeof(u32 *)));
+ nvgpu_safe_mult_u32(
+ nvgpu_safe_cast_u64_to_u32((size_t)config->max_gpc_count),
+ (u32)sizeof(u32 *)));
 	if (config->gpc_tpc_physical_id_map == NULL) {
 		nvgpu_err(g, "alloc gpc_tpc_physical_id_map failed");
 		goto clean_up_gpc_rop_config;
@@ -696,6 +678,11 @@
 	for (gpc_index = 0; gpc_index < config->gpc_count; gpc_index++) {
 		gpc_phys_id = nvgpu_grmgr_get_gr_gpc_phys_id(g,
 				cur_gr_instance, (u32)gpc_index);
+ if (gpc_phys_id >= config->max_gpc_count) {
+ nvgpu_err(g, "gpc_phys_id: %u is >= max_gpc_count: %u",
+ gpc_phys_id, config->max_gpc_count);
+ goto clean_up_gpc_tpc_physical_id_map_alloc_fail;
+ }
 		config->gpc_tpc_physical_id_map[gpc_phys_id] =
 			nvgpu_kzalloc(g, nvgpu_safe_mult_u32(
 				config->max_tpc_per_gpc_count, sizeof(u32)));

```

Thanks.

---

_[View the full topic](https://forums.developer.nvidia.com/t/kernel-crashes-on-specific-orin-nx-modules/329611)._
