Skip to content

Commit

Permalink
platform/x86: ISST: Fix optimization with use of numa
Browse files Browse the repository at this point in the history
[ Upstream commit d36d4a1 ]

When numa is used to map CPU to PCI device, the optimized path to read
from cached data is not working and still calls _isst_if_get_pci_dev().

The reason is that when caching the mapping, numa information is not
available as it is read later. So move the assignment of
isst_cpu_info[cpu].numa_node before calling _isst_if_get_pci_dev().

Fixes: aa2ddd2 ("platform/x86: ISST: Use numa node id for cpu pci dev mapping")
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://lore.kernel.org/r/20210727165052.427238-1-srinivas.pandruvada@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
spandruvada authored and gregkh committed Sep 18, 2021
1 parent 983add4 commit f989596
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/platform/x86/intel_speed_select_if/isst_if_common.c
Expand Up @@ -379,6 +379,8 @@ static int isst_if_cpu_online(unsigned int cpu)
u64 data;
int ret;

isst_cpu_info[cpu].numa_node = cpu_to_node(cpu);

ret = rdmsrl_safe(MSR_CPU_BUS_NUMBER, &data);
if (ret) {
/* This is not a fatal error on MSR mailbox only I/F */
Expand All @@ -397,7 +399,6 @@ static int isst_if_cpu_online(unsigned int cpu)
return ret;
}
isst_cpu_info[cpu].punit_cpu_id = data;
isst_cpu_info[cpu].numa_node = cpu_to_node(cpu);

isst_restore_msr_local(cpu);

Expand Down

0 comments on commit f989596

Please sign in to comment.