Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1708132lqp; Mon, 15 Apr 2024 14:52:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU+a5tj24Qoj55CIVS1WwcOL/Es97W/SUhKEJgZ1oVuG0lf6cuiPSy5ieQJcIfZ6I24ng9bhqDUS6xN61jTElbboyxrBaG8lw2uiAsfag== X-Google-Smtp-Source: AGHT+IE6JACqTrfHLIjnqY/O+LZzuUsO/ieMOZFur3GfmVIeVrAmpkWEoy/NFGaF7ghs6/lPxfHS X-Received: by 2002:a17:903:2289:b0:1e4:4045:481b with SMTP id b9-20020a170903228900b001e44045481bmr11199656plh.29.1713217953041; Mon, 15 Apr 2024 14:52:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713217953; cv=pass; d=google.com; s=arc-20160816; b=Wy+1m7P0llMZnorTd+y5D0RnU3WDPMgiUA9VKBPGuBapQ6WEJzxt9H7JUIE/Mm/GTL TXX0edQahcMZpUjjH5UC7fhn1y31Jh0sBmM6PCLgCV+fxqXaxXCEj+cz+PfHPj8nvunc 9NwTNiw9UMlCpeANTiAsgQY6zQ1o6OvT4oAjIixmR40gBNPFov/KeRTwuong9yaryE8h Nahw5I5AWbsbhOycZVKdhWIjMdzFK+t6uBoXvpUku7ceml7Hq7pNZpsfl00sbJGYvwKx a511iyBqTYXazdZZ+5Wamklx1FEu7BbBpy599V9/YcFBT2OFMKUVgmxdJi0b5T90EGmY 9yxg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=Pmp95y9g4jiG15mby9sMCfBAC3UqGBJZK43SnJT/15c=; fh=Wf6JnHwFTklwnKcS9o96LU/QKTLwZYX4/bZo9OB6s/k=; b=iFVa8c0AoX9s32nJWWOj4kZk2aPVqTIioBS++93JchsBrODpJ4jEKBK2E7fB2wKmke hhHdSdyGBfI+fP1Hk1GjzXK8lOkmVIi+E+VsFiO//rmtLq8kOxvsnHPN2PGCAPt3KuPK i78AyPA2nRdOf9tXZGHWIeFtkFJVbV8wxQX8RPD0CC4Qi82FnMikquTihT+zW1AW/CsF MDK0oScRBC/FE82EVl0XryAyFiCqogd6A+l6NYsfdTVCVpN4sGcRGolHB2WLQW6ktSmT VXH22t1nHXF4+dAaWdG2LsUL5At9msOqJm2XzXn1VIvyc+QU6sewKTRzfDDyyhAD2LeZ EByw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=D1UQX5Vl; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-145956-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145956-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k4-20020a170902ce0400b001e7b0e10ef1si844048plg.499.2024.04.15.14.52.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 14:52:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145956-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=D1UQX5Vl; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-145956-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145956-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B943C282B99 for ; Mon, 15 Apr 2024 21:52:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D1288157A4D; Mon, 15 Apr 2024 21:52:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="D1UQX5Vl" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 628091EF1A; Mon, 15 Apr 2024 21:52:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713217943; cv=none; b=beL6lKDJdJZmVBMkQPPk718T43jkmmRt/iAXhV7p0LWnC1HmShdNlFzQ6Q64Wn1KQUO02TZXgOp1gnbn/M8CPLy8NrBEcEiaXLzR+sTIDaGDaJy7th8BXdL27Upt4MlsKlK5SFoGVHVeQZTbLR4+4h/SQQJU7L+J6XpRZDPKthU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713217943; c=relaxed/simple; bh=KJ52F3vvXnDFFDYcpRHY11CkLnLJ7fh/q+VR/api2QU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=VMi9sfxOTCbMKcs44WCY9+WiXI+i/dtullqxutML3T/ZTRC3YedTQ3Zkh+nB1rpsWCK86t13G1M4VnaNQiLguJkHWJ/nG/09AYsHZugUAkz9UzZL/PnDf4oe7gyU15WqVZkBx01YzGNdYzU5unSXEcCqaT3poZxljXnfvTfyQ2A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=D1UQX5Vl; arc=none smtp.client-ip=198.175.65.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713217942; x=1744753942; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=KJ52F3vvXnDFFDYcpRHY11CkLnLJ7fh/q+VR/api2QU=; b=D1UQX5VlXRNaXGres5M51FohKdsvh3DR/FKz59xZVgFVCwgJIS6OCyL6 JZHaTRoUYkiyFpFsuyIxGbShG9ChLjXk5xHfahP6S2lnwOXcJ55y5TPS6 rIpUqSokF3OAI/6Casy+s8CIb8MUZSAgGEpU8Es+Qv+xLFBuSSEFLPE5n MwQwzeuQfmlPskPPGeshdgvC0vXCGIoIcmkC/hrqSjhQx2dkbO4wgw8t8 p/A/12FD4vFc1e7hBPsm7x8+uMXXjo30n7HRPIGYCU/t1YOtW2TheUDL2 yiiTUyCnLx5/WbhGrsRwoWGmQTSL3oR1QgiIzrPHZKumW7WsJXYHqXJAq w==; X-CSE-ConnectionGUID: U0IP5gVbTp2uQ/GXq8PtaA== X-CSE-MsgGUID: VWW6hZ1BQ2a8sCMeQd7Faw== X-IronPort-AV: E=McAfee;i="6600,9927,11045"; a="12420708" X-IronPort-AV: E=Sophos;i="6.07,204,1708416000"; d="scan'208";a="12420708" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2024 14:52:21 -0700 X-CSE-ConnectionGUID: UWZ5JvWRQcuqI0TvjinHSQ== X-CSE-MsgGUID: 5GauRyGPRGCHQv12s/w8Zg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,204,1708416000"; d="scan'208";a="26845113" Received: from spandruv-desk.jf.intel.com ([10.54.75.14]) by orviesa005.jf.intel.com with ESMTP; 15 Apr 2024 14:52:21 -0700 From: Srinivas Pandruvada To: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Pandruvada , stable@vger.kernel.org Subject: [PATCH] platform/x86/intel-uncore-freq: Don't present root domain on error Date: Mon, 15 Apr 2024 14:52:10 -0700 Message-Id: <20240415215210.2824868-1-srinivas.pandruvada@linux.intel.com> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit If none of the clusters are added because of some error, fail to load driver without presenting root domain. In this case root domain will present invalid data. Signed-off-by: Srinivas Pandruvada Fixes: 01c10f88c9b7 ("platform/x86/intel-uncore-freq: tpmi: Provide cluster level control") Cc: # 6.5+ --- This error can be reproduced in the pre production hardware only. So can go through regular cycle and they apply to stable. .../x86/intel/uncore-frequency/uncore-frequency-tpmi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-tpmi.c b/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-tpmi.c index bd75d61ff8a6..587437211d72 100644 --- a/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-tpmi.c +++ b/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-tpmi.c @@ -240,6 +240,7 @@ static int uncore_probe(struct auxiliary_device *auxdev, const struct auxiliary_ bool read_blocked = 0, write_blocked = 0; struct intel_tpmi_plat_info *plat_info; struct tpmi_uncore_struct *tpmi_uncore; + bool uncore_sysfs_added = false; int ret, i, pkg = 0; int num_resources; @@ -384,9 +385,15 @@ static int uncore_probe(struct auxiliary_device *auxdev, const struct auxiliary_ } /* Point to next cluster offset */ cluster_offset >>= UNCORE_MAX_CLUSTER_PER_DOMAIN; + uncore_sysfs_added = true; } } + if (!uncore_sysfs_added) { + ret = -ENODEV; + goto remove_clusters; + } + auxiliary_set_drvdata(auxdev, tpmi_uncore); tpmi_uncore->root_cluster.root_domain = true; -- 2.40.1