From patchwork Thu May 26 09:43:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 9136879 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CA0A1607D5 for ; Thu, 26 May 2016 09:44:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA30725EF7 for ; Thu, 26 May 2016 09:44:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF13C280E5; Thu, 26 May 2016 09:44:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C675425EF7 for ; Thu, 26 May 2016 09:44:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 880C16EA72; Thu, 26 May 2016 09:44:06 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6859F6EA72 for ; Thu, 26 May 2016 09:44:04 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id n129so3204198wmn.1 for ; Thu, 26 May 2016 02:44:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=pMqgSeeMPcHF2ZGrZZFF7nFyKljYSutP30c9GQBkP9I=; b=uagnwrLl5AHs7ZyYuFR7t67UWnFh40GPNcFGEeaxd9KQQPQPlOzVMqYyT6vuYkx9UE 8N21vIh2vdeJFL74LVYJNHDTj21ItYdq2GWn1dRvKrCbY/B8l60IPaTIuqNhHEbYtuqf hmXE3Dv2zktk1c+mvAalA7ycUKFMIPBHCIKzfwKUFdKxt01k70oHWw4e3hmZ+tlJaNMw 5vE1TVmP9i0aFeO/hlmPQTUNZqkr16xNj94tAUZgdjc2CqdvhdMsTgbIXivu0gYTjpnK Tx4zJpZl6lhZ2wo7ToPrH3a8vWtb0LJNMrES7nTlDYP7Odrkr04puaEwiUsdljfvbiF7 fiTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=pMqgSeeMPcHF2ZGrZZFF7nFyKljYSutP30c9GQBkP9I=; b=lsKQSfXouqBH5qZqjBx46yvOk+Tl3ixpqorG0w2A20w9nzhU/wKjv6FHTqkDOsgRh2 DEUlea4X0rDd5vAbe819V96gd12ueqTKXbAZgZOQRu097SioBP132N4EwByJeobIM5UG 23S6o0nFBSjr70LFzoLO953qrS2Pv6aJ9udd7dieLnJiCSNCQB6DBdD6g97UNA1EED3z 2IaJwagdHyzEX7CHA8+9LrSuIA7jGQMcTF2X+RQgt5qUcgpf23HWyMysWoGnj9WWANZn KjPgH0FGgQswEIEx9m1PW5hHY/3e+sVnAJxB2yBhxiXn1Th7QJ7YOl3lQ52shKeaTw58 dYxw== X-Gm-Message-State: ALyK8tLqGJh1zG344trBhOp6OBbIVNIMO6CO5SSmBB4XlAWwxJOgxOSjGJCK9sYPnXUmEw== X-Received: by 10.28.91.145 with SMTP id p139mr2769277wmb.50.1464255842571; Thu, 26 May 2016 02:44:02 -0700 (PDT) Received: from odedg-tlv.redhat.com ([77.125.96.241]) by smtp.gmail.com with ESMTPSA id kz1sm13370868wjc.46.2016.05.26.02.44.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 May 2016 02:44:01 -0700 (PDT) From: Oded Gabbay To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm/amdkfd: destroy dbgmgr in notifier release Date: Thu, 26 May 2016 12:43:59 +0300 Message-Id: <1464255839-5205-2-git-send-email-oded.gabbay@gmail.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1464255839-5205-1-git-send-email-oded.gabbay@gmail.com> References: <1464255839-5205-1-git-send-email-oded.gabbay@gmail.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP amdkfd need to destroy the debug manager in case amdkfd's notifier function is called before the unbind function, because in that case, the unbind function will exit without destroying debug manager. Signed-off-by: Oded Gabbay --- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c index 248deb7..a1f41a7 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c @@ -242,13 +242,19 @@ static void kfd_process_notifier_release(struct mmu_notifier *mn, 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 we should delete debug managers and reset all wavefronts + */ + list_for_each_entry(pdd, &p->per_device_data, per_device_list) { + if ((pdd->dev->dbgmgr) && + (pdd->dev->dbgmgr->pasid == p->pasid)) + kfd_dbgmgr_destroy(pdd->dev->dbgmgr); + 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);