From patchwork Thu Jul 10 21:54:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 4528291 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 901409F3B4 for ; Thu, 10 Jul 2014 23:33:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C1BC7201B4 for ; Thu, 10 Jul 2014 23:33:39 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id EEF9D201DE for ; Thu, 10 Jul 2014 23:33:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C39CE6E79D; 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-we0-f170.google.com (mail-we0-f170.google.com [74.125.82.170]) by gabe.freedesktop.org (Postfix) with ESMTP id 031056E163 for ; Thu, 10 Jul 2014 14:57:21 -0700 (PDT) Received: by mail-we0-f170.google.com with SMTP id w61so196370wes.29 for ; Thu, 10 Jul 2014 14:57:20 -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=vtHaTKqBU52wE3MVq2pL4RrWb3+oV5fQyBrn+RrV3YE=; b=wzLaOcFMeVJHM8fTkTNRmqH7sv8VrJyMjqT4LCoNmN1m5ReCVSQKtfJYAp6UjZErFD VpOJknx23qMSEMMzWPPhG104oG787Dk/EPQCOEcKJ/5vy7Bl+sw85pvFCfJDCvWNf4yZ pXJxeNMOesKk0yw633YGLQzsKc/hd1jxNqkQPG9nIIYCbWpLwbOuxn83gUi1K7wEnJ4v FUJMg1gMEUoHca4FLTsWLVYnx7Som9DfM+k3EU33ADK/nHPUSrXK8o15IkESvGq8OoIr ZL4RHRkVjHAPhmktf7lcuFu636sVIKqKD9yIJ1wr8+EsZIHFdGBw6oVsSdKVwoOY0sus ufOw== X-Received: by 10.194.83.39 with SMTP id n7mr60444082wjy.58.1405029440234; Thu, 10 Jul 2014 14:57:20 -0700 (PDT) Received: from localhost.localdomain ([77.127.59.49]) by mx.google.com with ESMTPSA id pq9sm831097wjc.35.2014.07.10.14.57.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Jul 2014 14:57:19 -0700 (PDT) From: Oded Gabbay X-Google-Original-From: Oded Gabbay To: David Airlie , Alex Deucher , Jerome Glisse Subject: [PATCH 73/83] hsa/radeon: Adding qcm fence return status Date: Fri, 11 Jul 2014 00:54:29 +0300 Message-Id: <1405029279-6894-45-git-send-email-oded.gabbay@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1405029279-6894-1-git-send-email-oded.gabbay@amd.com> References: <1405029279-6894-1-git-send-email-oded.gabbay@amd.com> X-Mailman-Approved-At: Thu, 10 Jul 2014 16:33:12 -0700 Cc: Andrew Lewycky , Yair Shachar , 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 From: Yair Shachar Waiting on fence returns status Signed-off-by: Yair Shachar Signed-off-by: Oded Gabbay --- drivers/gpu/hsa/radeon/kfd_device_queue_manager.c | 6 ++++-- drivers/gpu/hsa/radeon/kfd_priv.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/hsa/radeon/kfd_device_queue_manager.c b/drivers/gpu/hsa/radeon/kfd_device_queue_manager.c index 4931f8a..4c53e57 100644 --- a/drivers/gpu/hsa/radeon/kfd_device_queue_manager.c +++ b/drivers/gpu/hsa/radeon/kfd_device_queue_manager.c @@ -800,7 +800,7 @@ out: return retval; } -static void fence_wait_timeout(unsigned int *fence_addr, unsigned int fence_value, unsigned long timeout) +int fence_wait_timeout(unsigned int *fence_addr, unsigned int fence_value, unsigned long timeout) { BUG_ON(!fence_addr); timeout += jiffies; @@ -808,10 +808,12 @@ static void fence_wait_timeout(unsigned int *fence_addr, unsigned int fence_valu while (*fence_addr != fence_value) { if (time_after(jiffies, timeout)) { pr_err("kfd: qcm fence wait loop timeout expired\n"); - break; + return -ETIME; } cpu_relax(); } + + return 0; } static int destroy_queues_cpsch(struct device_queue_manager *dqm) diff --git a/drivers/gpu/hsa/radeon/kfd_priv.h b/drivers/gpu/hsa/radeon/kfd_priv.h index 97bf58a..b61187a 100644 --- a/drivers/gpu/hsa/radeon/kfd_priv.h +++ b/drivers/gpu/hsa/radeon/kfd_priv.h @@ -463,6 +463,8 @@ int pqm_update_queue(struct process_queue_manager *pqm, unsigned int qid, struct struct kernel_queue *pqm_get_kernel_queue(struct process_queue_manager *pqm, unsigned int qid); void test_diq(struct kfd_dev *dev, struct process_queue_manager *pqm); +int fence_wait_timeout(unsigned int *fence_addr, unsigned int fence_value, unsigned long timeout); + /* Packet Manager */ #define KFD_HIQ_TIMEOUT (500)