From patchwork Thu Jul 10 21:50:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 4528311 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 318F2BEEAA for ; Thu, 10 Jul 2014 23:33:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 64979201D5 for ; Thu, 10 Jul 2014 23:33:42 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 81774201DE for ; Thu, 10 Jul 2014 23:33:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E4ACA6E7A0; Thu, 10 Jul 2014 16:33:15 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by gabe.freedesktop.org (Postfix) with ESMTP id EABBB6E01B for ; Thu, 10 Jul 2014 14:52:04 -0700 (PDT) Received: by mail-wi0-f178.google.com with SMTP id f8so418781wiw.5 for ; Thu, 10 Jul 2014 14:52:04 -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=KR50BTVVcayEwhIJwxsypNNWoMYEK50DzEwDn1/7bG0=; b=HwTTEADUSfSzVFb2e541sjEIIez9c3Z8ULJ9lFhX3Ui1V2ikvEwbz7pLw0JzCTb2eT eN4B9LE/t9gd91Cjgex71Rs+s7DUyrbopCz5AJy1a3Z1X6B5AflR7cuYHm7HKb0DKo0X DNsKGlUckc1/B6Hs24fEWhkQQGRRkBlN0RKhuC8rpVgIY8SRQ4Rly0flrAAFI263sygU hj7bgLXAZcCzEf7wICFVfqngYmLZ8rmJCPxjQbUgUCmjAabyqcd2aYgiN3rgeYDLXxNX 3BLGG4uc6eEzJZ54VnB2vgPwUh0RVhWCd1k3yFLOKQxoWsYxJqk0BYrJKg4oUrXqlQ+E bwPg== X-Received: by 10.194.58.199 with SMTP id t7mr60836934wjq.14.1405029124260; Thu, 10 Jul 2014 14:52:04 -0700 (PDT) Received: from localhost.localdomain ([77.127.59.49]) by mx.google.com with ESMTPSA id n2sm805353wjf.40.2014.07.10.14.52.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Jul 2014 14:52:03 -0700 (PDT) From: Oded Gabbay X-Google-Original-From: Oded Gabbay To: David Airlie , Alex Deucher , Jerome Glisse Subject: [PATCH 19/83] hsa/radeon: Enable/Disable KFD interrupt module Date: Fri, 11 Jul 2014 00:50:19 +0300 Message-Id: <1405029027-6085-18-git-send-email-oded.gabbay@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1405029027-6085-1-git-send-email-oded.gabbay@amd.com> References: <1405029027-6085-1-git-send-email-oded.gabbay@amd.com> X-Mailman-Approved-At: Thu, 10 Jul 2014 16:33:12 -0700 Cc: Andrew Lewycky , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 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-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch add calls to initialize and finalize the KFD interrupt module. The calls are done per device initialize/finalize inside the kgd-->kfd interface. Signed-off-by: Oded Gabbay --- drivers/gpu/hsa/radeon/cik_regs.h | 1 + drivers/gpu/hsa/radeon/kfd_device.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/hsa/radeon/cik_regs.h b/drivers/gpu/hsa/radeon/cik_regs.h index 9c3ce97..813cdc4 100644 --- a/drivers/gpu/hsa/radeon/cik_regs.h +++ b/drivers/gpu/hsa/radeon/cik_regs.h @@ -73,6 +73,7 @@ #define CP_PQ_WPTR_POLL_CNTL 0xC20C #define WPTR_POLL_EN (1 << 31) +#define CPC_INT_CNTL 0xC2D0 #define CP_ME1_PIPE0_INT_CNTL 0xC214 #define CP_ME1_PIPE1_INT_CNTL 0xC218 #define CP_ME1_PIPE2_INT_CNTL 0xC21C diff --git a/drivers/gpu/hsa/radeon/kfd_device.c b/drivers/gpu/hsa/radeon/kfd_device.c index b2d2861..b627e57 100644 --- a/drivers/gpu/hsa/radeon/kfd_device.c +++ b/drivers/gpu/hsa/radeon/kfd_device.c @@ -127,6 +127,9 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd, radeon_kfd_doorbell_init(kfd); + if (radeon_kfd_interrupt_init(kfd)) + return false; + if (!device_iommu_pasid_init(kfd)) return false; @@ -155,10 +158,13 @@ void kgd2kfd_device_exit(struct kfd_dev *kfd) BUG_ON(err != 0); - if (kfd->init_complete) { + if (kfd->init_complete) kfd->device_info->scheduler_class->stop(kfd->scheduler); - kfd->device_info->scheduler_class->destroy(kfd->scheduler); + radeon_kfd_interrupt_exit(kfd); + + if (kfd->init_complete) { + kfd->device_info->scheduler_class->destroy(kfd->scheduler); amd_iommu_free_device(kfd->pdev); }