Skip to content

Commit 272aa18

Browse files
committed
Merge tag 'platform-drivers-x86-v6.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
Pull x86 platform driver fixes from Ilpo Järvinen: - amd/hsmp: - Ensure sock->metric_tbl_addr is non-NULL - Register driver even if hwmon registration fails - amd/pmc: Drop SMU F/W match for Cezanne - dell-smbios-wmi: Separate "priority" from WMI device ID - hp-wmi: mark Victus 16-r1xxx for Victus s fan and thermal profile support - intel-uncore-freq: Check write blocked for efficiency latency control * tag 'platform-drivers-x86-v6.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86: hp-wmi: mark Victus 16-r1xxx for victus_s fan and thermal profile support platform/x86/amd/hsmp: Ensure success even if hwmon registration fails platform/x86/amd/hsmp: Ensure sock->metric_tbl_addr is non-NULL platform/x86/intel-uncore-freq: Check write blocked for ELC platform/x86/amd: pmc: Drop SMU F/W match for Cezanne platform/x86: dell-smbios-wmi: Stop touching WMI device ID
2 parents a2e94e8 + 748f897 commit 272aa18

File tree

10 files changed

+59
-52
lines changed

10 files changed

+59
-52
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ static int init_acpi(struct device *dev)
504504

505505
dev_set_drvdata(dev, &hsmp_pdev->sock[sock_ind]);
506506

507-
return ret;
507+
return 0;
508508
}
509509

510510
static const struct bin_attribute hsmp_metric_tbl_attr = {

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,11 @@ ssize_t hsmp_metric_tbl_read(struct hsmp_socket *sock, char *buf, size_t size)
356356
if (!sock || !buf)
357357
return -EINVAL;
358358

359+
if (!sock->metric_tbl_addr) {
360+
dev_err(sock->dev, "Metrics table address not available\n");
361+
return -ENOMEM;
362+
}
363+
359364
/* Do not support lseek(), also don't allow more than the size of metric table */
360365
if (size != sizeof(struct hsmp_metric_table)) {
361366
dev_err(sock->dev, "Wrong buffer size\n");

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

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,90 +28,95 @@ static struct quirk_entry quirk_spurious_8042 = {
2828
.spurious_8042 = true,
2929
};
3030

31+
static struct quirk_entry quirk_s2idle_spurious_8042 = {
32+
.s2idle_bug_mmio = FCH_PM_BASE + FCH_PM_SCRATCH,
33+
.spurious_8042 = true,
34+
};
35+
3136
static const struct dmi_system_id fwbug_list[] = {
3237
{
3338
.ident = "L14 Gen2 AMD",
34-
.driver_data = &quirk_s2idle_bug,
39+
.driver_data = &quirk_s2idle_spurious_8042,
3540
.matches = {
3641
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
3742
DMI_MATCH(DMI_PRODUCT_NAME, "20X5"),
3843
}
3944
},
4045
{
4146
.ident = "T14s Gen2 AMD",
42-
.driver_data = &quirk_s2idle_bug,
47+
.driver_data = &quirk_s2idle_spurious_8042,
4348
.matches = {
4449
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
4550
DMI_MATCH(DMI_PRODUCT_NAME, "20XF"),
4651
}
4752
},
4853
{
4954
.ident = "X13 Gen2 AMD",
50-
.driver_data = &quirk_s2idle_bug,
55+
.driver_data = &quirk_s2idle_spurious_8042,
5156
.matches = {
5257
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
5358
DMI_MATCH(DMI_PRODUCT_NAME, "20XH"),
5459
}
5560
},
5661
{
5762
.ident = "T14 Gen2 AMD",
58-
.driver_data = &quirk_s2idle_bug,
63+
.driver_data = &quirk_s2idle_spurious_8042,
5964
.matches = {
6065
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
6166
DMI_MATCH(DMI_PRODUCT_NAME, "20XK"),
6267
}
6368
},
6469
{
6570
.ident = "T14 Gen1 AMD",
66-
.driver_data = &quirk_s2idle_bug,
71+
.driver_data = &quirk_s2idle_spurious_8042,
6772
.matches = {
6873
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
6974
DMI_MATCH(DMI_PRODUCT_NAME, "20UD"),
7075
}
7176
},
7277
{
7378
.ident = "T14 Gen1 AMD",
74-
.driver_data = &quirk_s2idle_bug,
79+
.driver_data = &quirk_s2idle_spurious_8042,
7580
.matches = {
7681
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
7782
DMI_MATCH(DMI_PRODUCT_NAME, "20UE"),
7883
}
7984
},
8085
{
8186
.ident = "T14s Gen1 AMD",
82-
.driver_data = &quirk_s2idle_bug,
87+
.driver_data = &quirk_s2idle_spurious_8042,
8388
.matches = {
8489
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
8590
DMI_MATCH(DMI_PRODUCT_NAME, "20UH"),
8691
}
8792
},
8893
{
8994
.ident = "T14s Gen1 AMD",
90-
.driver_data = &quirk_s2idle_bug,
95+
.driver_data = &quirk_s2idle_spurious_8042,
9196
.matches = {
9297
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
9398
DMI_MATCH(DMI_PRODUCT_NAME, "20UJ"),
9499
}
95100
},
96101
{
97102
.ident = "P14s Gen1 AMD",
98-
.driver_data = &quirk_s2idle_bug,
103+
.driver_data = &quirk_s2idle_spurious_8042,
99104
.matches = {
100105
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
101106
DMI_MATCH(DMI_PRODUCT_NAME, "20Y1"),
102107
}
103108
},
104109
{
105110
.ident = "P14s Gen2 AMD",
106-
.driver_data = &quirk_s2idle_bug,
111+
.driver_data = &quirk_s2idle_spurious_8042,
107112
.matches = {
108113
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
109114
DMI_MATCH(DMI_PRODUCT_NAME, "21A0"),
110115
}
111116
},
112117
{
113118
.ident = "P14s Gen2 AMD",
114-
.driver_data = &quirk_s2idle_bug,
119+
.driver_data = &quirk_s2idle_spurious_8042,
115120
.matches = {
116121
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
117122
DMI_MATCH(DMI_PRODUCT_NAME, "21A1"),
@@ -152,39 +157,39 @@ static const struct dmi_system_id fwbug_list[] = {
152157
},
153158
{
154159
.ident = "IdeaPad 1 14AMN7",
155-
.driver_data = &quirk_s2idle_bug,
160+
.driver_data = &quirk_s2idle_spurious_8042,
156161
.matches = {
157162
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
158163
DMI_MATCH(DMI_PRODUCT_NAME, "82VF"),
159164
}
160165
},
161166
{
162167
.ident = "IdeaPad 1 15AMN7",
163-
.driver_data = &quirk_s2idle_bug,
168+
.driver_data = &quirk_s2idle_spurious_8042,
164169
.matches = {
165170
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
166171
DMI_MATCH(DMI_PRODUCT_NAME, "82VG"),
167172
}
168173
},
169174
{
170175
.ident = "IdeaPad 1 15AMN7",
171-
.driver_data = &quirk_s2idle_bug,
176+
.driver_data = &quirk_s2idle_spurious_8042,
172177
.matches = {
173178
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
174179
DMI_MATCH(DMI_PRODUCT_NAME, "82X5"),
175180
}
176181
},
177182
{
178183
.ident = "IdeaPad Slim 3 14AMN8",
179-
.driver_data = &quirk_s2idle_bug,
184+
.driver_data = &quirk_s2idle_spurious_8042,
180185
.matches = {
181186
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
182187
DMI_MATCH(DMI_PRODUCT_NAME, "82XN"),
183188
}
184189
},
185190
{
186191
.ident = "IdeaPad Slim 3 15AMN8",
187-
.driver_data = &quirk_s2idle_bug,
192+
.driver_data = &quirk_s2idle_spurious_8042,
188193
.matches = {
189194
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
190195
DMI_MATCH(DMI_PRODUCT_NAME, "82XQ"),
@@ -193,7 +198,7 @@ static const struct dmi_system_id fwbug_list[] = {
193198
/* https://gitlab.freedesktop.org/drm/amd/-/issues/4434 */
194199
{
195200
.ident = "Lenovo Yoga 6 13ALC6",
196-
.driver_data = &quirk_s2idle_bug,
201+
.driver_data = &quirk_s2idle_spurious_8042,
197202
.matches = {
198203
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
199204
DMI_MATCH(DMI_PRODUCT_NAME, "82ND"),
@@ -202,7 +207,7 @@ static const struct dmi_system_id fwbug_list[] = {
202207
/* https://gitlab.freedesktop.org/drm/amd/-/issues/2684 */
203208
{
204209
.ident = "HP Laptop 15s-eq2xxx",
205-
.driver_data = &quirk_s2idle_bug,
210+
.driver_data = &quirk_s2idle_spurious_8042,
206211
.matches = {
207212
DMI_MATCH(DMI_SYS_VENDOR, "HP"),
208213
DMI_MATCH(DMI_PRODUCT_NAME, "HP Laptop 15s-eq2xxx"),
@@ -285,6 +290,16 @@ void amd_pmc_quirks_init(struct amd_pmc_dev *dev)
285290
{
286291
const struct dmi_system_id *dmi_id;
287292

293+
/*
294+
* IRQ1 may cause an interrupt during resume even without a keyboard
295+
* press.
296+
*
297+
* Affects Renoir, Cezanne and Barcelo SoCs
298+
*
299+
* A solution is available in PMFW 64.66.0, but it must be activated by
300+
* SBIOS. If SBIOS is known to have the fix a quirk can be added for
301+
* a given system to avoid workaround.
302+
*/
288303
if (dev->cpu_id == AMD_CPU_ID_CZN)
289304
dev->disable_8042_wakeup = true;
290305

@@ -295,6 +310,5 @@ void amd_pmc_quirks_init(struct amd_pmc_dev *dev)
295310
if (dev->quirks->s2idle_bug_mmio)
296311
pr_info("Using s2idle quirk to avoid %s platform firmware bug\n",
297312
dmi_id->ident);
298-
if (dev->quirks->spurious_8042)
299-
dev->disable_8042_wakeup = true;
313+
dev->disable_8042_wakeup = dev->quirks->spurious_8042;
300314
}

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

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -530,19 +530,6 @@ static int amd_pmc_get_os_hint(struct amd_pmc_dev *dev)
530530
static int amd_pmc_wa_irq1(struct amd_pmc_dev *pdev)
531531
{
532532
struct device *d;
533-
int rc;
534-
535-
/* cezanne platform firmware has a fix in 64.66.0 */
536-
if (pdev->cpu_id == AMD_CPU_ID_CZN) {
537-
if (!pdev->major) {
538-
rc = amd_pmc_get_smu_version(pdev);
539-
if (rc)
540-
return rc;
541-
}
542-
543-
if (pdev->major > 64 || (pdev->major == 64 && pdev->minor > 65))
544-
return 0;
545-
}
546533

547534
d = bus_find_device_by_name(&serio_bus, NULL, "serio0");
548535
if (!d)

drivers/platform/x86/dell/dell-smbios-base.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ struct token_sysfs_data {
3939
struct smbios_device {
4040
struct list_head list;
4141
struct device *device;
42+
int priority;
4243
int (*call_fn)(struct calling_interface_buffer *arg);
4344
};
4445

@@ -145,7 +146,7 @@ int dell_smbios_error(int value)
145146
}
146147
EXPORT_SYMBOL_GPL(dell_smbios_error);
147148

148-
int dell_smbios_register_device(struct device *d, void *call_fn)
149+
int dell_smbios_register_device(struct device *d, int priority, void *call_fn)
149150
{
150151
struct smbios_device *priv;
151152

@@ -154,6 +155,7 @@ int dell_smbios_register_device(struct device *d, void *call_fn)
154155
return -ENOMEM;
155156
get_device(d);
156157
priv->device = d;
158+
priv->priority = priority;
157159
priv->call_fn = call_fn;
158160
mutex_lock(&smbios_mutex);
159161
list_add_tail(&priv->list, &smbios_device_list);
@@ -292,28 +294,25 @@ EXPORT_SYMBOL_GPL(dell_smbios_call_filter);
292294

293295
int dell_smbios_call(struct calling_interface_buffer *buffer)
294296
{
295-
int (*call_fn)(struct calling_interface_buffer *) = NULL;
296-
struct device *selected_dev = NULL;
297+
struct smbios_device *selected = NULL;
297298
struct smbios_device *priv;
298299
int ret;
299300

300301
mutex_lock(&smbios_mutex);
301302
list_for_each_entry(priv, &smbios_device_list, list) {
302-
if (!selected_dev || priv->device->id >= selected_dev->id) {
303-
dev_dbg(priv->device, "Trying device ID: %d\n",
304-
priv->device->id);
305-
call_fn = priv->call_fn;
306-
selected_dev = priv->device;
303+
if (!selected || priv->priority >= selected->priority) {
304+
dev_dbg(priv->device, "Trying device ID: %d\n", priv->priority);
305+
selected = priv;
307306
}
308307
}
309308

310-
if (!selected_dev) {
309+
if (!selected) {
311310
ret = -ENODEV;
312311
pr_err("No dell-smbios drivers are loaded\n");
313312
goto out_smbios_call;
314313
}
315314

316-
ret = call_fn(buffer);
315+
ret = selected->call_fn(buffer);
317316

318317
out_smbios_call:
319318
mutex_unlock(&smbios_mutex);

drivers/platform/x86/dell/dell-smbios-smm.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@ int init_dell_smbios_smm(void)
125125
if (ret)
126126
goto fail_platform_device_add;
127127

128-
ret = dell_smbios_register_device(&platform_device->dev,
129-
&dell_smbios_smm_call);
128+
ret = dell_smbios_register_device(&platform_device->dev, 0, &dell_smbios_smm_call);
130129
if (ret)
131130
goto fail_register;
132131

drivers/platform/x86/dell/dell-smbios-wmi.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,7 @@ static int dell_smbios_wmi_probe(struct wmi_device *wdev, const void *context)
264264
if (ret)
265265
return ret;
266266

267-
/* ID is used by dell-smbios to set priority of drivers */
268-
wdev->dev.id = 1;
269-
ret = dell_smbios_register_device(&wdev->dev, &dell_smbios_wmi_call);
267+
ret = dell_smbios_register_device(&wdev->dev, 1, &dell_smbios_wmi_call);
270268
if (ret)
271269
return ret;
272270

drivers/platform/x86/dell/dell-smbios.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct calling_interface_structure {
6464
struct calling_interface_token tokens[];
6565
} __packed;
6666

67-
int dell_smbios_register_device(struct device *d, void *call_fn);
67+
int dell_smbios_register_device(struct device *d, int priority, void *call_fn);
6868
void dell_smbios_unregister_device(struct device *d);
6969

7070
int dell_smbios_error(int value);

drivers/platform/x86/hp/hp-wmi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ static const char * const victus_thermal_profile_boards[] = {
9292
"8A25"
9393
};
9494

95-
/* DMI Board names of Victus 16-s1000 laptops */
95+
/* DMI Board names of Victus 16-r1000 and Victus 16-s1000 laptops */
9696
static const char * const victus_s_thermal_profile_boards[] = {
97-
"8C9C"
97+
"8C99", "8C9C"
9898
};
9999

100100
enum hp_wmi_radio {

drivers/platform/x86/intel/uncore-frequency/uncore-frequency-tpmi.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,14 @@ static int uncore_read_control_freq(struct uncore_data *data, unsigned int *valu
192192
static int write_eff_lat_ctrl(struct uncore_data *data, unsigned int val, enum uncore_index index)
193193
{
194194
struct tpmi_uncore_cluster_info *cluster_info;
195+
struct tpmi_uncore_struct *uncore_root;
195196
u64 control;
196197

197198
cluster_info = container_of(data, struct tpmi_uncore_cluster_info, uncore_data);
199+
uncore_root = cluster_info->uncore_root;
200+
201+
if (uncore_root->write_blocked)
202+
return -EPERM;
198203

199204
if (cluster_info->root_domain)
200205
return -ENODATA;

0 commit comments

Comments
 (0)