From nobody Sun Feb 8 20:34:59 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AA83C7EE26 for ; Fri, 19 May 2023 16:04:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229500AbjESQEk (ORCPT ); Fri, 19 May 2023 12:04:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbjESQEi (ORCPT ); Fri, 19 May 2023 12:04:38 -0400 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C449E9E; Fri, 19 May 2023 09:04:35 -0700 (PDT) Received: from pps.filterd (m0150244.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34JFRAio015891; Fri, 19 May 2023 16:04:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : subject : date : message-id : mime-version : content-transfer-encoding; s=pps0720; bh=8EVJjkeCW4+WcYULT0SChqVH6/f9lnz++ehl5a4SvPA=; b=csG+9WUYYhyU3BGLmMUq8vb4t04dMuceyqr2UWYl1osREa7Ym4x2ad6F3bRTKqk6mqhA 3RC7bMBEzybLACWQM17YNPAyfMMSOajfVvmHL2SKVYUGllpksrHxQTzmZz3qXqaY7O1I JXchzDxIREp0XNm83mZeQWxZ9lw71n2nM7dbrKDnRqZFv1ytAXB/HA4Mr6BpdIff7+G3 SDuGAmWvWQ1oYPITbjv+HA1wPIAC04UfOzJk8aoLVYO8i/4fiL58s5Evho5b174OCUwW avv6pHRoxM45m8Ks2lps+Ay7mgRb3SoJGp5dDvN+LAdiL7i7YMQ68X5ykqqHsYwQyFgz cQ== Received: from p1lg14879.it.hpe.com (p1lg14879.it.hpe.com [16.230.97.200]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3qp4cncbjf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 May 2023 16:04:23 +0000 Received: from p1lg14886.dc01.its.hpecorp.net (unknown [10.119.18.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by p1lg14879.it.hpe.com (Postfix) with ESMTPS id 7C1A1130FA; Fri, 19 May 2023 16:04:22 +0000 (UTC) Received: from dog.eag.rdlabs.hpecorp.net (unknown [16.231.227.36]) by p1lg14886.dc01.its.hpecorp.net (Postfix) with ESMTP id A42A780E342; Fri, 19 May 2023 16:04:21 +0000 (UTC) Received: by dog.eag.rdlabs.hpecorp.net (Postfix, from userid 200934) id 5634C302F4727; Fri, 19 May 2023 11:04:20 -0500 (CDT) From: Steve Wahl To: Steve Wahl , Srinivas Pandruvada , Hans de Goede , Mark Gross , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] platform/x86: ISST: Remove 8 socket limit Date: Fri, 19 May 2023 11:04:20 -0500 Message-Id: <20230519160420.2588475-1-steve.wahl@hpe.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: 527pP950Rm0BE3n-mAp9Qj5UQ5hR3aQe X-Proofpoint-ORIG-GUID: 527pP950Rm0BE3n-mAp9Qj5UQ5hR3aQe X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-19_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0 malwarescore=0 mlxlogscore=999 phishscore=0 mlxscore=0 spamscore=0 bulkscore=0 suspectscore=0 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305190136 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Ilpo J=C3=A4rvinen --- .../x86/intel/speed_select_if/isst_if_common.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/platform/x86/intel/speed_select_if/isst_if_common.c b/= drivers/platform/x86/intel/speed_select_if/isst_if_common.c index e0572a29212e..02fe360a59c7 100644 --- a/drivers/platform/x86/intel/speed_select_if/isst_if_common.c +++ b/drivers/platform/x86/intel/speed_select_if/isst_if_common.c @@ -304,14 +304,13 @@ struct isst_if_pkg_info { static struct isst_if_cpu_info *isst_cpu_info; static struct isst_if_pkg_info *isst_pkg_info; =20 -#define ISST_MAX_PCI_DOMAINS 8 - static struct pci_dev *_isst_if_get_pci_dev(int cpu, int bus_no, int dev, = int fn) { struct pci_dev *matched_pci_dev =3D NULL; struct pci_dev *pci_dev =3D NULL; + struct pci_dev *_pci_dev =3D NULL; int no_matches =3D 0, pkg_id; - int i, bus_number; + int bus_number; =20 if (bus_no < 0 || bus_no >=3D ISST_MAX_BUS_NUMBER || cpu < 0 || cpu >=3D nr_cpu_ids || cpu >=3D 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 if (bus_number < 0) return NULL; =20 - for (i =3D 0; i < ISST_MAX_PCI_DOMAINS; ++i) { - struct pci_dev *_pci_dev; + for_each_pci_dev(_pci_dev) { int node; =20 - _pci_dev =3D pci_get_domain_bus_and_slot(i, bus_number, PCI_DEVFN(dev, f= n)); - if (!_pci_dev) + if (_pci_dev->bus->number !=3D bus_number || + _pci_dev->devfn !=3D PCI_DEVFN(dev, fn)) continue; =20 ++no_matches; --=20 2.26.2