From: Mark Brown <broonie@kernel.org>
To: Dave Airlie <airlied@redhat.com>, DRI <dri-devel@lists.freedesktop.org>
Cc: Alex Deucher <alexander.deucher@amd.com>,
Lijo Lazar <lijo.lazar@amd.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Next Mailing List <linux-next@vger.kernel.org>,
Yang Wang <kevinyang.wang@amd.com>
Subject: linux-next: manual merge of the drm tree with the origin tree
Date: Mon, 17 Aug 2026 16:27:52 +0100 [thread overview]
Message-ID: <aoMoeEtvdJzu6cS2@sirena.org.uk> (raw)
[-- Attachment #1: Type: text/plain, Size: 9811 bytes --]
Hi all,
Today's linux-next merge of the drm tree got a conflict in:
drivers/gpu/drm/amd/pm/amdgpu_pm.c
between commit:
1849a64165ccc ("drm/amd/pm: use milliwatts for GPU power sensors")
from the origin tree and commits:
757ba0790bafe ("drm/amd/pm: use milliwatts for GPU power sensors")
f5998f4d71b23 ("drm/amd/pm: Simplify SoC power printing in debugfs")
from the drm tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
diff --combined drivers/gpu/drm/amd/pm/amdgpu_pm.c
index 85b089a3dc414,c0e677328af57..0000000000000
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
@@@ -34,6 -34,7 +34,7 @@@
#include <linux/nospec.h>
#include <linux/pm_runtime.h>
#include <linux/string_choices.h>
+ #include <linux/units.h>
#include <asm/processor.h>
#define MAX_NUM_OF_FEATURES_PER_SUBSET 8
@@@ -98,6 -99,37 +99,37 @@@ const char * const amdgpu_pp_profile_na
"UNCAPPED",
};
+ static int amdgpu_pm_parse_long_params(char *str, long *params,
+ uint32_t max_params,
+ uint32_t *num_params)
+ {
+ const char delimiter[] = { ' ', '\n', '\0' };
+ uint32_t count = 0;
+ char *sub_str;
+ int ret;
+
+ if (!params || !num_params)
+ return -EINVAL;
+
+ while ((sub_str = strsep(&str, delimiter)) != NULL) {
+ if (strlen(sub_str) == 0)
+ continue;
+ if (count >= max_params)
+ return -EINVAL;
+ ret = kstrtol(sub_str, 0, ¶ms[count]);
+ if (ret)
+ return -EINVAL;
+ count++;
+ if (!str)
+ break;
+ while (isspace(*str))
+ str++;
+ }
+ *num_params = count;
+
+ return 0;
+ }
+
/**
* amdgpu_pm_dev_state_check - Check if device can be accessed.
* @adev: Target device.
@@@ -761,8 -793,6 +793,6 @@@ static ssize_t amdgpu_set_pp_od_clk_vol
long parameter[64];
char buf_cpy[128];
char *tmp_str;
- char *sub_str;
- const char delimiter[3] = {' ', '\n', '\0'};
uint32_t type;
if (count > 127 || count == 0)
@@@ -797,22 -827,10 +827,10 @@@
tmp_str++;
while (isspace(*++tmp_str));
- while ((sub_str = strsep(&tmp_str, delimiter)) != NULL) {
- if (strlen(sub_str) == 0)
- continue;
- if (parameter_size >= ARRAY_SIZE(parameter))
- return -EINVAL;
- ret = kstrtol(sub_str, 0, ¶meter[parameter_size]);
- if (ret)
- return -EINVAL;
- parameter_size++;
-
- if (!tmp_str)
- break;
-
- while (isspace(*tmp_str))
- tmp_str++;
- }
+ ret = amdgpu_pm_parse_long_params(
+ tmp_str, parameter, ARRAY_SIZE(parameter), ¶meter_size);
+ if (ret)
+ return ret;
ret = amdgpu_pm_get_access(adev);
if (ret < 0)
@@@ -1385,11 -1403,9 +1403,9 @@@ static ssize_t amdgpu_set_pp_power_prof
struct amdgpu_device *adev = drm_to_adev(ddev);
uint32_t parameter_size = 0;
long parameter[64];
- char *sub_str, buf_cpy[128];
- char *tmp_str;
+ char buf_cpy[128];
char tmp[2];
long int profile_mode = 0;
- const char delimiter[3] = {' ', '\n', '\0'};
/* Reject empty/whitespace strings - fuzzing found this is not validated */
if (count == 0 || sysfs_streq(buf, ""))
@@@ -1407,19 -1423,11 +1423,11 @@@
while (isspace(*buf))
buf++;
strscpy(buf_cpy, buf, sizeof(buf_cpy));
- tmp_str = buf_cpy;
- while ((sub_str = strsep(&tmp_str, delimiter)) != NULL) {
- if (strlen(sub_str) == 0)
- continue;
- ret = kstrtol(sub_str, 0, ¶meter[parameter_size]);
- if (ret)
- return -EINVAL;
- parameter_size++;
- if (!tmp_str)
- break;
- while (isspace(*tmp_str))
- tmp_str++;
- }
+ ret = amdgpu_pm_parse_long_params(buf_cpy, parameter,
+ ARRAY_SIZE(parameter) - 1,
+ ¶meter_size);
+ if (ret)
+ return ret;
}
parameter[parameter_size] = profile_mode;
@@@ -2015,6 -2023,7 +2023,7 @@@ static int pp_dpm_clk_default_attr_upda
gc_ver == IP_VERSION(11, 0, 1) ||
gc_ver == IP_VERSION(11, 0, 4) ||
gc_ver == IP_VERSION(11, 5, 0) ||
+ gc_ver == IP_VERSION(11, 5, 1) ||
gc_ver == IP_VERSION(11, 0, 2) ||
gc_ver == IP_VERSION(11, 0, 3) ||
amdgpu_is_multi_aid(adev)))
@@@ -2023,7 -2032,8 +2032,8 @@@
if (!((gc_ver == IP_VERSION(10, 3, 1) ||
gc_ver == IP_VERSION(10, 3, 0) ||
gc_ver == IP_VERSION(11, 0, 2) ||
- gc_ver == IP_VERSION(11, 0, 3)) && adev->vcn.num_vcn_inst >= 2))
+ gc_ver == IP_VERSION(11, 0, 3) ||
+ gc_ver == IP_VERSION(11, 5, 1)) && adev->vcn.num_vcn_inst >= 2))
*states = ATTR_STATE_UNSUPPORTED;
} else if (DEVICE_ATTR_IS(pp_dpm_dclk)) {
if (!(gc_ver == IP_VERSION(10, 3, 1) ||
@@@ -2036,6 -2046,7 +2046,7 @@@
gc_ver == IP_VERSION(11, 0, 1) ||
gc_ver == IP_VERSION(11, 0, 4) ||
gc_ver == IP_VERSION(11, 5, 0) ||
+ gc_ver == IP_VERSION(11, 5, 1) ||
gc_ver == IP_VERSION(11, 0, 2) ||
gc_ver == IP_VERSION(11, 0, 3) ||
amdgpu_is_multi_aid(adev)))
@@@ -2044,7 -2055,8 +2055,8 @@@
if (!((gc_ver == IP_VERSION(10, 3, 1) ||
gc_ver == IP_VERSION(10, 3, 0) ||
gc_ver == IP_VERSION(11, 0, 2) ||
- gc_ver == IP_VERSION(11, 0, 3)) && adev->vcn.num_vcn_inst >= 2))
+ gc_ver == IP_VERSION(11, 0, 3) ||
+ gc_ver == IP_VERSION(11, 5, 1)) && adev->vcn.num_vcn_inst >= 2))
*states = ATTR_STATE_UNSUPPORTED;
} else if (DEVICE_ATTR_IS(pp_dpm_pcie)) {
if (amdgpu_is_multi_aid(adev))
@@@ -3943,18 -3955,14 +3955,14 @@@ out_pm_put
return size;
}
- static int parse_input_od_command_lines(const char *buf,
- size_t count,
- u32 *type,
- long *params,
- size_t params_max,
+ static int parse_input_od_command_lines(const char *buf, size_t count,
+ u32 *type, long *params,
+ uint32_t max_params,
uint32_t *num_of_params)
{
- const char delimiter[3] = {' ', '\n', '\0'};
uint32_t parameter_size = 0;
char buf_cpy[128] = {0};
- char *tmp_str, *sub_str;
- int ret;
+ char *tmp_str;
if (count > sizeof(buf_cpy) - 1)
return -EINVAL;
@@@ -3979,28 -3987,8 +3987,8 @@@
break;
}
- while ((sub_str = strsep(&tmp_str, delimiter)) != NULL) {
- if (strlen(sub_str) == 0)
- continue;
-
- if (parameter_size >= params_max)
- return -EINVAL;
-
- ret = kstrtol(sub_str, 0, ¶ms[parameter_size]);
- if (ret)
- return -EINVAL;
- parameter_size++;
-
- if (!tmp_str)
- break;
-
- while (isspace(*tmp_str))
- tmp_str++;
- }
-
- *num_of_params = parameter_size;
-
- return 0;
+ return amdgpu_pm_parse_long_params(tmp_str, params, max_params,
+ num_of_params);
}
static int
@@@ -4013,10 -4001,7 +4001,7 @@@ amdgpu_distribute_custom_od_settings(st
long parameter[64];
int ret;
- ret = parse_input_od_command_lines(in_buf,
- count,
- &cmd_type,
- parameter,
+ ret = parse_input_od_command_lines(in_buf, count, &cmd_type, parameter,
ARRAY_SIZE(parameter),
¶meter_size);
if (ret)
@@@ -4892,9 -4877,8 +4877,8 @@@ static int amdgpu_debugfs_pm_info_pp(st
{
uint32_t mp1_ver = amdgpu_ip_version(adev, MP1_HWIP, 0);
uint32_t gc_ver = amdgpu_ip_version(adev, GC_HWIP, 0);
- uint32_t value, mwatt, centiwatt;
uint64_t value64 = 0;
- uint32_t query = 0;
+ uint32_t value;
int size;
/* GPU Clocks */
@@@ -4915,25 -4899,22 +4899,22 @@@
seq_printf(m, "\t%u mV (VDDGFX)\n", value);
if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_VDDNB, (void *)&value, &size))
seq_printf(m, "\t%u mV (VDDNB)\n", value);
- size = sizeof(uint32_t);
- if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_GPU_AVG_POWER, (void *)&query, &size)) {
- mwatt = query;
- centiwatt = DIV_ROUND_CLOSEST(mwatt, 10);
+ if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_GPU_AVG_POWER, (void *)&value, &size)) {
if (adev->flags & AMD_IS_APU)
- seq_printf(m, "\t%u.%02u W (average SoC including CPU)\n", centiwatt / 100, centiwatt % 100);
+ seq_printf(m, "\t%u.%02u W (average SoC including CPU)\n",
+ (u32)(value / MILLIWATT_PER_WATT), (u32)(value % MILLIWATT_PER_WATT) / 10);
else
- seq_printf(m, "\t%u.%02u W (average SoC)\n", centiwatt / 100, centiwatt % 100);
+ seq_printf(m, "\t%u.%02u W (average SoC)\n",
+ (u32)(value / MILLIWATT_PER_WATT), (u32)(value % MILLIWATT_PER_WATT) / 10);
}
- size = sizeof(uint32_t);
- if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_GPU_INPUT_POWER, (void *)&query, &size)) {
- mwatt = query;
- centiwatt = DIV_ROUND_CLOSEST(mwatt, 10);
+ if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_GPU_INPUT_POWER, (void *)&value, &size)) {
if (adev->flags & AMD_IS_APU)
- seq_printf(m, "\t%u.%02u W (current SoC including CPU)\n", centiwatt / 100, centiwatt % 100);
+ seq_printf(m, "\t%u.%02u W (current SoC including CPU)\n",
+ (u32)(value / MILLIWATT_PER_WATT), (u32)(value % MILLIWATT_PER_WATT) / 10);
else
- seq_printf(m, "\t%u.%02u W (current SoC)\n", centiwatt / 100, centiwatt % 100);
+ seq_printf(m, "\t%u.%02u W (current SoC)\n",
+ (u32)(value / MILLIWATT_PER_WATT), (u32)(value % MILLIWATT_PER_WATT) / 10);
}
- size = sizeof(value);
seq_printf(m, "\n");
/* GPU Temp */
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next reply other threads:[~2026-08-17 15:27 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 15:27 Mark Brown [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-08-14 13:56 linux-next: manual merge of the drm tree with the origin tree Mark Brown
2026-08-14 13:56 Mark Brown
2026-08-10 15:03 Mark Brown
2026-08-10 15:02 Mark Brown
2026-08-10 15:02 Mark Brown
2026-08-10 15:02 Mark Brown
2026-08-07 14:37 Mark Brown
2026-08-03 14:31 Mark Brown
2026-08-03 14:31 Mark Brown
2026-07-31 14:01 Mark Brown
2026-07-20 14:44 Mark Brown
2026-07-20 14:44 Mark Brown
2026-06-09 17:53 Mark Brown
2026-06-04 14:13 Mark Brown
2026-05-18 12:47 Mark Brown
2026-04-14 13:08 Mark Brown
2026-04-14 13:12 ` Miguel Ojeda
2026-03-30 15:49 Mark Brown
2026-03-27 20:56 Mark Brown
2026-03-23 15:55 Mark Brown
2026-03-23 15:55 Mark Brown
2026-03-23 15:49 Mark Brown
2026-03-23 15:01 Mark Brown
2026-02-08 22:47 Mark Brown
2026-02-08 22:46 Mark Brown
2026-02-02 14:29 Mark Brown
2026-01-19 17:03 Mark Brown
2026-01-19 16:53 Mark Brown
2025-10-02 12:07 Mark Brown
2025-10-02 12:05 Mark Brown
2025-10-02 12:30 ` Danilo Krummrich
2025-09-26 12:38 Mark Brown
2024-06-28 16:51 Mark Brown
2024-06-27 15:06 Mark Brown
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=aoMoeEtvdJzu6cS2@sirena.org.uk \
--to=broonie@kernel.org \
--cc=airlied@redhat.com \
--cc=alexander.deucher@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kevinyang.wang@amd.com \
--cc=lijo.lazar@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
/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