Skip to content

Commit ecea3ba

Browse files
committed
Merge tag 'platform-drivers-x86-v6.4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
Pull x86 platform driver fixes from Hans de Goede: "Nothing special to report just a few small fixes" * tag 'platform-drivers-x86-v6.4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86/intel/ifs: Annotate work queue on stack so object debug does not complain platform/x86: ISST: Remove 8 socket limit platform/mellanox: mlxbf-pmc: fix sscanf() error checking platform/x86/amd/pmf: Fix CnQF and auto-mode after resume platform/x86: asus-wmi: Ignore WMI events with codes 0x7B, 0xC0
2 parents 5566051 + 3279dec commit ecea3ba

File tree

5 files changed

+35
-18
lines changed

5 files changed

+35
-18
lines changed

drivers/platform/mellanox/mlxbf-pmc.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,9 +1348,8 @@ static int mlxbf_pmc_map_counters(struct device *dev)
13481348

13491349
for (i = 0; i < pmc->total_blocks; ++i) {
13501350
if (strstr(pmc->block_name[i], "tile")) {
1351-
ret = sscanf(pmc->block_name[i], "tile%d", &tile_num);
1352-
if (ret < 0)
1353-
return ret;
1351+
if (sscanf(pmc->block_name[i], "tile%d", &tile_num) != 1)
1352+
return -EINVAL;
13541353

13551354
if (tile_num >= pmc->tile_count)
13561355
continue;

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

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,24 +245,29 @@ static const struct pci_device_id pmf_pci_ids[] = {
245245
{ }
246246
};
247247

248-
int amd_pmf_init_metrics_table(struct amd_pmf_dev *dev)
248+
static void amd_pmf_set_dram_addr(struct amd_pmf_dev *dev)
249249
{
250250
u64 phys_addr;
251251
u32 hi, low;
252252

253-
INIT_DELAYED_WORK(&dev->work_buffer, amd_pmf_get_metrics);
253+
phys_addr = virt_to_phys(dev->buf);
254+
hi = phys_addr >> 32;
255+
low = phys_addr & GENMASK(31, 0);
256+
257+
amd_pmf_send_cmd(dev, SET_DRAM_ADDR_HIGH, 0, hi, NULL);
258+
amd_pmf_send_cmd(dev, SET_DRAM_ADDR_LOW, 0, low, NULL);
259+
}
254260

261+
int amd_pmf_init_metrics_table(struct amd_pmf_dev *dev)
262+
{
255263
/* Get Metrics Table Address */
256264
dev->buf = kzalloc(sizeof(dev->m_table), GFP_KERNEL);
257265
if (!dev->buf)
258266
return -ENOMEM;
259267

260-
phys_addr = virt_to_phys(dev->buf);
261-
hi = phys_addr >> 32;
262-
low = phys_addr & GENMASK(31, 0);
268+
INIT_DELAYED_WORK(&dev->work_buffer, amd_pmf_get_metrics);
263269

264-
amd_pmf_send_cmd(dev, SET_DRAM_ADDR_HIGH, 0, hi, NULL);
265-
amd_pmf_send_cmd(dev, SET_DRAM_ADDR_LOW, 0, low, NULL);
270+
amd_pmf_set_dram_addr(dev);
266271

267272
/*
268273
* Start collecting the metrics data after a small delay
@@ -273,6 +278,18 @@ int amd_pmf_init_metrics_table(struct amd_pmf_dev *dev)
273278
return 0;
274279
}
275280

281+
static int amd_pmf_resume_handler(struct device *dev)
282+
{
283+
struct amd_pmf_dev *pdev = dev_get_drvdata(dev);
284+
285+
if (pdev->buf)
286+
amd_pmf_set_dram_addr(pdev);
287+
288+
return 0;
289+
}
290+
291+
static DEFINE_SIMPLE_DEV_PM_OPS(amd_pmf_pm, NULL, amd_pmf_resume_handler);
292+
276293
static void amd_pmf_init_features(struct amd_pmf_dev *dev)
277294
{
278295
int ret;
@@ -413,6 +430,7 @@ static struct platform_driver amd_pmf_driver = {
413430
.name = "amd-pmf",
414431
.acpi_match_table = amd_pmf_acpi_ids,
415432
.dev_groups = amd_pmf_driver_groups,
433+
.pm = pm_sleep_ptr(&amd_pmf_pm),
416434
},
417435
.probe = amd_pmf_probe,
418436
.remove_new = amd_pmf_remove,

drivers/platform/x86/asus-nb-wmi.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
555555
{ KE_KEY, 0x71, { KEY_F13 } }, /* General-purpose button */
556556
{ KE_IGNORE, 0x79, }, /* Charger type dectection notification */
557557
{ KE_KEY, 0x7a, { KEY_ALS_TOGGLE } }, /* Ambient Light Sensor Toggle */
558+
{ KE_IGNORE, 0x7B, }, /* Charger connect/disconnect notification */
558559
{ KE_KEY, 0x7c, { KEY_MICMUTE } },
559560
{ KE_KEY, 0x7D, { KEY_BLUETOOTH } }, /* Bluetooth Enable */
560561
{ KE_KEY, 0x7E, { KEY_BLUETOOTH } }, /* Bluetooth Disable */
@@ -584,6 +585,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
584585
{ KE_KEY, 0xAE, { KEY_FN_F5 } }, /* Fn+F5 fan mode on 2020+ */
585586
{ KE_KEY, 0xB3, { KEY_PROG4 } }, /* AURA */
586587
{ KE_KEY, 0xB5, { KEY_CALC } },
588+
{ KE_IGNORE, 0xC0, }, /* External display connect/disconnect notification */
587589
{ KE_KEY, 0xC4, { KEY_KBDILLUMUP } },
588590
{ KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } },
589591
{ KE_IGNORE, 0xC6, }, /* Ambient Light Sensor notification */

drivers/platform/x86/intel/ifs/load.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ static int scan_chunks_sanity_check(struct device *dev)
208208
continue;
209209
reinit_completion(&ifs_done);
210210
local_work.dev = dev;
211-
INIT_WORK(&local_work.w, copy_hashes_authenticate_chunks);
211+
INIT_WORK_ONSTACK(&local_work.w, copy_hashes_authenticate_chunks);
212212
schedule_work_on(cpu, &local_work.w);
213213
wait_for_completion(&ifs_done);
214214
if (ifsd->loading_error) {

drivers/platform/x86/intel/speed_select_if/isst_if_common.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -304,14 +304,13 @@ struct isst_if_pkg_info {
304304
static struct isst_if_cpu_info *isst_cpu_info;
305305
static struct isst_if_pkg_info *isst_pkg_info;
306306

307-
#define ISST_MAX_PCI_DOMAINS 8
308-
309307
static struct pci_dev *_isst_if_get_pci_dev(int cpu, int bus_no, int dev, int fn)
310308
{
311309
struct pci_dev *matched_pci_dev = NULL;
312310
struct pci_dev *pci_dev = NULL;
311+
struct pci_dev *_pci_dev = NULL;
313312
int no_matches = 0, pkg_id;
314-
int i, bus_number;
313+
int bus_number;
315314

316315
if (bus_no < 0 || bus_no >= ISST_MAX_BUS_NUMBER || cpu < 0 ||
317316
cpu >= nr_cpu_ids || cpu >= num_possible_cpus())
@@ -323,12 +322,11 @@ static struct pci_dev *_isst_if_get_pci_dev(int cpu, int bus_no, int dev, int fn
323322
if (bus_number < 0)
324323
return NULL;
325324

326-
for (i = 0; i < ISST_MAX_PCI_DOMAINS; ++i) {
327-
struct pci_dev *_pci_dev;
325+
for_each_pci_dev(_pci_dev) {
328326
int node;
329327

330-
_pci_dev = pci_get_domain_bus_and_slot(i, bus_number, PCI_DEVFN(dev, fn));
331-
if (!_pci_dev)
328+
if (_pci_dev->bus->number != bus_number ||
329+
_pci_dev->devfn != PCI_DEVFN(dev, fn))
332330
continue;
333331

334332
++no_matches;

0 commit comments

Comments
 (0)