From patchwork Sat May 28 15:25:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 9139459 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 F0BCB6075C for ; Sat, 28 May 2016 15:26:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E09AA2793B for ; Sat, 28 May 2016 15:26:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D542C280B2; Sat, 28 May 2016 15:26:19 +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 947BB2793B for ; Sat, 28 May 2016 15:26:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9A68B6E121; Sat, 28 May 2016 15:26:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 48C126E121 for ; Sat, 28 May 2016 15:26:12 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id e3so8279534wme.2 for ; Sat, 28 May 2016 08:26:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZyDK06x34q4g6NnE3VVr5Z4l+GN+ImqUHZQy21js6Ig=; b=G40OSYkNm53oso533g/OkLe/ne2rCYGBBwsvk5gkXtimEHKR8DFPT9PY7JX6CO8v2+ 9HEqBXH3oX1aUXZeVAiKZ/F/TYeY4bDGOeH0cOQxsbsRjyqR8N1OjX/StuZZzAw5fQMD JMcu5oi2ksvlGvvRC6ZO10Gm4tkl5P1goXxokZCWzffrn1yfUxz1ui2XQ26w91/48bOo h17tHozustowXbP4lE4xXLyiymq8EKUoYuMCjAWQ04QKIO+p6+V7kg3H5gZigrqUE/3q 3+kw2XQ/Vq3XcWhSp67EhVY2K+z44NzOIn5KTTYyMH9knlcnyXbHoU7t0LwSwxLn+5nn owJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZyDK06x34q4g6NnE3VVr5Z4l+GN+ImqUHZQy21js6Ig=; b=i+0/9CHQxODWjnHg9hXi0iATps8Mfk+OAmMI9tpywH9D3Hrd3RA05S589ZlNx+1tQj X9MscJXymY1GrVM0e7HOn0Ziy51f46g+E4IURvc7AcMKnVABVh94GevRJFS6LibXBqoy 6+wH7uJ02HGh6chtCm7lRgZaEzNVhqg4ikF5QyP2xLA2uKGsupLGnJzJT39AAXs8O0f7 u/t2l1cYtMgVcwG83MxBJaaHMKNZS8cVpiZZvVQK1/GV7X8zRy0iLlizkYgY/z0/wcwO /fx97NfYc9x1lOkBt86KhNEHHMvPorS3f7cyLFdJjXKEWRInP7vaq4/2wiAkdKX5Eh8q 6qRQ== X-Gm-Message-State: ALyK8tK+VtG6VhXfVUoBYcSpH84ca986Li3G3GAWTSj4Xt61wifbKi99gFHT1tElB8qa/g== X-Received: by 10.28.163.198 with SMTP id m189mr3692250wme.54.1464449170541; Sat, 28 May 2016 08:26:10 -0700 (PDT) Received: from odedg-home.localdomain ([2.55.141.226]) by smtp.gmail.com with ESMTPSA id t3sm13996374wmf.20.2016.05.28.08.26.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 May 2016 08:26:09 -0700 (PDT) From: Oded Gabbay To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 2/2] drm/amdkfd: destroy dbgmgr in notifier release Date: Sat, 28 May 2016 18:25:45 +0300 Message-Id: <1464449145-13227-2-git-send-email-oded.gabbay@gmail.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1464449145-13227-1-git-send-email-oded.gabbay@gmail.com> References: <1464449145-13227-1-git-send-email-oded.gabbay@gmail.com> Cc: Stable 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 CC: Stable --- 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 a64bc61..7708d90 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);