Skip to content

Commit 593ee93

Browse files
committed
Merge branch 'fixes' into for-next
Resolve conflicts in dell/alienware-wmi-wmax and asus-wmi, and enable applying a few amd/hsmp patches that depend on changes in the fixes branch.
2 parents f94ffc3 + bfcfe6d commit 593ee93

25 files changed

Lines changed: 366 additions & 113 deletions

File tree

Documentation/wmi/devices/msi-wmi-platform.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ input data, the meaning of which depends on the subfeature being accessed.
138138
The output buffer contains a single byte which signals success or failure (``0x00`` on failure)
139139
and 31 bytes of output data, the meaning if which depends on the subfeature being accessed.
140140

141+
.. note::
142+
The ACPI control method responsible for handling the WMI method calls is not thread-safe.
143+
This is a firmware bug that needs to be handled inside the driver itself.
144+
141145
WMI method Get_EC()
142146
-------------------
143147

drivers/platform/mellanox/mlxbf-bootctl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,9 @@ static ssize_t secure_boot_fuse_state_show(struct device *dev,
333333
else
334334
status = valid ? "Invalid" : "Free";
335335
}
336-
buf_len += sysfs_emit(buf + buf_len, "%d:%s ", key, status);
336+
buf_len += sysfs_emit_at(buf, buf_len, "%d:%s ", key, status);
337337
}
338-
buf_len += sysfs_emit(buf + buf_len, "\n");
338+
buf_len += sysfs_emit_at(buf, buf_len, "\n");
339339

340340
return buf_len;
341341
}

drivers/platform/x86/amd/hsmp/acpi.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@
2727

2828
#include "hsmp.h"
2929

30-
#define DRIVER_NAME "amd_hsmp"
30+
#define DRIVER_NAME "hsmp_acpi"
3131
#define DRIVER_VERSION "2.3"
32-
#define ACPI_HSMP_DEVICE_HID "AMDI0097"
3332

3433
/* These are the strings specified in ACPI table */
3534
#define MSG_IDOFF_STR "MsgIdOffset"

drivers/platform/x86/amd/hsmp/hsmp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#define HSMP_CDEV_NAME "hsmp_cdev"
2525
#define HSMP_DEVNODE_NAME "hsmp"
26+
#define ACPI_HSMP_DEVICE_HID "AMDI0097"
2627

2728
struct hsmp_mbaddr_info {
2829
u32 base_addr;

drivers/platform/x86/amd/hsmp/plat.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include <asm/amd_hsmp.h>
1313

14+
#include <linux/acpi.h>
1415
#include <linux/build_bug.h>
1516
#include <linux/device.h>
1617
#include <linux/module.h>
@@ -266,7 +267,7 @@ static bool legacy_hsmp_support(void)
266267
}
267268
case 0x1A:
268269
switch (boot_cpu_data.x86_model) {
269-
case 0x00 ... 0x1F:
270+
case 0x00 ... 0x0F:
270271
return true;
271272
default:
272273
return false;
@@ -288,6 +289,9 @@ static int __init hsmp_plt_init(void)
288289
return ret;
289290
}
290291

292+
if (acpi_dev_present(ACPI_HSMP_DEVICE_HID, NULL, -1))
293+
return -ENODEV;
294+
291295
hsmp_pdev = get_hsmp_pdev();
292296
if (!hsmp_pdev)
293297
return -ENOMEM;

drivers/platform/x86/amd/pmc/pmc-quirks.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,13 @@ static const struct dmi_system_id fwbug_list[] = {
217217
DMI_MATCH(DMI_BIOS_VERSION, "03.05"),
218218
}
219219
},
220+
{
221+
.ident = "MECHREVO Wujie 14X (GX4HRXL)",
222+
.driver_data = &quirk_spurious_8042,
223+
.matches = {
224+
DMI_MATCH(DMI_BOARD_NAME, "WUJIE14-GX4HRXL"),
225+
}
226+
},
220227
{}
221228
};
222229

drivers/platform/x86/amd/pmc/pmc.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -644,10 +644,9 @@ static void amd_pmc_s2idle_check(void)
644644
struct smu_metrics table;
645645
int rc;
646646

647-
/* CZN: Ensure that future s0i3 entry attempts at least 10ms passed */
648-
if (pdev->cpu_id == AMD_CPU_ID_CZN && !get_metrics_table(pdev, &table) &&
649-
table.s0i3_last_entry_status)
650-
usleep_range(10000, 20000);
647+
/* Avoid triggering OVP */
648+
if (!get_metrics_table(pdev, &table) && table.s0i3_last_entry_status)
649+
msleep(2500);
651650

652651
/* Dump the IdleMask before we add to the STB */
653652
amd_pmc_idlemask_read(pdev, pdev->dev, NULL);

drivers/platform/x86/amd/pmf/auto-mode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ static void amd_pmf_set_automode(struct amd_pmf_dev *dev, int idx,
120120
amd_pmf_send_cmd(dev, SET_SPPT_APU_ONLY, false, pwr_ctrl->sppt_apu_only, NULL);
121121
amd_pmf_send_cmd(dev, SET_STT_MIN_LIMIT, false, pwr_ctrl->stt_min, NULL);
122122
amd_pmf_send_cmd(dev, SET_STT_LIMIT_APU, false,
123-
pwr_ctrl->stt_skin_temp[STT_TEMP_APU], NULL);
123+
fixp_q88_fromint(pwr_ctrl->stt_skin_temp[STT_TEMP_APU]), NULL);
124124
amd_pmf_send_cmd(dev, SET_STT_LIMIT_HS2, false,
125-
pwr_ctrl->stt_skin_temp[STT_TEMP_HS2], NULL);
125+
fixp_q88_fromint(pwr_ctrl->stt_skin_temp[STT_TEMP_HS2]), NULL);
126126

127127
if (is_apmf_func_supported(dev, APMF_FUNC_SET_FAN_IDX))
128128
apmf_update_fan_idx(dev, config_store.mode_set[idx].fan_control.manual,

drivers/platform/x86/amd/pmf/cnqf.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ static int amd_pmf_set_cnqf(struct amd_pmf_dev *dev, int src, int idx,
8181
amd_pmf_send_cmd(dev, SET_SPPT, false, pc->sppt, NULL);
8282
amd_pmf_send_cmd(dev, SET_SPPT_APU_ONLY, false, pc->sppt_apu_only, NULL);
8383
amd_pmf_send_cmd(dev, SET_STT_MIN_LIMIT, false, pc->stt_min, NULL);
84-
amd_pmf_send_cmd(dev, SET_STT_LIMIT_APU, false, pc->stt_skin_temp[STT_TEMP_APU],
85-
NULL);
86-
amd_pmf_send_cmd(dev, SET_STT_LIMIT_HS2, false, pc->stt_skin_temp[STT_TEMP_HS2],
87-
NULL);
84+
amd_pmf_send_cmd(dev, SET_STT_LIMIT_APU, false,
85+
fixp_q88_fromint(pc->stt_skin_temp[STT_TEMP_APU]), NULL);
86+
amd_pmf_send_cmd(dev, SET_STT_LIMIT_HS2, false,
87+
fixp_q88_fromint(pc->stt_skin_temp[STT_TEMP_HS2]), NULL);
8888

8989
if (is_apmf_func_supported(dev, APMF_FUNC_SET_FAN_IDX))
9090
apmf_update_fan_idx(dev,

drivers/platform/x86/amd/pmf/core.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,20 @@ static void __maybe_unused amd_pmf_dump_registers(struct amd_pmf_dev *dev)
176176
dev_dbg(dev->dev, "AMD_PMF_REGISTER_MESSAGE:%x\n", value);
177177
}
178178

179+
/**
180+
* fixp_q88_fromint: Convert integer to Q8.8
181+
* @val: input value
182+
*
183+
* Converts an integer into binary fixed point format where 8 bits
184+
* are used for integer and 8 bits are used for the decimal.
185+
*
186+
* Return: unsigned integer converted to Q8.8 format
187+
*/
188+
u32 fixp_q88_fromint(u32 val)
189+
{
190+
return val << 8;
191+
}
192+
179193
int amd_pmf_send_cmd(struct amd_pmf_dev *dev, u8 message, bool get, u32 arg, u32 *data)
180194
{
181195
int rc;

0 commit comments

Comments
 (0)