Skip to content

Commit 9979528

Browse files
committed
Merge tag 'platform-drivers-x86-v5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
Pull x86 platform driver fixes from Hans de Goede: "Highlights: - Fix hp-wmi regression on HP Omen laptops introduced in 5.18 - Several hardware-id additions - A couple of other tiny fixes" * tag 'platform-drivers-x86-v5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86/intel: hid: Add Surface Go to VGBS allow list platform/x86: hp-wmi: Use zero insize parameter only when supported platform/x86: hp-wmi: Resolve WMI query failures on some devices platform/x86: gigabyte-wmi: Add support for B450M DS3H-CF platform/x86: gigabyte-wmi: Add Z690M AORUS ELITE AX DDR4 support platform/x86: barco-p50-gpio: Add check for platform_driver_register platform/x86/intel: pmc: Support Intel Raptorlake P platform/x86/intel: Fix pmt_crashlog array reference platform/mellanox: Add static in struct declaration. platform/mellanox: Spelling s/platfom/platform/
2 parents b0cb8db + d4fe9cc commit 9979528

File tree

8 files changed

+35
-14
lines changed

8 files changed

+35
-14
lines changed

drivers/platform/mellanox/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ config NVSW_SN2201
8585
depends on I2C
8686
depends on REGMAP_I2C
8787
help
88-
This driver provides support for the Nvidia SN2201 platfom.
88+
This driver provides support for the Nvidia SN2201 platform.
8989
The SN2201 is a highly integrated for one rack unit system with
9090
L3 management switches. It has 48 x 1Gbps RJ45 + 4 x 100G QSFP28
9191
ports in a compact 1RU form factor. The system also including a

drivers/platform/mellanox/nvsw-sn2201.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ static struct resource nvsw_sn2201_lpc_res[] = {
326326
};
327327

328328
/* SN2201 I2C platform data. */
329-
struct mlxreg_core_hotplug_platform_data nvsw_sn2201_i2c_data = {
329+
static struct mlxreg_core_hotplug_platform_data nvsw_sn2201_i2c_data = {
330330
.irq = NVSW_SN2201_CPLD_SYSIRQ,
331331
};
332332

drivers/platform/x86/barco-p50-gpio.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,14 @@ MODULE_DEVICE_TABLE(dmi, dmi_ids);
405405
static int __init p50_module_init(void)
406406
{
407407
struct resource res = DEFINE_RES_IO(P50_GPIO_IO_PORT_BASE, P50_PORT_CMD + 1);
408+
int ret;
408409

409410
if (!dmi_first_match(dmi_ids))
410411
return -ENODEV;
411412

412-
platform_driver_register(&p50_gpio_driver);
413+
ret = platform_driver_register(&p50_gpio_driver);
414+
if (ret)
415+
return ret;
413416

414417
gpio_pdev = platform_device_register_simple(DRIVER_NAME, PLATFORM_DEVID_NONE, &res, 1);
415418
if (IS_ERR(gpio_pdev)) {

drivers/platform/x86/gigabyte-wmi.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ static u8 gigabyte_wmi_detect_sensor_usability(struct wmi_device *wdev)
140140
}}
141141

142142
static const struct dmi_system_id gigabyte_wmi_known_working_platforms[] = {
143+
DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B450M DS3H-CF"),
143144
DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B450M S2H V2"),
144145
DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B550 AORUS ELITE AX V2"),
145146
DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B550 AORUS ELITE"),
@@ -156,6 +157,7 @@ static const struct dmi_system_id gigabyte_wmi_known_working_platforms[] = {
156157
DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("X570 GAMING X"),
157158
DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("X570 I AORUS PRO WIFI"),
158159
DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("X570 UD"),
160+
DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("Z690M AORUS ELITE AX DDR4"),
159161
{ }
160162
};
161163

drivers/platform/x86/hp-wmi.c

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ MODULE_ALIAS("wmi:5FB7F034-2C63-45e9-BE91-3D44E2C707E4");
3838
#define HPWMI_EVENT_GUID "95F24279-4D7B-4334-9387-ACCDC67EF61C"
3939
#define HPWMI_BIOS_GUID "5FB7F034-2C63-45e9-BE91-3D44E2C707E4"
4040
#define HP_OMEN_EC_THERMAL_PROFILE_OFFSET 0x95
41+
#define zero_if_sup(tmp) (zero_insize_support?0:sizeof(tmp)) // use when zero insize is required
4142

4243
/* DMI board names of devices that should use the omen specific path for
4344
* thermal profiles.
@@ -220,6 +221,7 @@ static struct input_dev *hp_wmi_input_dev;
220221
static struct platform_device *hp_wmi_platform_dev;
221222
static struct platform_profile_handler platform_profile_handler;
222223
static bool platform_profile_support;
224+
static bool zero_insize_support;
223225

224226
static struct rfkill *wifi_rfkill;
225227
static struct rfkill *bluetooth_rfkill;
@@ -290,14 +292,16 @@ static int hp_wmi_perform_query(int query, enum hp_wmi_command command,
290292
struct bios_return *bios_return;
291293
union acpi_object *obj = NULL;
292294
struct bios_args *args = NULL;
293-
int mid, actual_outsize, ret;
295+
int mid, actual_insize, actual_outsize;
294296
size_t bios_args_size;
297+
int ret;
295298

296299
mid = encode_outsize_for_pvsz(outsize);
297300
if (WARN_ON(mid < 0))
298301
return mid;
299302

300-
bios_args_size = struct_size(args, data, insize);
303+
actual_insize = max(insize, 128);
304+
bios_args_size = struct_size(args, data, actual_insize);
301305
args = kmalloc(bios_args_size, GFP_KERNEL);
302306
if (!args)
303307
return -ENOMEM;
@@ -374,7 +378,7 @@ static int hp_wmi_read_int(int query)
374378
int val = 0, ret;
375379

376380
ret = hp_wmi_perform_query(query, HPWMI_READ, &val,
377-
0, sizeof(val));
381+
zero_if_sup(val), sizeof(val));
378382

379383
if (ret)
380384
return ret < 0 ? ret : -EINVAL;
@@ -410,7 +414,8 @@ static int hp_wmi_get_tablet_mode(void)
410414
return -ENODEV;
411415

412416
ret = hp_wmi_perform_query(HPWMI_SYSTEM_DEVICE_MODE, HPWMI_READ,
413-
system_device_mode, 0, sizeof(system_device_mode));
417+
system_device_mode, zero_if_sup(system_device_mode),
418+
sizeof(system_device_mode));
414419
if (ret < 0)
415420
return ret;
416421

@@ -497,7 +502,7 @@ static int hp_wmi_fan_speed_max_get(void)
497502
int val = 0, ret;
498503

499504
ret = hp_wmi_perform_query(HPWMI_FAN_SPEED_MAX_GET_QUERY, HPWMI_GM,
500-
&val, 0, sizeof(val));
505+
&val, zero_if_sup(val), sizeof(val));
501506

502507
if (ret)
503508
return ret < 0 ? ret : -EINVAL;
@@ -509,7 +514,7 @@ static int __init hp_wmi_bios_2008_later(void)
509514
{
510515
int state = 0;
511516
int ret = hp_wmi_perform_query(HPWMI_FEATURE_QUERY, HPWMI_READ, &state,
512-
0, sizeof(state));
517+
zero_if_sup(state), sizeof(state));
513518
if (!ret)
514519
return 1;
515520

@@ -520,7 +525,7 @@ static int __init hp_wmi_bios_2009_later(void)
520525
{
521526
u8 state[128];
522527
int ret = hp_wmi_perform_query(HPWMI_FEATURE2_QUERY, HPWMI_READ, &state,
523-
0, sizeof(state));
528+
zero_if_sup(state), sizeof(state));
524529
if (!ret)
525530
return 1;
526531

@@ -598,7 +603,7 @@ static int hp_wmi_rfkill2_refresh(void)
598603
int err, i;
599604

600605
err = hp_wmi_perform_query(HPWMI_WIRELESS2_QUERY, HPWMI_READ, &state,
601-
0, sizeof(state));
606+
zero_if_sup(state), sizeof(state));
602607
if (err)
603608
return err;
604609

@@ -1007,7 +1012,7 @@ static int __init hp_wmi_rfkill2_setup(struct platform_device *device)
10071012
int err, i;
10081013

10091014
err = hp_wmi_perform_query(HPWMI_WIRELESS2_QUERY, HPWMI_READ, &state,
1010-
0, sizeof(state));
1015+
zero_if_sup(state), sizeof(state));
10111016
if (err)
10121017
return err < 0 ? err : -EINVAL;
10131018

@@ -1483,11 +1488,15 @@ static int __init hp_wmi_init(void)
14831488
{
14841489
int event_capable = wmi_has_guid(HPWMI_EVENT_GUID);
14851490
int bios_capable = wmi_has_guid(HPWMI_BIOS_GUID);
1486-
int err;
1491+
int err, tmp = 0;
14871492

14881493
if (!bios_capable && !event_capable)
14891494
return -ENODEV;
14901495

1496+
if (hp_wmi_perform_query(HPWMI_HARDWARE_QUERY, HPWMI_READ, &tmp,
1497+
sizeof(tmp), sizeof(tmp)) == HPWMI_RET_INVALID_PARAMETERS)
1498+
zero_insize_support = true;
1499+
14911500
if (event_capable) {
14921501
err = hp_wmi_input_setup();
14931502
if (err)

drivers/platform/x86/intel/hid.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@ static const struct dmi_system_id dmi_vgbs_allow_list[] = {
122122
DMI_MATCH(DMI_PRODUCT_NAME, "HP Spectre x360 Convertible 15-df0xxx"),
123123
},
124124
},
125+
{
126+
.matches = {
127+
DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
128+
DMI_MATCH(DMI_PRODUCT_NAME, "Surface Go"),
129+
},
130+
},
125131
{ }
126132
};
127133

drivers/platform/x86/intel/pmc/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1912,6 +1912,7 @@ static const struct x86_cpu_id intel_pmc_core_ids[] = {
19121912
X86_MATCH_INTEL_FAM6_MODEL(ROCKETLAKE, &tgl_reg_map),
19131913
X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE_L, &tgl_reg_map),
19141914
X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE, &adl_reg_map),
1915+
X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE_P, &tgl_reg_map),
19151916
{}
19161917
};
19171918

drivers/platform/x86/intel/pmt/crashlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ static int pmt_crashlog_probe(struct auxiliary_device *auxdev,
282282
auxiliary_set_drvdata(auxdev, priv);
283283

284284
for (i = 0; i < intel_vsec_dev->num_resources; i++) {
285-
struct intel_pmt_entry *entry = &priv->entry[i].entry;
285+
struct intel_pmt_entry *entry = &priv->entry[priv->num_entries].entry;
286286

287287
ret = intel_pmt_dev_create(entry, &pmt_crashlog_ns, intel_vsec_dev, i);
288288
if (ret < 0)

0 commit comments

Comments
 (0)