From 81663016dbfd53e29d1b5c5ddbc9b12ae1d66474 Mon Sep 17 00:00:00 2001 From: Oded Gabbay Date: Wed, 24 Dec 2014 13:30:52 +0200 Subject: drm/amdkfd: Add module parameter of send_sigterm This patch adds a new kernel module parameter to amdkfd, called send_sigterm. This parameter specifies whether amdkfd should send the SIGTERM signal to an HSA process, when the following conditions occur: 1. The GPU triggers an exception regarding a kernel that was issued by this process. 2. The HSA process isn't waiting on an event that handles this exception. The default behavior is not to send a SIGTERM and suffice with a dmesg error print. Reviewed-by: Ben Goz Signed-off-by: Oded Gabbay --- drivers/gpu/drm/amd/amdkfd/kfd_events.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_events.c') diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_events.c b/drivers/gpu/drm/amd/amdkfd/kfd_events.c index 5c3a81e667a8..3cb37d220f60 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_events.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_events.c @@ -872,10 +872,16 @@ static void lookup_events_by_type_and_signal(struct kfd_process *p, /* Send SIGTERM no event of type "type" has been found*/ if (send_signal) { - dev_warn(kfd_device, - "Sending SIGTERM to HSA Process with PID %d ", + if (send_sigterm) { + dev_warn(kfd_device, + "Sending SIGTERM to HSA Process with PID %d ", + p->lead_thread->pid); + send_sig(SIGTERM, p->lead_thread, 0); + } else { + dev_err(kfd_device, + "HSA Process (PID %d) got unhandled exception", p->lead_thread->pid); - send_sig(SIGTERM, p->lead_thread, 0); + } } } -- cgit v1.2.3