Commit ecea3ba2 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'platform-drivers-x86-v6.4-3' of...

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
parents 5566051f 3279decb
...@@ -1348,9 +1348,8 @@ static int mlxbf_pmc_map_counters(struct device *dev) ...@@ -1348,9 +1348,8 @@ static int mlxbf_pmc_map_counters(struct device *dev)
for (i = 0; i < pmc->total_blocks; ++i) { for (i = 0; i < pmc->total_blocks; ++i) {
if (strstr(pmc->block_name[i], "tile")) { if (strstr(pmc->block_name[i], "tile")) {
ret = sscanf(pmc->block_name[i], "tile%d", &tile_num); if (sscanf(pmc->block_name[i], "tile%d", &tile_num) != 1)
if (ret < 0) return -EINVAL;
return ret;
if (tile_num >= pmc->tile_count) if (tile_num >= pmc->tile_count)
continue; continue;
......
...@@ -245,24 +245,29 @@ static const struct pci_device_id pmf_pci_ids[] = { ...@@ -245,24 +245,29 @@ static const struct pci_device_id pmf_pci_ids[] = {
{ } { }
}; };
int amd_pmf_init_metrics_table(struct amd_pmf_dev *dev) static void amd_pmf_set_dram_addr(struct amd_pmf_dev *dev)
{ {
u64 phys_addr; u64 phys_addr;
u32 hi, low; u32 hi, low;
INIT_DELAYED_WORK(&dev->work_buffer, amd_pmf_get_metrics); phys_addr = virt_to_phys(dev->buf);
hi = phys_addr >> 32;
low = phys_addr & GENMASK(31, 0);
amd_pmf_send_cmd(dev, SET_DRAM_ADDR_HIGH, 0, hi, NULL);
amd_pmf_send_cmd(dev, SET_DRAM_ADDR_LOW, 0, low, NULL);
}
int amd_pmf_init_metrics_table(struct amd_pmf_dev *dev)
{
/* Get Metrics Table Address */ /* Get Metrics Table Address */
dev->buf = kzalloc(sizeof(dev->m_table), GFP_KERNEL); dev->buf = kzalloc(sizeof(dev->m_table), GFP_KERNEL);
if (!dev->buf) if (!dev->buf)
return -ENOMEM; return -ENOMEM;
phys_addr = virt_to_phys(dev->buf); INIT_DELAYED_WORK(&dev->work_buffer, amd_pmf_get_metrics);
hi = phys_addr >> 32;
low = phys_addr & GENMASK(31, 0);
amd_pmf_send_cmd(dev, SET_DRAM_ADDR_HIGH, 0, hi, NULL); amd_pmf_set_dram_addr(dev);
amd_pmf_send_cmd(dev, SET_DRAM_ADDR_LOW, 0, low, NULL);
/* /*
* Start collecting the metrics data after a small delay * Start collecting the metrics data after a small delay
...@@ -273,6 +278,18 @@ int amd_pmf_init_metrics_table(struct amd_pmf_dev *dev) ...@@ -273,6 +278,18 @@ int amd_pmf_init_metrics_table(struct amd_pmf_dev *dev)
return 0; return 0;
} }
static int amd_pmf_resume_handler(struct device *dev)
{
struct amd_pmf_dev *pdev = dev_get_drvdata(dev);
if (pdev->buf)
amd_pmf_set_dram_addr(pdev);
return 0;
}
static DEFINE_SIMPLE_DEV_PM_OPS(amd_pmf_pm, NULL, amd_pmf_resume_handler);
static void amd_pmf_init_features(struct amd_pmf_dev *dev) static void amd_pmf_init_features(struct amd_pmf_dev *dev)
{ {
int ret; int ret;
...@@ -413,6 +430,7 @@ static struct platform_driver amd_pmf_driver = { ...@@ -413,6 +430,7 @@ static struct platform_driver amd_pmf_driver = {
.name = "amd-pmf", .name = "amd-pmf",
.acpi_match_table = amd_pmf_acpi_ids, .acpi_match_table = amd_pmf_acpi_ids,
.dev_groups = amd_pmf_driver_groups, .dev_groups = amd_pmf_driver_groups,
.pm = pm_sleep_ptr(&amd_pmf_pm),
}, },
.probe = amd_pmf_probe, .probe = amd_pmf_probe,
.remove_new = amd_pmf_remove, .remove_new = amd_pmf_remove,
......
...@@ -555,6 +555,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = { ...@@ -555,6 +555,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x71, { KEY_F13 } }, /* General-purpose button */ { KE_KEY, 0x71, { KEY_F13 } }, /* General-purpose button */
{ KE_IGNORE, 0x79, }, /* Charger type dectection notification */ { KE_IGNORE, 0x79, }, /* Charger type dectection notification */
{ KE_KEY, 0x7a, { KEY_ALS_TOGGLE } }, /* Ambient Light Sensor Toggle */ { KE_KEY, 0x7a, { KEY_ALS_TOGGLE } }, /* Ambient Light Sensor Toggle */
{ KE_IGNORE, 0x7B, }, /* Charger connect/disconnect notification */
{ KE_KEY, 0x7c, { KEY_MICMUTE } }, { KE_KEY, 0x7c, { KEY_MICMUTE } },
{ KE_KEY, 0x7D, { KEY_BLUETOOTH } }, /* Bluetooth Enable */ { KE_KEY, 0x7D, { KEY_BLUETOOTH } }, /* Bluetooth Enable */
{ KE_KEY, 0x7E, { KEY_BLUETOOTH } }, /* Bluetooth Disable */ { KE_KEY, 0x7E, { KEY_BLUETOOTH } }, /* Bluetooth Disable */
...@@ -584,6 +585,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = { ...@@ -584,6 +585,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0xAE, { KEY_FN_F5 } }, /* Fn+F5 fan mode on 2020+ */ { KE_KEY, 0xAE, { KEY_FN_F5 } }, /* Fn+F5 fan mode on 2020+ */
{ KE_KEY, 0xB3, { KEY_PROG4 } }, /* AURA */ { KE_KEY, 0xB3, { KEY_PROG4 } }, /* AURA */
{ KE_KEY, 0xB5, { KEY_CALC } }, { KE_KEY, 0xB5, { KEY_CALC } },
{ KE_IGNORE, 0xC0, }, /* External display connect/disconnect notification */
{ KE_KEY, 0xC4, { KEY_KBDILLUMUP } }, { KE_KEY, 0xC4, { KEY_KBDILLUMUP } },
{ KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } }, { KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } },
{ KE_IGNORE, 0xC6, }, /* Ambient Light Sensor notification */ { KE_IGNORE, 0xC6, }, /* Ambient Light Sensor notification */
......
...@@ -208,7 +208,7 @@ static int scan_chunks_sanity_check(struct device *dev) ...@@ -208,7 +208,7 @@ static int scan_chunks_sanity_check(struct device *dev)
continue; continue;
reinit_completion(&ifs_done); reinit_completion(&ifs_done);
local_work.dev = dev; local_work.dev = dev;
INIT_WORK(&local_work.w, copy_hashes_authenticate_chunks); INIT_WORK_ONSTACK(&local_work.w, copy_hashes_authenticate_chunks);
schedule_work_on(cpu, &local_work.w); schedule_work_on(cpu, &local_work.w);
wait_for_completion(&ifs_done); wait_for_completion(&ifs_done);
if (ifsd->loading_error) { if (ifsd->loading_error) {
......
...@@ -304,14 +304,13 @@ struct isst_if_pkg_info { ...@@ -304,14 +304,13 @@ struct isst_if_pkg_info {
static struct isst_if_cpu_info *isst_cpu_info; static struct isst_if_cpu_info *isst_cpu_info;
static struct isst_if_pkg_info *isst_pkg_info; static struct isst_if_pkg_info *isst_pkg_info;
#define ISST_MAX_PCI_DOMAINS 8
static struct pci_dev *_isst_if_get_pci_dev(int cpu, int bus_no, int dev, int fn) static struct pci_dev *_isst_if_get_pci_dev(int cpu, int bus_no, int dev, int fn)
{ {
struct pci_dev *matched_pci_dev = NULL; struct pci_dev *matched_pci_dev = NULL;
struct pci_dev *pci_dev = NULL; struct pci_dev *pci_dev = NULL;
struct pci_dev *_pci_dev = NULL;
int no_matches = 0, pkg_id; int no_matches = 0, pkg_id;
int i, bus_number; int bus_number;
if (bus_no < 0 || bus_no >= ISST_MAX_BUS_NUMBER || cpu < 0 || if (bus_no < 0 || bus_no >= ISST_MAX_BUS_NUMBER || cpu < 0 ||
cpu >= nr_cpu_ids || cpu >= num_possible_cpus()) 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 ...@@ -323,12 +322,11 @@ static struct pci_dev *_isst_if_get_pci_dev(int cpu, int bus_no, int dev, int fn
if (bus_number < 0) if (bus_number < 0)
return NULL; return NULL;
for (i = 0; i < ISST_MAX_PCI_DOMAINS; ++i) { for_each_pci_dev(_pci_dev) {
struct pci_dev *_pci_dev;
int node; int node;
_pci_dev = pci_get_domain_bus_and_slot(i, bus_number, PCI_DEVFN(dev, fn)); if (_pci_dev->bus->number != bus_number ||
if (!_pci_dev) _pci_dev->devfn != PCI_DEVFN(dev, fn))
continue; continue;
++no_matches; ++no_matches;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment