linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Huang, Ray" <Ray.Huang@amd.com>
To: "Huang, Ray" <Ray.Huang@amd.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Alex Deucher <alexdeucher@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: RE: linux-next: build failure after merge of the amdgpu tree
Date: Fri, 15 Jan 2021 08:46:27 +0000	[thread overview]
Message-ID: <MWHPR12MB12481AE693629C4F60368519ECA70@MWHPR12MB1248.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20210115055703.GA1258199@hr-amd>

[-- Attachment #1: Type: text/plain, Size: 2340 bytes --]

[AMD Public Use]

Could you please help to check whether this patch can fix the issue?

Thanks,
Ray

-----Original Message-----
From: Huang, Ray <ray.huang@amd.com> 
Sent: Friday, January 15, 2021 1:57 PM
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Alex Deucher <alexdeucher@gmail.com>; Linux Kernel Mailing List <linux-kernel@vger.kernel.org>; Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: Re: linux-next: build failure after merge of the amdgpu tree

On Fri, Jan 15, 2021 at 01:35:05PM +0800, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the amdgpu tree, today's linux-next build (powerpc
> allyesconfig) failed like this:
> 
> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c: In function 'vangogh_get_smu_metrics_data':
> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c:300:10: error: 'boot_cpu_data' undeclared (first use in this function); did you mean 'boot_cpuid'?

Ah, vangogh is an x86 cpu, let me look at this issue.

Could you share me the config file you tested?

Thanks,
Ray

>   300 |          boot_cpu_data.x86_max_cores * sizeof(uint16_t));
>       |          ^~~~~~~~~~~~~
>       |          boot_cpuid
> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c: In function 'vangogh_read_sensor':
> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c:1320:11: error: 'boot_cpu_data' undeclared (first use in this function); did you mean 'boot_cpuid'?
>  1320 |   *size = boot_cpu_data.x86_max_cores * sizeof(uint16_t);
>       |           ^~~~~~~~~~~~~
>       |           boot_cpuid
> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c: In function 'vangogh_od_edit_dpm_table':
> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c:1460:19: error: 'boot_cpu_data' undeclared (first use in this function); did you mean 'boot_cpuid'?
>  1460 |   if (input[0] >= boot_cpu_data.x86_max_cores) {
>       |                   ^~~~~~~~~~~~~
>       |                   boot_cpuid
> 
> Caused by commits
> 
>   517cb957c43b ("drm/amd/pm: implement the processor clocks which read by metric")
>   0d90d0ddd10e ("drm/amd/pm: implement processor fine grain feature for vangogh (v3)")
> 
> The only thing I could do easily is to disable CONFIG_DRM_AMDGPU for today.
> 
> -- 
> Cheers,
> Stephen Rothwell


[-- Attachment #2: 0001-drm-amdgpu-fix-build-error-without-x86-kconfig.patch --]
[-- Type: application/octet-stream, Size: 5081 bytes --]

From 33297dbed97ecde2cc9b6d73b8827e37959548fa Mon Sep 17 00:00:00 2001
From: Huang Rui <ray.huang@amd.com>
Date: Fri, 15 Jan 2021 15:59:08 +0800
Subject: [PATCH] drm/amdgpu: fix build error without x86 kconfig

This patch is to fix below build error while we are using the kconfig
without x86.

drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c: In function
'vangogh_get_smu_metrics_data':
drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c:300:10:
error: 'boot_cpu_data' undeclared (first use in this function); did you
mean 'boot_cpuid'?
  300 |          boot_cpu_data.x86_max_cores * sizeof(uint16_t));
      |          ^~~~~~~~~~~~~
      |          boot_cpuid
drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c: In function
'vangogh_read_sensor':
drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c:1320:11:
error: 'boot_cpu_data' undeclared (first use in this function); did you
mean 'boot_cpuid'?
 1320 |   *size = boot_cpu_data.x86_max_cores * sizeof(uint16_t);
      |           ^~~~~~~~~~~~~
      |           boot_cpuid
drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c: In function
'vangogh_od_edit_dpm_table':
drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c:1460:19:
error: 'boot_cpu_data' undeclared (first use in this function); did you
mean 'boot_cpuid'?
 1460 |   if (input[0] >= boot_cpu_data.x86_max_cores) {
      |                   ^~~~~~~~~~~~~
      |                   boot_cpuid

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Huang Rui <ray.huang@amd.com>
---
 drivers/gpu/drm/amd/pm/amdgpu_pm.c               |  4 ++--
 drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h          |  1 +
 drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 16 +++++++++++-----
 3 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
index 80d6298912aa..e9b569b76716 100644
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
@@ -3633,12 +3633,12 @@ static void amdgpu_debugfs_prints_cpu_info(struct seq_file *m,
 	int i;
 
 	if (is_support_cclk_dpm(adev)) {
-		p_val = kcalloc(boot_cpu_data.x86_max_cores, sizeof(uint16_t),
+		p_val = kcalloc(adev->smu.cpu_core_num, sizeof(uint16_t),
 				GFP_KERNEL);
 
 		if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_CPU_CLK,
 					    (void *)p_val, &size)) {
-			for (i = 0; i < boot_cpu_data.x86_max_cores; i++)
+			for (i = 0; i < adev->smu.cpu_core_num; i++)
 				seq_printf(m, "\t%u MHz (CPU%d)\n",
 					   *(p_val + i), i);
 		}
diff --git a/drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h
index 25ee9f51813b..fbf88df11a13 100644
--- a/drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h
+++ b/drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h
@@ -471,6 +471,7 @@ struct smu_context
 	uint32_t cpu_actual_soft_min_freq;
 	uint32_t cpu_actual_soft_max_freq;
 	uint32_t cpu_core_id_select;
+	uint16_t cpu_core_num;
 };
 
 struct i2c_adapter;
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
index 2f0cb0ea243b..f127d02c67db 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
@@ -297,7 +297,7 @@ static int vangogh_get_smu_metrics_data(struct smu_context *smu,
 		break;
 	case METRICS_AVERAGE_CPUCLK:
 		memcpy(value, &metrics->CoreFrequency[0],
-		       boot_cpu_data.x86_max_cores * sizeof(uint16_t));
+		       smu->cpu_core_num * sizeof(uint16_t));
 		break;
 	default:
 		*value = UINT_MAX;
@@ -335,6 +335,12 @@ static int vangogh_init_smc_tables(struct smu_context *smu)
 	if (ret)
 		return ret;
 
+#if CONFIG_X86
+	smu->cpu_core_num = boot_cpu_data.x86_max_cores;
+#else
+	smu->cpu_core_num = 4;
+#endif
+
 	return smu_v11_0_init_smc_tables(smu);
 }
 
@@ -1317,7 +1323,7 @@ static int vangogh_read_sensor(struct smu_context *smu,
 		ret = vangogh_get_smu_metrics_data(smu,
 						   METRICS_AVERAGE_CPUCLK,
 						   (uint32_t *)data);
-		*size = boot_cpu_data.x86_max_cores * sizeof(uint16_t);
+		*size = smu->cpu_core_num * sizeof(uint16_t);
 		break;
 	default:
 		ret = -EOPNOTSUPP;
@@ -1457,9 +1463,9 @@ static int vangogh_od_edit_dpm_table(struct smu_context *smu, enum PP_OD_DPM_TAB
 			dev_err(smu->adev->dev, "Input parameter number not correct (should be 4 for processor)\n");
 			return -EINVAL;
 		}
-		if (input[0] >= boot_cpu_data.x86_max_cores) {
+		if (input[0] >= smu->cpu_core_num) {
 			dev_err(smu->adev->dev, "core index is overflow, should be less than %d\n",
-				boot_cpu_data.x86_max_cores);
+				smu->cpu_core_num);
 		}
 		smu->cpu_core_id_select = input[0];
 		if (input[1] == 0) {
@@ -1535,7 +1541,7 @@ static int vangogh_od_edit_dpm_table(struct smu_context *smu, enum PP_OD_DPM_TAB
 				break;
 			}
 
-			for (i = 0; i < boot_cpu_data.x86_max_cores; i++) {
+			for (i = 0; i < smu->cpu_core_num; i++) {
 				ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_SetSoftMinCclk,
 								      (i << 20) | smu->cpu_actual_soft_min_freq,
 								      NULL);
-- 
2.25.1


  reply	other threads:[~2021-01-15  8:47 UTC|newest]

Thread overview: 138+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-15  5:35 linux-next: build failure after merge of the amdgpu tree Stephen Rothwell
2021-01-15  5:57 ` Huang Rui
2021-01-15  8:46   ` Huang, Ray [this message]
2021-01-15 14:56     ` Alex Deucher
  -- strict thread matches above, loose matches on Subject: below --
2024-02-13  4:00 Stephen Rothwell
2024-02-13 14:00 ` Alex Deucher
2023-10-10  1:43 Stephen Rothwell
2023-10-10 21:14 ` Rodrigo Siqueira Jordao
2023-10-16  0:39   ` Stephen Rothwell
2023-10-16 14:53     ` Rodrigo Siqueira Jordao
2023-10-16 20:59       ` Stephen Rothwell
2023-10-17  1:08         ` Stephen Rothwell
2023-10-16  0:18 ` Stephen Rothwell
2023-10-19  1:06 ` Stephen Rothwell
2023-10-24  0:59   ` Stephen Rothwell
2023-10-24 12:57     ` Alex Deucher
2023-10-24 19:52       ` Alex Deucher
2023-10-24 21:47       ` Stephen Rothwell
2023-05-22  7:15 Stephen Rothwell
2023-05-22 16:29 ` Nick Desaulniers
2023-05-22 16:35   ` Alex Deucher
2023-05-22 16:47     ` Nick Desaulniers
2023-05-22 19:14       ` Alex Deucher
2023-05-22  7:11 Stephen Rothwell
2023-05-22  7:24 ` Lazar, Lijo
2023-05-22  7:00 Stephen Rothwell
2023-05-22  7:04 ` Zhang, Hawking
2023-05-19  0:06 Stephen Rothwell
2023-05-19  3:10 ` James Zhu
2023-05-19 13:38 ` Alex Deucher
2023-01-30  1:20 Stephen Rothwell
2022-10-31  0:13 Stephen Rothwell
2022-08-30  1:41 Stephen Rothwell
2022-07-25 11:16 Stephen Rothwell
2022-07-27 16:21 ` Rodrigo Siqueira Jordao
2022-07-27 16:23   ` Alex Deucher
2022-07-19  2:36 Stephen Rothwell
2022-07-20  2:47 ` Stephen Rothwell
2022-07-21  2:16   ` Stephen Rothwell
2022-07-22  2:52     ` Stephen Rothwell
2022-07-22 13:30       ` Alex Deucher
2022-06-23  6:07 Stephen Rothwell
2022-06-23 11:01 ` Greg KH
2022-06-27 14:40 ` Greg KH
2022-06-15  4:37 Stephen Rothwell
2022-06-15 18:17 ` Alex Deucher
2022-06-14  4:51 Stephen Rothwell
2022-06-03  4:43 Stephen Rothwell
2022-06-09  3:14 ` Stephen Rothwell
2022-06-15  5:00 ` Stephen Rothwell
2022-06-21  8:15   ` Stephen Rothwell
2022-06-21 15:02     ` Alex Deucher
2022-06-21 22:07       ` Stephen Rothwell
2022-06-22 14:48         ` Alex Deucher
2022-06-23  7:47           ` Stephen Rothwell
2022-06-02  0:30 Stephen Rothwell
2022-05-06  1:06 Stephen Rothwell
2022-05-05  9:47 Stephen Rothwell
2022-05-05 18:12 ` Nathan Chancellor
2022-05-05 18:46   ` Alex Deucher
2022-05-06  1:05     ` Stephen Rothwell
     [not found] <BN9PR12MB5145ECB75120FF9AC1AA4CFB8DEC9@BN9PR12MB5145.namprd12.prod.outlook.com>
2022-04-13 14:18 ` Alex Deucher
     [not found]   ` <BN9PR12MB5145D81F9978B656E9BB67C78DEF9@BN9PR12MB5145.namprd12.prod.outlook.com>
2022-04-14 14:23     ` Rodrigo Siqueira Jordao
2022-04-14 14:27       ` Alex Deucher
2022-04-14 14:31         ` Rodrigo Siqueira Jordao
2022-04-13  2:32 Stephen Rothwell
2022-04-08  4:46 Stephen Rothwell
2022-03-07  0:13 Stephen Rothwell
2022-03-07  7:16 ` Uwe Kleine-König
2022-03-07 13:04 ` Mark Brown
2022-03-08 11:15   ` Noralf Trønnes
2022-02-15  0:57 Stephen Rothwell
2022-02-01  3:32 Stephen Rothwell
2022-02-01 18:32 ` Limonciello, Mario
2022-02-01 18:53   ` Alex Deucher
2022-01-26 23:42 Stephen Rothwell
2022-01-14  0:36 Stephen Rothwell
2022-01-14 23:25 ` Stephen Rothwell
2021-12-03  1:11 Stephen Rothwell
2021-11-18  4:23 Stephen Rothwell
2021-10-08  0:31 Stephen Rothwell
2021-10-08  6:27 ` Simon Ser
2021-10-08  8:29   ` Stephen Rothwell
2021-10-08  9:22     ` Simon Ser
2021-10-08 14:11       ` Alex Deucher
2021-10-08 18:07         ` Simon Ser
2021-10-11  7:33           ` Christoph Hellwig
2021-10-11  7:39             ` Simon Ser
2021-10-11  7:43               ` Christoph Hellwig
2021-10-11  7:49                 ` Simon Ser
2021-10-11  7:51                   ` Christoph Hellwig
2021-10-11  7:57                     ` Simon Ser
2021-10-11  8:01                       ` Christoph Hellwig
2021-10-11  8:21                         ` Simon Ser
2021-10-09  4:57       ` Stephen Rothwell
2021-10-12  2:25 ` Stephen Rothwell
2021-10-12 13:32   ` Alex Deucher
2021-09-29  1:20 Stephen Rothwell
2021-09-17  0:57 Stephen Rothwell
2021-08-02 15:55 linux-next: Build " Mark Brown
2021-07-28 12:34 linux-next: build " Mark Brown
2021-05-27  5:58 Stephen Rothwell
2021-05-04 23:34 Stephen Rothwell
2021-05-09 22:46 ` Stephen Rothwell
2021-05-10 14:24   ` Alex Deucher
2021-05-10 22:18     ` Stephen Rothwell
2021-05-10 22:23       ` Alex Deucher
2021-05-10 23:02         ` Stephen Rothwell
2021-03-30  2:18 Stephen Rothwell
2021-03-19  1:21 Stephen Rothwell
2021-02-23  1:11 Stephen Rothwell
2021-02-05  2:12 Stephen Rothwell
2021-01-08  1:17 Stephen Rothwell
2020-10-27  1:08 Stephen Rothwell
2020-06-17  0:26 Stephen Rothwell
2020-06-12  0:25 Stephen Rothwell
2020-06-26  1:47 ` Stephen Rothwell
2020-02-11 22:48 Stephen Rothwell
2020-02-12 16:14 ` Rodrigo Siqueira
2020-01-28  4:42 Stephen Rothwell
2020-01-28 21:18 ` Alex Deucher
2020-01-08  2:18 Stephen Rothwell
2019-11-08  5:31 Stephen Rothwell
2019-11-08 15:50 ` Grodzovsky, Andrey
2019-11-08 15:59 ` Alex Deucher
2019-11-07  0:46 Stephen Rothwell
2019-08-13  8:10 Stephen Rothwell
2019-08-13  8:21 ` Huang, Ray
2019-08-13 14:01   ` Alex Deucher
2019-08-16  0:21     ` Stephen Rothwell
2019-08-16  1:52       ` Alex Deucher
2019-08-16  2:43         ` Stephen Rothwell
2019-06-26 11:22 Stephen Rothwell
2019-06-27  3:35 ` Stephen Rothwell
2019-06-27 14:18   ` Alex Deucher
2019-06-27 22:01     ` Stephen Rothwell
2019-06-24  4:24 Stephen Rothwell
2019-03-19  0:04 Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MWHPR12MB12481AE693629C4F60368519ECA70@MWHPR12MB1248.namprd12.prod.outlook.com \
    --to=ray.huang@amd.com \
    --cc=alexdeucher@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).