From patchwork Thu Jul 10 21:50:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 4528101 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 867B89F3B4 for ; Thu, 10 Jul 2014 23:33:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C7CBA201F2 for ; Thu, 10 Jul 2014 23:33:21 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 04AA4201D5 for ; Thu, 10 Jul 2014 23:33:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D5FA06E709; Thu, 10 Jul 2014 16:33:13 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by gabe.freedesktop.org (Postfix) with ESMTP id 786A66E0B0 for ; Thu, 10 Jul 2014 14:52:24 -0700 (PDT) Received: by mail-wi0-f180.google.com with SMTP id hi2so409008wib.13 for ; Thu, 10 Jul 2014 14:52:23 -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=CqO+PnO2YAM8Q0QHfvQgXKzUg/O9OzmpJP/WOgkDXJo=; b=BXr7wysQoMEoXsJrN6CLYVNg2BlBlPGlGVALZG0qNLdDFVAF6vgryoDlIY9xbdgcIw UUs3qyInJlOIMnxhngjBtmZNHv2+tEmU/R3OncgG65mYQSyjLy4iG+KckygCzGWhWQ9c nm7GWw/zhku2ZPdJJVmC2YzE/R/YMzI+FprnsV6rUUnuINJYeP1yNEDWr0p4bB9f7h6c J7pwuWdjx7wK1W11gAAxER39X5wHNRbOl8akQhVHqKMNGueUrhJVjlXva/gOEAmEjjMA ZwbHPgQF2w3NiegenhEZrCDUrbYpqOvIfntaxHRdQbdGBC4UX2S0Tc+v822P41pBQyeA R4bQ== X-Received: by 10.180.81.68 with SMTP id y4mr22449183wix.26.1405029142861; Thu, 10 Jul 2014 14:52:22 -0700 (PDT) Received: from localhost.localdomain ([77.127.59.49]) by mx.google.com with ESMTPSA id n2sm805353wjf.40.2014.07.10.14.52.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Jul 2014 14:52:22 -0700 (PDT) From: Oded Gabbay X-Google-Original-From: Oded Gabbay To: David Airlie , Alex Deucher , Jerome Glisse Subject: [PATCH 25/83] hsa/radeon: fix the OEMID assignment in kfd_topology Date: Fri, 11 Jul 2014 00:50:25 +0300 Message-Id: <1405029027-6085-24-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, Evgeny Pinchuk 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: Evgeny Pinchuk The assignment of OEMID from the CRAT table is into a 64 variable. The OEMID is 48bit wide in the CRAT. This fix makes sure that only 48bit are assigned for the OEMID value from the CRAT table. Signed-off-by: Evgeny Pinchuk Signed-off-by: Oded Gabbay --- drivers/gpu/hsa/radeon/kfd_crat.h | 2 ++ drivers/gpu/hsa/radeon/kfd_topology.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/hsa/radeon/kfd_crat.h b/drivers/gpu/hsa/radeon/kfd_crat.h index 587455d..a374fa3 100644 --- a/drivers/gpu/hsa/radeon/kfd_crat.h +++ b/drivers/gpu/hsa/radeon/kfd_crat.h @@ -42,6 +42,8 @@ #define CRAT_OEMTABLEID_LENGTH 8 #define CRAT_RESERVED_LENGTH 6 +#define CRAT_OEMID_64BIT_MASK ((1ULL << (CRAT_OEMID_LENGTH * 8)) - 1) + struct crat_header { uint32_t signature; uint32_t length; diff --git a/drivers/gpu/hsa/radeon/kfd_topology.c b/drivers/gpu/hsa/radeon/kfd_topology.c index 6acac25..2ee5444 100644 --- a/drivers/gpu/hsa/radeon/kfd_topology.c +++ b/drivers/gpu/hsa/radeon/kfd_topology.c @@ -467,10 +467,10 @@ static int kfd_parse_crat_table(void *crat_image) if (!top_dev) { kfd_release_live_view(); return -ENOMEM; + } } -} - sys_props.platform_id = *((uint64_t *)crat_table->oem_id); + sys_props.platform_id = (*((uint64_t *)crat_table->oem_id)) & CRAT_OEMID_64BIT_MASK; sys_props.platform_oem = *((uint64_t *)crat_table->oem_table_id); sys_props.platform_rev = crat_table->revision;