Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

platform/x86: ISST: Remove 8 socket limit

Stop restricting the PCI search to a range of PCI domains fed to
pci_get_domain_bus_and_slot(). Instead, use for_each_pci_dev() and
look at all PCI domains in one pass.

On systems with more than 8 sockets, this avoids error messages like
"Information: Invalid level, Can't get TDP control information at
specified levels on cpu 480" from the intel speed select utility.

Fixes: aa2ddd242572 ("platform/x86: ISST: Use numa node id for cpu pci dev mapping")
Signed-off-by: Steve Wahl <steve.wahl@hpe.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230519160420.2588475-1-steve.wahl@hpe.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>

authored by

Steve Wahl and committed by
Hans de Goede
bbb320bf 95e4b251

+5 -7
+5 -7
drivers/platform/x86/intel/speed_select_if/isst_if_common.c
··· 304 304 static struct isst_if_cpu_info *isst_cpu_info; 305 305 static struct isst_if_pkg_info *isst_pkg_info; 306 306 307 - #define ISST_MAX_PCI_DOMAINS 8 308 - 309 307 static struct pci_dev *_isst_if_get_pci_dev(int cpu, int bus_no, int dev, int fn) 310 308 { 311 309 struct pci_dev *matched_pci_dev = NULL; 312 310 struct pci_dev *pci_dev = NULL; 311 + struct pci_dev *_pci_dev = NULL; 313 312 int no_matches = 0, pkg_id; 314 - int i, bus_number; 313 + int bus_number; 315 314 316 315 if (bus_no < 0 || bus_no >= ISST_MAX_BUS_NUMBER || cpu < 0 || 317 316 cpu >= nr_cpu_ids || cpu >= num_possible_cpus()) ··· 322 323 if (bus_number < 0) 323 324 return NULL; 324 325 325 - for (i = 0; i < ISST_MAX_PCI_DOMAINS; ++i) { 326 - struct pci_dev *_pci_dev; 326 + for_each_pci_dev(_pci_dev) { 327 327 int node; 328 328 329 - _pci_dev = pci_get_domain_bus_and_slot(i, bus_number, PCI_DEVFN(dev, fn)); 330 - if (!_pci_dev) 329 + if (_pci_dev->bus->number != bus_number || 330 + _pci_dev->devfn != PCI_DEVFN(dev, fn)) 331 331 continue; 332 332 333 333 ++no_matches;