{
int retval;
enum kfd_preempt_type_filter preempt_type;
- struct kfd_process *p;
+ struct kfd_process_device *pdd;
BUG_ON(!dqm);
retval = amdkfd_fence_wait_timeout(dqm->fence_addr, KFD_FENCE_COMPLETED,
QUEUE_PREEMPT_DEFAULT_TIMEOUT_MS);
if (retval != 0) {
- p = kfd_get_process(current);
- p->reset_wavefronts = true;
+ pdd = kfd_get_process_device_data(dqm->dev,
+ kfd_get_process(current));
+ pdd->reset_wavefronts = true;
goto out;
}
pm_release_ib(&dqm->packets);
/* Is this process/pasid bound to this device? (amd_iommu_bind_pasid) */
bool bound;
+
+ /* This flag tells if we should reset all
+ * wavefronts on process termination
+ */
+ bool reset_wavefronts;
};
#define qpd_to_pdd(x) container_of(x, struct kfd_process_device, qpd)
event_pages */
u32 next_nonsignal_event_id;
size_t signal_event_count;
- /*
- * This flag tells if we should reset all wavefronts on
- * process termination
- */
- bool reset_wavefronts;
};
/**
pr_debug("Releasing pdd (topology id %d) for process (pasid %d) in workqueue\n",
pdd->dev->id, p->pasid);
- if (p->reset_wavefronts)
+ if (pdd->reset_wavefronts)
dbgdev_wave_reset_wavefronts(pdd->dev, p);
amd_iommu_unbind_pasid(pdd->dev->pdev, p->pasid);
struct mm_struct *mm)
{
struct kfd_process *p;
+ struct kfd_process_device *pdd = NULL;
/*
* The kfd_process structure can not be free because the
/* In case our notifier is called before IOMMU notifier */
pqm_uninit(&p->pqm);
+ /* Iterate over all process device data structure and check
+ * if we should reset all wavefronts */
+ list_for_each_entry(pdd, &p->per_device_data, per_device_list)
+ if (pdd->reset_wavefronts) {
+ pr_warn("amdkfd: Resetting all wave fronts\n");
+ dbgdev_wave_reset_wavefronts(pdd->dev, p);
+ pdd->reset_wavefronts = false;
+ }
+
mutex_unlock(&p->mutex);
/*
if (kfd_init_apertures(process) != 0)
goto err_init_apretures;
- process->reset_wavefronts = false;
-
return process;
err_init_apretures:
INIT_LIST_HEAD(&pdd->qpd.queues_list);
INIT_LIST_HEAD(&pdd->qpd.priv_queue_list);
pdd->qpd.dqm = dev->dqm;
+ pdd->reset_wavefronts = false;
list_add(&pdd->per_device_list, &p->per_device_data);
}
kfd_dbgmgr_destroy(dev->dbgmgr);
pqm_uninit(&p->pqm);
- if (p->reset_wavefronts)
- dbgdev_wave_reset_wavefronts(dev, p);
pdd = kfd_get_process_device_data(dev, p);
+ if (pdd->reset_wavefronts) {
+ dbgdev_wave_reset_wavefronts(pdd->dev, p);
+ pdd->reset_wavefronts = false;
+ }
/*
* Just mark pdd as unbound, because we still need it to call