platform/x86: ISST: Fix optimization with use of numa

commit d36d4a1d75 upstream.

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().

Intel-SIG: commit d36d4a1d75 platform/x86: ISST: Fix optimization with use of numa.
Backport for ISST driver fix

Fixes: aa2ddd2425 ("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>
[ yingbao jia: amend commit log ]
Signed-off-by: yingbao jia <yingbao.jia@intel.com>
This commit is contained in:
Srinivas Pandruvada 2021-07-27 09:50:52 -07:00 committed by Jianping Liu
parent 8b5564262c
commit ba27efc588
1 changed files with 2 additions and 1 deletions

View File

@ -394,6 +394,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 */
@ -412,7 +414,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);