Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2721405rwd; Fri, 19 May 2023 09:17:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4SVWK3vYWGgyk9vkk1/feUeFIVS1pGyzDsjOqFJWuREGo5UNXnfRgho3QFaRztmxMeikld X-Received: by 2002:a05:6a20:d48c:b0:104:2b4e:412d with SMTP id im12-20020a056a20d48c00b001042b4e412dmr2128182pzb.6.1684513058686; Fri, 19 May 2023 09:17:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684513058; cv=none; d=google.com; s=arc-20160816; b=LK04KabndGkOUZ8om0CwHb54fjz74Buqe9yCSMObNi63oy0fB1nU7dbgqkq1netxiI Q1XzAlJ+KLDY2G7OJKkgJiQvaVbv/Kv84RQiY1xBzbdNa3lL0d/HxKjw4FmuAQ4//YMZ ea6dYPbuiSO9SRT5rhU67VmOg5bksbQpMXT7cghVnIbq4qq/cLtZKWxyjj/YLTLsGEny z5JTBITH4IMJ1d56BcKMLHO447FuwpRyjxozH0d6SqPEop4KnE/mYoeAr2JaeEfkTc62 fIu0WZSMliJLvEniM/+H/mVPPGiuf5bggwc9PuuXK/74fPtaBkZUaFQuvTxgDmRE3Q7y q4gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=8EVJjkeCW4+WcYULT0SChqVH6/f9lnz++ehl5a4SvPA=; b=Wo2fYWQiEOrjKsv6Y0pG40S1KXPtP22It/2ets6ZFbb+VlJ9r/lFdXLz6jsotzzK4m QM97pM2v5C3PXzteIJmdomH3kT+L5d9QAqTrdzGvFzKeXK3urganNRW5A2j+y78GSY+4 39wg2Rj956Pcs1vHuWREvuIKJfkAHtMVOS5n8KoA3bgTVUmHM00Q/vufpo+Yp8Xj76Is Mpzl/V0/bz8K2wku8COgTvr5V1xWMa76Alg7W1KUHpElWuE1XKsm0UvGV8QD0J1hY/Te iXvc6xX0FLafNYqvWA24mfIjWreQgWAb8NQHzgnd5owbOWthLpOhKU08sjiiAUJatl9f d0Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=csG+9WUY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m64-20020a633f43000000b0051b4f4a2032si3746908pga.599.2023.05.19.09.17.25; Fri, 19 May 2023 09:17:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=csG+9WUY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229565AbjESQEj (ORCPT + 99 others); Fri, 19 May 2023 12:04:39 -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: 8bit 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 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- .../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; -#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 = NULL; struct pci_dev *pci_dev = NULL; + struct pci_dev *_pci_dev = NULL; int no_matches = 0, pkg_id; - int i, bus_number; + int bus_number; if (bus_no < 0 || bus_no >= ISST_MAX_BUS_NUMBER || cpu < 0 || 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 if (bus_number < 0) return NULL; - for (i = 0; i < ISST_MAX_PCI_DOMAINS; ++i) { - struct pci_dev *_pci_dev; + for_each_pci_dev(_pci_dev) { int node; - _pci_dev = pci_get_domain_bus_and_slot(i, bus_number, PCI_DEVFN(dev, fn)); - if (!_pci_dev) + if (_pci_dev->bus->number != bus_number || + _pci_dev->devfn != PCI_DEVFN(dev, fn)) continue; ++no_matches; -- 2.26.2