@@ -1197,6 +1197,8 @@ static NV_STATUS alloc_parent_gpu(const NvProcessorUuid *gpu_uuid,
11971197 uvm_sema_init (& parent_gpu -> isr .replayable_faults .service_lock , 1 , UVM_LOCK_ORDER_ISR );
11981198 uvm_sema_init (& parent_gpu -> isr .non_replayable_faults .service_lock , 1 , UVM_LOCK_ORDER_ISR );
11991199 uvm_mutex_init (& parent_gpu -> access_counters_enablement_lock , UVM_LOCK_ORDER_ACCESS_COUNTERS );
1200+ uvm_mutex_init (& parent_gpu -> access_counters_clear_tracker_lock , UVM_LOCK_ACCESS_COUNTERS_CLEAR_OPS );
1201+ uvm_tracker_init (& parent_gpu -> access_counters_clear_tracker );
12001202 uvm_spin_lock_irqsave_init (& parent_gpu -> isr .interrupts_lock , UVM_LOCK_ORDER_LEAF );
12011203 uvm_spin_lock_init (& parent_gpu -> instance_ptr_table_lock , UVM_LOCK_ORDER_LEAF );
12021204 uvm_rb_tree_init (& parent_gpu -> instance_ptr_table );
@@ -1214,6 +1216,7 @@ static NV_STATUS alloc_parent_gpu(const NvProcessorUuid *gpu_uuid,
12141216 return NV_OK ;
12151217
12161218cleanup :
1219+ uvm_tracker_deinit (& parent_gpu -> access_counters_clear_tracker );
12171220 uvm_kvfree (parent_gpu );
12181221
12191222 return status ;
@@ -1644,19 +1647,12 @@ static void sync_parent_gpu_trackers(uvm_parent_gpu_t *parent_gpu,
16441647
16451648 // Sync the access counter clear tracker too.
16461649 if (parent_gpu -> access_counters_supported && parent_gpu -> access_counter_buffer ) {
1647- NvU32 notif_buf_index ;
1648- for ( notif_buf_index = 0 ; notif_buf_index < parent_gpu -> rm_info . accessCntrBufferCount ; notif_buf_index ++ ) {
1649- uvm_access_counter_buffer_t * access_counters = & parent_gpu -> access_counter_buffer [ notif_buf_index ] ;
1650+ uvm_mutex_lock ( & parent_gpu -> access_counters_clear_tracker_lock ) ;
1651+ status = uvm_tracker_wait ( & parent_gpu -> access_counters_clear_tracker );
1652+ uvm_mutex_unlock ( & parent_gpu -> access_counters_clear_tracker_lock ) ;
16501653
1651- if (access_counters -> rm_info .accessCntrBufferHandle != 0 ) {
1652- uvm_access_counters_isr_lock (access_counters );
1653- status = uvm_tracker_wait (& access_counters -> clear_tracker );
1654- uvm_access_counters_isr_unlock (access_counters );
1655-
1656- if (status != NV_OK )
1657- UVM_ASSERT (status == uvm_global_get_status ());
1658- }
1659- }
1654+ if (status != NV_OK )
1655+ UVM_ASSERT (status == uvm_global_get_status ());
16601656 }
16611657}
16621658
@@ -1787,6 +1783,8 @@ static void uvm_parent_gpu_destroy(nv_kref_t *nv_kref)
17871783 for_each_sub_processor_index (sub_processor_index )
17881784 UVM_ASSERT (!parent_gpu -> gpus [sub_processor_index ]);
17891785
1786+ uvm_tracker_deinit (& parent_gpu -> access_counters_clear_tracker );
1787+
17901788 uvm_kvfree (parent_gpu );
17911789}
17921790
@@ -2881,6 +2879,9 @@ static NV_STATUS gpu_retain_by_uuid_locked(const NvProcessorUuid *gpu_uuid,
28812879 if (status != NV_OK )
28822880 goto error_unregister ;
28832881
2882+ if (gpu_info -> accessCntrBufferCount > 1 )
2883+ gpu_info -> accessCntrBufferCount = 1 ;
2884+
28842885 if (parent_gpu != NULL ) {
28852886 // If the UUID has been seen before, and if SMC is enabled, then check
28862887 // if this specific partition has been seen previously. The UUID-based
0 commit comments