hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/gpu/drm/amd/amdkfd/kfd_dbgdev.c
....@@ -45,7 +45,7 @@
4545 }
4646
4747 static int dbgdev_diq_submit_ib(struct kfd_dbgdev *dbgdev,
48
- unsigned int pasid, uint64_t vmid0_address,
48
+ u32 pasid, uint64_t vmid0_address,
4949 uint32_t *packet_buff, size_t size_in_bytes)
5050 {
5151 struct pm4__release_mem *rm_packet;
....@@ -72,11 +72,11 @@
7272 * The receive packet buff will be sitting on the Indirect Buffer
7373 * and in the PQ we put the IB packet + sync packet(s).
7474 */
75
- status = kq->ops.acquire_packet_buffer(kq,
75
+ status = kq_acquire_packet_buffer(kq,
7676 pq_packets_size_in_bytes / sizeof(uint32_t),
7777 &ib_packet_buff);
7878 if (status) {
79
- pr_err("acquire_packet_buffer failed\n");
79
+ pr_err("kq_acquire_packet_buffer failed\n");
8080 return status;
8181 }
8282
....@@ -115,7 +115,7 @@
115115
116116 if (status) {
117117 pr_err("Failed to allocate GART memory\n");
118
- kq->ops.rollback_packet(kq);
118
+ kq_rollback_packet(kq);
119119 return status;
120120 }
121121
....@@ -151,11 +151,11 @@
151151
152152 rm_packet->data_lo = QUEUESTATE__ACTIVE;
153153
154
- kq->ops.submit_packet(kq);
154
+ kq_submit_packet(kq);
155155
156156 /* Wait till CP writes sync code: */
157157 status = amdkfd_fence_wait_timeout(
158
- (unsigned int *) rm_state,
158
+ rm_state,
159159 QUEUESTATE__ACTIVE, 1500);
160160
161161 kfd_gtt_sa_free(dbgdev->dev, mem_obj);
....@@ -185,7 +185,7 @@
185185 properties.type = KFD_QUEUE_TYPE_DIQ;
186186
187187 status = pqm_create_queue(dbgdev->pqm, dbgdev->dev, NULL,
188
- &properties, &qid);
188
+ &properties, &qid, NULL);
189189
190190 if (status) {
191191 pr_err("Failed to create DIQ\n");
....@@ -761,6 +761,7 @@
761761 {
762762 int status = 0;
763763 unsigned int vmid;
764
+ uint16_t queried_pasid;
764765 union SQ_CMD_BITS reg_sq_cmd;
765766 union GRBM_GFX_INDEX_BITS reg_gfx_index;
766767 struct kfd_process_device *pdd;
....@@ -782,19 +783,18 @@
782783 */
783784
784785 for (vmid = first_vmid_to_scan; vmid <= last_vmid_to_scan; vmid++) {
785
- if (dev->kfd2kgd->get_atc_vmid_pasid_mapping_valid
786
- (dev->kgd, vmid)) {
787
- if (dev->kfd2kgd->get_atc_vmid_pasid_mapping_pasid
788
- (dev->kgd, vmid) == p->pasid) {
789
- pr_debug("Killing wave fronts of vmid %d and pasid %d\n",
790
- vmid, p->pasid);
791
- break;
792
- }
786
+ status = dev->kfd2kgd->get_atc_vmid_pasid_mapping_info
787
+ (dev->kgd, vmid, &queried_pasid);
788
+
789
+ if (status && queried_pasid == p->pasid) {
790
+ pr_debug("Killing wave fronts of vmid %d and pasid 0x%x\n",
791
+ vmid, p->pasid);
792
+ break;
793793 }
794794 }
795795
796796 if (vmid > last_vmid_to_scan) {
797
- pr_err("Didn't find vmid for pasid %d\n", p->pasid);
797
+ pr_err("Didn't find vmid for pasid 0x%x\n", p->pasid);
798798 return -EFAULT;
799799 }
800800