Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4073291rwd; Tue, 23 May 2023 02:43:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6oPAxfSDgZl4ujH7dCAxOc/9MH0d0irZxmFmoJHuwIFLWIlmNC+unCR3wQAIzSUm+b86eq X-Received: by 2002:a05:6a20:7f91:b0:ff:ca91:68ee with SMTP id d17-20020a056a207f9100b000ffca9168eemr14662046pzj.9.1684835012548; Tue, 23 May 2023 02:43:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684835012; cv=none; d=google.com; s=arc-20160816; b=X717Vrz64cutGEsBQrzPcG5rzE3gZG76NCvp8SQaVCvn4asPDcW8SfPgOHI0kTW4S6 DMYaAqEl9TiwvLUKHXdNP14/5i+PA6Y5QGzKMNkH/+i5WefpYXHe6nAZ5ff6Ve7wj+10 XbXXYvbjPn4R96Kg45uh9BT1pPaAfBPYQhwrMQphKcXNQ96zvnkQGlIOfdDsMimQx4gG a42xRRyXHvni0bD9FmlTkanEnDU7aZuSkdgCtdbnE2KW12m3YhgTgQiYc8kd7gykdmIS ukRO+YYT+rnVSGcNNmv8XndWJmmq2Es8dvUE2pFltSlDktnW8XxryQVjXCGAlvA3OA90 TWJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=2jk0Hmcc3x3zq0xEsk4I+zNMn1yi+mn7a59RVh8xAqU=; b=TPEwQ+oYg2c8yTYi07dvjf0zOH6xuk2iuu6KbkP0S6v94t0Cf1nEDpjQVmuUM32PdD EFlaAwpNgp09J0b+hOl4ncImtKBH3SDcK/3githVpWYrdp5a6ZdlvZDrhNlAckbg6NSS L8iOnLosrwzr6Lz45VPGpL/M3b5XrJ3p5wzFIb827jSvu09XlF01NjGGfEYAPpW2jQAA EePiN2FK8W5nXevvsqBKStxGvEOQ2yDW2pIyeBAelN16Id9sUOgqErsNW9IyaDqcOo3s gs9r74deqaMmgWgNOPv15vwNF1Bf9NOpODK/iARFP2BiGYGgVo7UCK4/1Mp4XiLMZTrl BHuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XK89COV7; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r186-20020a632bc3000000b005343e03b044si5600653pgr.697.2023.05.23.02.43.19; Tue, 23 May 2023 02:43:32 -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=@intel.com header.s=Intel header.b=XK89COV7; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235945AbjEWJ1R (ORCPT + 99 others); Tue, 23 May 2023 05:27:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235812AbjEWJ1P (ORCPT ); Tue, 23 May 2023 05:27:15 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8951E119; Tue, 23 May 2023 02:27:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684834033; x=1716370033; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=4pmQFILBmz2f/mXPtC0/un3f6702ACX81f16N8rZ8rA=; b=XK89COV7/PaQju0iv+jiVFWvsr1MjtgaXCFQlp7O1Yo4f3kvBpLZvxzG dC5qfjvD+7Z6zHqyrLR6Z8FZW85GSOdj50Pbg3tRF03YmXJklD08eWtm7 1UWvmQbBjlTtV+fnuGxhDV81YjP+hZ+dIQ/xulqcCpJpdJaBCKnQEv3rh om9WFBcUJrloGU+eXNlgJDWNJBp68C6U0TUb7Bt6AJlGFUgXJjfEFe/jn LNJ+jmOHKaVXllPN2mFDoFyyYDOnhrN3O/dtVZu+I+Wyt70+Ve8T9Q5OI 7z+ABFa33Nj6idN45LyZOKHlFaTagwE5DHkajM1nMTg8yEb4bWvUYor67 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10718"; a="381429767" X-IronPort-AV: E=Sophos;i="6.00,185,1681196400"; d="scan'208";a="381429767" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2023 02:27:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10718"; a="734683883" X-IronPort-AV: E=Sophos;i="6.00,185,1681196400"; d="scan'208";a="734683883" Received: from oodnolex-mobl1.ccr.corp.intel.com ([10.252.55.104]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2023 02:27:11 -0700 Date: Tue, 23 May 2023 12:27:08 +0300 (EEST) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: Steve Wahl cc: Srinivas Pandruvada , Hans de Goede , Mark Gross , platform-driver-x86@vger.kernel.org, LKML Subject: Re: [PATCH] platform/x86: ISST: Remove 8 socket limit In-Reply-To: <20230519160420.2588475-1-steve.wahl@hpe.com> Message-ID: References: <20230519160420.2588475-1-steve.wahl@hpe.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1415302906-1684834032=:3565" X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1415302906-1684834032=:3565 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8BIT On Fri, 19 May 2023, Steve Wahl wrote: > 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; Reviewed-by: Ilpo J?rvinen With the note that _pci_dev is not a good variable name (but the rename would make this fix larger than it needs to be). -- i. --8323329-1415302906-1684834032=:3565--