From patchwork Thu Jul 10 21:54:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 4528451 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 229ACBEEAA for ; Thu, 10 Jul 2014 23:33:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 537392011D for ; Thu, 10 Jul 2014 23:33:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 761CA201F2 for ; Thu, 10 Jul 2014 23:33:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 835CB6E7B4; Thu, 10 Jul 2014 16:33:23 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wg0-f44.google.com (mail-wg0-f44.google.com [74.125.82.44]) by gabe.freedesktop.org (Postfix) with ESMTP id 52E296E01B for ; Thu, 10 Jul 2014 14:55:44 -0700 (PDT) Received: by mail-wg0-f44.google.com with SMTP id m15so194250wgh.15 for ; Thu, 10 Jul 2014 14:55:43 -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=jtlw21ufpPPj3QcC4rI1wKbHUtTAmeeAyJ39mhw7d+A=; b=mkuMWYjpRoslFWp6GFs2+4/QaJQ8LBvIQUDJiPzihsXMazObu72uvY8d/b9ChtCXO3 QUqsPa/6sGHmj4klQO8f0fic/UoiYv4z72nBkw7eNsxeaobTzTRloAVZmTbRik8362Af SrNmpBiyixi24sBI3GrWPzfPKZs35eA4kG6E59AO36snMyNCUf9rvEHSslQD83newzyE cerk9yrECsGOuGVZLxjy1ZG8zbW+vsa5428SSHNQKp8c5qorknDH4SGSxKxBa6aZuMDp w7cvWZXmsllMYNV+keCMlqKDiD6B32oda/2pCW6ukZnskG1Z7eQHCmBFRgoNlP8Op3/1 0KJQ== X-Received: by 10.180.36.18 with SMTP id m18mr294124wij.74.1405029342951; Thu, 10 Jul 2014 14:55:42 -0700 (PDT) Received: from localhost.localdomain ([77.127.59.49]) by mx.google.com with ESMTPSA id pq9sm831097wjc.35.2014.07.10.14.55.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Jul 2014 14:55:42 -0700 (PDT) From: Oded Gabbay X-Google-Original-From: Oded Gabbay To: David Airlie , Alex Deucher , Jerome Glisse Subject: [PATCH 45/83] hsa/radeon: debugging print statements Date: Fri, 11 Jul 2014 00:54:01 +0300 Message-Id: <1405029279-6894-17-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 , Michael Varga , 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: Michael Varga Added debug print statements so critical errors during init may be debugged more easily. Signed-off-by: Michael Varga Signed-off-by: Oded Gabbay --- drivers/gpu/hsa/radeon/kfd_device.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/hsa/radeon/kfd_device.c b/drivers/gpu/hsa/radeon/kfd_device.c index 2e7d50d..82febf4 100644 --- a/drivers/gpu/hsa/radeon/kfd_device.c +++ b/drivers/gpu/hsa/radeon/kfd_device.c @@ -107,20 +107,30 @@ device_iommu_pasid_init(struct kfd_dev *kfd) int err; err = amd_iommu_device_info(kfd->pdev, &iommu_info); - if (err < 0) + if (err < 0) { + dev_err(kfd_device, "error getting iommu info. is the iommu enabled?\n"); return false; + } - if ((iommu_info.flags & required_iommu_flags) != required_iommu_flags) + if ((iommu_info.flags & required_iommu_flags) != required_iommu_flags) { + dev_err(kfd_device, "error required iommu flags ats(%i), pri(%i), pasid(%i)\n", + (iommu_info.flags & AMD_IOMMU_DEVICE_FLAG_ATS_SUP) != 0, + (iommu_info.flags & AMD_IOMMU_DEVICE_FLAG_PRI_SUP) != 0, + (iommu_info.flags & AMD_IOMMU_DEVICE_FLAG_PASID_SUP) != 0); return false; + } pasid_limit = min_t(pasid_t, (pasid_t)1 << kfd->device_info->max_pasid_bits, iommu_info.max_pasids); pasid_limit = min_t(pasid_t, pasid_limit, kfd->doorbell_process_limit); err = amd_iommu_init_device(kfd->pdev, pasid_limit); - if (err < 0) + if (err < 0) { + dev_err(kfd_device, "error initializing iommu device\n"); return false; + } if (!radeon_kfd_set_pasid_limit(pasid_limit)) { + dev_err(kfd_device, "error setting pasid limit\n"); amd_iommu_free_device(kfd->pdev); return false; } @@ -166,6 +176,8 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd, kfd->device_info->scheduler_class->start(kfd->scheduler); kfd->init_complete = true; + dev_info(kfd_device, "added device (%x:%x)\n", kfd->pdev->vendor, + kfd->pdev->device); return true; }