Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp850905pxb; Thu, 12 Nov 2020 19:24:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJz7TfIkzZow3nHUwhtKNIshtynANamVDtX4ULpRL9A31WxDLF8PCLlZRVHFEAvyu8EAcg/5 X-Received: by 2002:aa7:c948:: with SMTP id h8mr429027edt.171.1605237875317; Thu, 12 Nov 2020 19:24:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605237875; cv=none; d=google.com; s=arc-20160816; b=zzC8DYSYeGl0liTJM8zI5zza8tjV2Ci89pZkGYdKNg9vKDvcxcEVp4Dcrp6vaDjWvM c3ZxbMY4Xf3ReZjpxUC0uV+KOCF593Lm5R1n34nPNshn8eYz4FI9vDZrYxhrrPr44Nyx llXxgDuIcMEz0bPCetYDkMvLfco22uHD7pzbG/19j9rtvL+ARbadLk66ownK1HLxW/BZ 4E9GeuEn4rQn/be+vpG6xvzIyXZCJj3kRW+pfQ/5AK+H8wn97jQWhtNIezCX7HFcghn0 UhedApFxTG9c8bCxOfGuYTK+vdRm8QFOfDVyTzIyVNoC54dri3PaUGIMF9qlFXsy+A6y gVBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=8RhkzWyP58h1RCvKdO/GSV/qzWl0rCUAwtWpA2xY5wU=; b=kHhJKxDx3pdeTYwMYVQRNb2wLf3qdEf/O0iEvVhHnJ357OSvfeVWFgETWKBh+hJwMW r/R1IAeypzPCcZrrlnf7ZYvEvh0QLoOcJMUhZ/8lfLmtU9oXk24yEBvKsooBTLmU2T7G ldsOL/tXO7C46RiKjFXHtdYWFvBUVvfMe7FXj+bOTZLAi1ssK0pn8fL8LkcSs6An8DVa VcEg6mNHftazyvQAlA7AqJfZSIciIbwZVFPKmahdWXLGP9VetPYlUghV2l5ZmhtaPIvQ ogycNj6q1quIJ3t1u1qAAOtQkqxVLxu32MrGhB5hoVs+FGaTLkpbwDKEHmNTgfZQ9kk1 5HFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r24si5673945edq.456.2020.11.12.19.24.13; Thu, 12 Nov 2020 19:24:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726303AbgKMDTv (ORCPT + 99 others); Thu, 12 Nov 2020 22:19:51 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:7530 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725965AbgKMDTu (ORCPT ); Thu, 12 Nov 2020 22:19:50 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4CXNxN0V1Zzhl1l; Fri, 13 Nov 2020 11:19:36 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Fri, 13 Nov 2020 11:19:39 +0800 From: Hanjun Guo To: Felix Kuehling CC: , , Hanjun Guo Subject: [PATCH v3 1/2] drm/amdkfd: Move the ignore_crat check before the CRAT table get Date: Fri, 13 Nov 2020 11:11:13 +0800 Message-ID: <1605237074-58920-1-git-send-email-guohanjun@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the ignore_crat is set to non-zero value, it's no point getting the CRAT table, so just move the ignore_crat check before we get the CRAT table. Signed-off-by: Hanjun Guo --- drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c index 3de5e14..c23e571 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c @@ -780,6 +780,11 @@ int kfd_create_crat_image_acpi(void **crat_image, size_t *size) *crat_image = NULL; + if (kfd_ignore_crat()) { + pr_info("CRAT table disabled by module option\n"); + return -ENODATA; + } + /* Fetch the CRAT table from ACPI */ status = acpi_get_table(CRAT_SIGNATURE, 0, &crat_table); if (status == AE_NOT_FOUND) { @@ -792,11 +797,6 @@ int kfd_create_crat_image_acpi(void **crat_image, size_t *size) return -EINVAL; } - if (kfd_ignore_crat()) { - pr_info("CRAT table disabled by module option\n"); - return -ENODATA; - } - pcrat_image = kvmalloc(crat_table->length, GFP_KERNEL); if (!pcrat_image) return -ENOMEM; -- 1.7.12.4