Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: add node_id to physical id conversion in EOP handler

A new field nodeid in interrupt cookie indicates the node ID.

Signed-off-by: Le Ma <le.ma@amd.com>
Reviewed-by: Shiwu Zhang <shiwu.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Le Ma and committed by
Alex Deucher
15091a6f 147862d0

+29 -2
+11
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
··· 99 99 "MP1" 100 100 }; 101 101 102 + const int node_id_to_phys_map[NODEID_MAX] = { 103 + [XCD0_NODEID] = 0, 104 + [XCD1_NODEID] = 1, 105 + [XCD2_NODEID] = 2, 106 + [XCD3_NODEID] = 3, 107 + [XCD4_NODEID] = 4, 108 + [XCD5_NODEID] = 5, 109 + [XCD6_NODEID] = 6, 110 + [XCD7_NODEID] = 7, 111 + }; 112 + 102 113 /** 103 114 * amdgpu_irq_disable_all - disable *all* interrupts 104 115 *
+14
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.h
··· 102 102 bool retry_cam_enabled; 103 103 }; 104 104 105 + enum interrupt_node_id_per_xcp { 106 + XCD0_NODEID = 1, 107 + XCD1_NODEID = 2, 108 + XCD2_NODEID = 5, 109 + XCD3_NODEID = 6, 110 + XCD4_NODEID = 9, 111 + XCD5_NODEID = 10, 112 + XCD6_NODEID = 13, 113 + XCD7_NODEID = 14, 114 + NODEID_MAX, 115 + }; 116 + 117 + extern const int node_id_to_phys_map[NODEID_MAX]; 118 + 105 119 void amdgpu_irq_disable_all(struct amdgpu_device *adev); 106 120 107 121 int amdgpu_irq_init(struct amdgpu_device *adev);
+4 -2
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
··· 2799 2799 struct amdgpu_irq_src *source, 2800 2800 struct amdgpu_iv_entry *entry) 2801 2801 { 2802 - int i; 2802 + int i, phys_id; 2803 2803 u8 me_id, pipe_id, queue_id; 2804 2804 struct amdgpu_ring *ring; 2805 2805 ··· 2808 2808 pipe_id = (entry->ring_id & 0x03) >> 0; 2809 2809 queue_id = (entry->ring_id & 0x70) >> 4; 2810 2810 2811 + phys_id = node_id_to_phys_map[entry->node_id]; 2812 + 2811 2813 switch (me_id) { 2812 2814 case 0: 2813 2815 case 1: 2814 2816 case 2: 2815 2817 for (i = 0; i < adev->gfx.num_compute_rings; i++) { 2816 - ring = &adev->gfx.compute_ring[i]; 2818 + ring = &adev->gfx.compute_ring[i + phys_id * adev->gfx.num_compute_rings]; 2817 2819 /* Per-queue interrupt is supported for MEC starting from VI. 2818 2820 * The interrupt can only be enabled/disabled per pipe instead of per queue. 2819 2821 */