Skip to content

Commit bbb320b

Browse files
swahlhpejwrdegoede
authored andcommitted
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: aa2ddd2 ("platform/x86: ISST: Use numa node id for cpu pci dev mapping") Signed-off-by: Steve Wahl <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
1 parent 95e4b25 commit bbb320b

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

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)