From patchwork Thu Jul 10 21:54:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 4528421 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 0B4F9BEEAA for ; Thu, 10 Jul 2014 23:33:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 47275201DE for ; Thu, 10 Jul 2014 23:33:51 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 68DC22011D for ; Thu, 10 Jul 2014 23:33:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 50A306E7A9; 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-f41.google.com (mail-wg0-f41.google.com [74.125.82.41]) by gabe.freedesktop.org (Postfix) with ESMTP id C94E86E445 for ; Thu, 10 Jul 2014 14:57:33 -0700 (PDT) Received: by mail-wg0-f41.google.com with SMTP id z12so191123wgg.12 for ; Thu, 10 Jul 2014 14:57:32 -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=DZFVEmV7MeM4atELL2jpz6XKQd4U6armRiIPnWX71TA=; b=ae30cVf53loJFB1BL/1R9q7ILBKojNAFzCAlvEhEE+oAn4hMmkQv4IvrrkdR7t0hKq 1jzRyI2dHq90Cdba6bZDEMJeh3zeBl5x3BYeQM3jDZx+fDFjKGoh2dh+EYX2OsRYQzvr CwMNOtBr8/aNB5Y+XFktiBzlNIxTtx+poH9ElAeE7FAiDj4rNcyUNzIb3JU/2U7Ke+Ey CQK/AzlGJMQbC9PINgOhnpWdvY7UkGBcz0PdgyhY8znVOFUkQaRSbWNcCTd/3ap1enL1 0PSpTVJoWKzKi8fJLyv+bc4BUzbCPgs3bf6iBc580YmuyJtpIptNEopEWJfURUHafNzK vTrA== X-Received: by 10.194.161.136 with SMTP id xs8mr57780807wjb.31.1405029451899; Thu, 10 Jul 2014 14:57:31 -0700 (PDT) Received: from localhost.localdomain ([77.127.59.49]) by mx.google.com with ESMTPSA id pq9sm831097wjc.35.2014.07.10.14.57.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Jul 2014 14:57:31 -0700 (PDT) From: Oded Gabbay X-Google-Original-From: Oded Gabbay To: David Airlie , Alex Deucher , Jerome Glisse Subject: [PATCH 78/83] hsa/radeon: Don't verify cksum when parsing CRAT table Date: Fri, 11 Jul 2014 00:54:34 +0300 Message-Id: <1405029279-6894-50-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 , 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 removes the checksum verification done when parsing a CRAT table. The verification was both erronous and redundant, as it is done by another piece of kernel code. Signed-off-by: Oded Gabbay --- drivers/gpu/hsa/radeon/kfd_topology.c | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/hsa/radeon/kfd_topology.c b/drivers/gpu/hsa/radeon/kfd_topology.c index d3aaad1..b686b7e 100644 --- a/drivers/gpu/hsa/radeon/kfd_topology.c +++ b/drivers/gpu/hsa/radeon/kfd_topology.c @@ -38,21 +38,6 @@ static struct kfd_system_properties sys_props; static DECLARE_RWSEM(topology_lock); - -static uint8_t checksum_image(const void *buf, size_t len) -{ - uint8_t *p = (uint8_t *)buf; - uint8_t sum = 0; - - if (!buf) - return 0; - - while (len-- > 0) - sum += *p++; - - return sum; - } - struct kfd_dev *radeon_kfd_device_by_id(uint32_t gpu_id) { struct kfd_topology_device *top_dev; @@ -97,9 +82,9 @@ static int kfd_topology_get_crat_acpi(void *crat_image, size_t *size) if (!size) return -EINVAL; -/* + /* * Fetch the CRAT table from ACPI - */ + */ status = acpi_get_table(CRAT_SIGNATURE, 0, &crat_table); if (status == AE_NOT_FOUND) { pr_warn("CRAT table not found\n"); @@ -111,16 +96,6 @@ static int kfd_topology_get_crat_acpi(void *crat_image, size_t *size) return -EINVAL; } - /* - * The checksum of the table should be verified - */ - if (checksum_image(crat_table, crat_table->length) == - crat_table->checksum) { - pr_err("Bad checksum for the CRAT table\n"); - return -EINVAL; -} - - if (*size >= crat_table->length && crat_image != 0) memcpy(crat_image, crat_table, crat_table->length);