From patchwork Fri May 31 08:35:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: srinivas pandruvada X-Patchwork-Id: 13681316 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 BF732150980; Fri, 31 May 2024 08:36:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717144563; cv=none; b=PyAZhdhyxGHjDlllW8tl6D/fEohcztAbwS67emoHIBCoiLJNd/+19xswIzTdDX/ZsdVKtmejaOc97bfeThtmlFatGejrK3Y6CkAi/S8x0XGdw5eooQ6h4w+k1fFKdXtCzWL9FGur8xODeSUqOZSvAW4AIwQTg7eJbOiCpaaiWOQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717144563; c=relaxed/simple; bh=v47caOo50vrBzPaSET/JvoN04/v1VUoO5XuozIOCxzQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Qw9314Jtljj6NUyoUXxGaO14SfUIF0KneCnoauQHD0iYZRG76j2jlpnzHHidJz/1m6HkBpwvimzAQUsdxazppT9vVRvFfYUTrJz4cQzRYnKtUPBlwPTloF6kyqdBRn/450TGJVgeDRUTKNcE24IKTeWlEXVJdJpyWjx/VZxXcDg= 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=Y4SehAPy; arc=none smtp.client-ip=192.198.163.19 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Y4SehAPy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717144562; x=1748680562; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=v47caOo50vrBzPaSET/JvoN04/v1VUoO5XuozIOCxzQ=; b=Y4SehAPy8kWq1Wh6orx4ZMAa95OauZn2xt+sK+Nfe/4Fq6wPXllbUtYA 3UsDuCpgqvabcLUETWGxwjEnCYFPJkbW9EL2nxc46zBVvFS6ThtunR317 MH7uQWc/r1qUNQ3QmtTtTrBRzfBqAUhA3RZ1SnibFdKrNwzCwSsgu5tMB nxuBe48V6HyQxY7Uqh5q3TtYgtT83PqX2C4AdI9mXDlOfQZV2dfqFkEno cUnVrhnNe8ofZ4e4Xgke/aMoaeP1MRX4h5besUWurJHMzWua6T2okPArX 68oM5e2PFrPbjNrsMnO0d7o039CVrtxZVICKAXOBwqvIO0rJSKb/zNdIx g==; X-CSE-ConnectionGUID: MNACb/NDSwmVx4nEBZ4k6A== X-CSE-MsgGUID: 4bLBGz5nTo6AMQXlOMAXtQ== X-IronPort-AV: E=McAfee;i="6600,9927,11088"; a="13495950" X-IronPort-AV: E=Sophos;i="6.08,203,1712646000"; d="scan'208";a="13495950" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2024 01:36:00 -0700 X-CSE-ConnectionGUID: 3IWi82zJSQukPa31XGCjeA== X-CSE-MsgGUID: O+berEIyS6qxJDrNnGDnZA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,203,1712646000"; d="scan'208";a="36193449" Received: from spandruv-desk.jf.intel.com ([10.54.75.19]) by fmviesa009.fm.intel.com with ESMTP; 31 May 2024 01:35:59 -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, andriy.shevchenko@linux.intel.com, rui.zhang@intel.com, Srinivas Pandruvada Subject: [PATCH v2 1/3] platform/x86: ISST: Add model specific loading for common module Date: Fri, 31 May 2024 01:35:46 -0700 Message-ID: <20240531083554.1313110-2-srinivas.pandruvada@linux.intel.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240531083554.1313110-1-srinivas.pandruvada@linux.intel.com> References: <20240531083554.1313110-1-srinivas.pandruvada@linux.intel.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 SST common module is loaded when model specific or TPMI SST driver registers for services. There are model specific features used in SST common modules which are checked with a CPU model list. So, this module is model specific. There are some use cases where loading the common module independently only on the supported CPU models helps. The first use case is for preventing SST TPMI module loading if the model specific features are not implemented. The second use case for presenting information to user space when SST is used in OOB (Out of Band) mode. 1. With TPMI, SST interface is architectural. This means that no need to add new PCI device IDs for new CPU models. This means that there can be lag in adding CPU models for the model specific features in the common module. For example, before adding CPU model to GRANITERAPIDS_D to hpm_cpu_ids[], SST is still functional for some features and but will get/set wrong data for features like SST-CP. This is because IOCTL ISST_IF_GET_PHY_ID, will not give correct mapping for newer CPU models. So adding explicit model check during load time will prevent such cases. For unsupported CPU models, common driver will fail to load and hence dependent modules will not be loaded. 2. When the SST TPMI features are controlled by some OOB agent (not from OS interface), even if the CPU model is supported, there will be no user space interface available for tools as SST TPMI modules will not be loaded. User space interface is registered when TPMI modules call isst_if_cdev_register(). Even in this case user space orchestrator software needs to get power domain information to schedule workload and get/set turbo ratio limits. This information is exposed by the common module using IOCTLs ISST_IF_GET_PHY_ID and ISST_IF_MSR_COMMAND respectively. Since the user space MSR access can be locked, direct MSR access from the user space is not an option using /dev/cpu/*/msr. Converge all the existing model checks to one common place and use driver data to differentiate. On successful model check call isst_misc_reg(). Signed-off-by: Srinivas Pandruvada Reviewed-by: Zhang Rui --- v2: Split the MSR check for Skylake-X to new patch as suggested by Ilpo. Using new family model check macros. Note: Reviewed-by: Andy Shevchenko Andy's Reviewed-by was for one version before Rafael and Rui's comments were addressed. So didn't add it before "---". We can add it if there is no issue from Andy. Also incorporated changes suggested by "Wysocki, Rafael J" . We have all the models supported till date are already in 6.9 kernel. So this is more for future proofing for the first use case. .../intel/speed_select_if/isst_if_common.c | 63 +++++++++++-------- 1 file changed, 37 insertions(+), 26 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 713c0d1fa85f..47f5f26e6c20 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 @@ -718,14 +718,6 @@ static struct miscdevice isst_if_char_driver = { .fops = &isst_if_char_driver_ops, }; -static const struct x86_cpu_id hpm_cpu_ids[] = { - X86_MATCH_INTEL_FAM6_MODEL(GRANITERAPIDS_D, NULL), - X86_MATCH_INTEL_FAM6_MODEL(GRANITERAPIDS_X, NULL), - X86_MATCH_INTEL_FAM6_MODEL(ATOM_CRESTMONT, NULL), - X86_MATCH_INTEL_FAM6_MODEL(ATOM_CRESTMONT_X, NULL), - {} -}; - static int isst_misc_reg(void) { mutex_lock(&punit_misc_dev_reg_lock); @@ -733,12 +725,6 @@ static int isst_misc_reg(void) goto unlock_exit; if (!misc_usage_count) { - const struct x86_cpu_id *id; - - id = x86_match_cpu(hpm_cpu_ids); - if (id) - isst_hpm_support = true; - misc_device_ret = isst_if_cpu_info_init(); if (misc_device_ret) goto unlock_exit; @@ -786,8 +772,6 @@ static void isst_misc_unreg(void) */ int isst_if_cdev_register(int device_type, struct isst_if_cmd_cb *cb) { - int ret; - if (device_type >= ISST_IF_DEV_MAX) return -EINVAL; @@ -805,15 +789,6 @@ int isst_if_cdev_register(int device_type, struct isst_if_cmd_cb *cb) punit_callbacks[device_type].registered = 1; mutex_unlock(&punit_misc_dev_open_lock); - ret = isst_misc_reg(); - if (ret) { - /* - * No need of mutex as the misc device register failed - * as no one can open device yet. Hence no contention. - */ - punit_callbacks[device_type].registered = 0; - return ret; - } return 0; } EXPORT_SYMBOL_GPL(isst_if_cdev_register); @@ -829,7 +804,6 @@ EXPORT_SYMBOL_GPL(isst_if_cdev_register); */ void isst_if_cdev_unregister(int device_type) { - isst_misc_unreg(); mutex_lock(&punit_misc_dev_open_lock); punit_callbacks[device_type].def_ioctl = NULL; punit_callbacks[device_type].registered = 0; @@ -839,5 +813,42 @@ void isst_if_cdev_unregister(int device_type) } EXPORT_SYMBOL_GPL(isst_if_cdev_unregister); +#define SST_HPM_SUPPORTED 0x01 + +static const struct x86_cpu_id isst_cpu_ids[] = { + X86_MATCH_VFM(INTEL_ATOM_CRESTMONT, SST_HPM_SUPPORTED), + X86_MATCH_VFM(INTEL_ATOM_CRESTMONT_X, SST_HPM_SUPPORTED), + X86_MATCH_VFM(INTEL_EMERALDRAPIDS_X, 0), + X86_MATCH_VFM(INTEL_GRANITERAPIDS_D, SST_HPM_SUPPORTED), + X86_MATCH_VFM(INTEL_GRANITERAPIDS_X, SST_HPM_SUPPORTED), + X86_MATCH_VFM(INTEL_ICELAKE_D, 0), + X86_MATCH_VFM(INTEL_ICELAKE_X, 0), + X86_MATCH_VFM(INTEL_SAPPHIRERAPIDS_X, 0), + X86_MATCH_VFM(INTEL_SKYLAKE_X, 0), + {} +}; +MODULE_DEVICE_TABLE(x86cpu, isst_cpu_ids); + +static int __init isst_if_common_init(void) +{ + const struct x86_cpu_id *id; + + id = x86_match_cpu(isst_cpu_ids); + if (!id) + return -ENODEV; + + if (id->driver_data == SST_HPM_SUPPORTED) + isst_hpm_support = true; + + return isst_misc_reg(); +} +module_init(isst_if_common_init) + +static void __exit isst_if_common_exit(void) +{ + isst_misc_unreg(); +} +module_exit(isst_if_common_exit) + MODULE_DESCRIPTION("ISST common interface module"); MODULE_LICENSE("GPL v2"); From patchwork Fri May 31 08:35:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: srinivas pandruvada X-Patchwork-Id: 13681317 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 4EF0C1514C9; Fri, 31 May 2024 08:36:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717144563; cv=none; b=d3+hvm+snbWLXk3S5/g6tVNHPy96laRFSQSqiDM02J6HMjRQZvZSmDYEQWLI/R8AfvHGN+WSXghTP1JwdkYs+iOBzVO8a1RMX5yyUJ3/B/AHPdMK8ECW/OGmDeAwAKZBNofFSeEEmwbnjEguiD8LgKrf+uXL5M5LOqva84xjjGk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717144563; c=relaxed/simple; bh=oPjqob5N5cGr1+eQPADcKbdsHGnfiLSEJTNGMcq9Vqk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PKX6Wtq2slSfe3dzGNYwSubANeJo3IQ1iVXDMp+fwuHra/AZMMxkURfTmZKxFz9wVEUfP/d7MvH7u3wpETFg/jVAmQFeEyS6AKODbGSJIuUxYk8xXF5c3FBSCXgkoTE+j/Ib+swn2vQWkHDLdyGdia/vWWcH/zdt4r7bgi73Fgs= 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=IGaubPSD; arc=none smtp.client-ip=192.198.163.19 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="IGaubPSD" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717144562; x=1748680562; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oPjqob5N5cGr1+eQPADcKbdsHGnfiLSEJTNGMcq9Vqk=; b=IGaubPSD5iezZ5dDM5z743ejwqvVgSI4Oo/A//e/WbZ8OphZVRiVhTbw KE7eP8ht0/T308K7Kz/mzS0yGLQC+6+OoUbvhy4Bd1JzynOOA7PZOGDdI 0OvLqEKn5MPMgKEfflfDW8msemIHqNPPHC6/qkpB0syBgZ3HBV0sx6+zV eTWMejGSlr1tgpQ7l4R9IKteEXeis81fFyFxKdK2ByoOjMXSaRHLacgMH KMsVFRLOeg0hbtVniuuPTADu6eD5FrwOsEjWMQb19Ls6zIO/B4oAMtOeH JdMFGpnzfO/b2TnKHzDdTFS6heaL+605snPc0Eu1bv/8QGDYpGgbqccpF g==; X-CSE-ConnectionGUID: cKAbEJemRaOpWGO+IiAc2Q== X-CSE-MsgGUID: xr3xZXWHQ4qgN9DJ1K+mmQ== X-IronPort-AV: E=McAfee;i="6600,9927,11088"; a="13495952" X-IronPort-AV: E=Sophos;i="6.08,203,1712646000"; d="scan'208";a="13495952" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2024 01:36:00 -0700 X-CSE-ConnectionGUID: guMTEGOgSb+G3eMlyWo4ew== X-CSE-MsgGUID: A0HucA7vSR2wOt4fcnHalQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,203,1712646000"; d="scan'208";a="36193452" Received: from spandruv-desk.jf.intel.com ([10.54.75.19]) by fmviesa009.fm.intel.com with ESMTP; 31 May 2024 01:36:00 -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, andriy.shevchenko@linux.intel.com, rui.zhang@intel.com, Srinivas Pandruvada Subject: [PATCH v2 2/3] platform/x86: ISST: Avoid some SkyLake server models Date: Fri, 31 May 2024 01:35:47 -0700 Message-ID: <20240531083554.1313110-3-srinivas.pandruvada@linux.intel.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240531083554.1313110-1-srinivas.pandruvada@linux.intel.com> References: <20240531083554.1313110-1-srinivas.pandruvada@linux.intel.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Some SkyLake server variants don't support any SST functionality. No use of providing any SST related interfaces on them. All supported SkyLake servers provide mailbox interface via MSR. So check for the presence of MSR 0xB0 and 0xB1. If not present don't load common module. Move defines for MSR_OS_MAILBOX_INTERFACE and MSR_OS_MAILBOX_DATA to common header file to avoid duplicating them. Signed-off-by: Srinivas Pandruvada --- New patch, split from v1 1/2 The mbox MSR defines are moved to common header file to avoid duplicates .../x86/intel/speed_select_if/isst_if_common.c | 13 +++++++++++-- .../x86/intel/speed_select_if/isst_if_common.h | 3 +++ .../x86/intel/speed_select_if/isst_if_mbox_msr.c | 2 -- 3 files changed, 14 insertions(+), 4 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 47f5f26e6c20..7ea058571ab5 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 @@ -814,6 +814,7 @@ void isst_if_cdev_unregister(int device_type) EXPORT_SYMBOL_GPL(isst_if_cdev_unregister); #define SST_HPM_SUPPORTED 0x01 +#define SST_MBOX_SUPPORTED 0x02 static const struct x86_cpu_id isst_cpu_ids[] = { X86_MATCH_VFM(INTEL_ATOM_CRESTMONT, SST_HPM_SUPPORTED), @@ -824,7 +825,7 @@ static const struct x86_cpu_id isst_cpu_ids[] = { X86_MATCH_VFM(INTEL_ICELAKE_D, 0), X86_MATCH_VFM(INTEL_ICELAKE_X, 0), X86_MATCH_VFM(INTEL_SAPPHIRERAPIDS_X, 0), - X86_MATCH_VFM(INTEL_SKYLAKE_X, 0), + X86_MATCH_VFM(INTEL_SKYLAKE_X, SST_MBOX_SUPPORTED), {} }; MODULE_DEVICE_TABLE(x86cpu, isst_cpu_ids); @@ -837,8 +838,16 @@ static int __init isst_if_common_init(void) if (!id) return -ENODEV; - if (id->driver_data == SST_HPM_SUPPORTED) + if (id->driver_data == SST_HPM_SUPPORTED) { isst_hpm_support = true; + } else if (id->driver_data == SST_MBOX_SUPPORTED) { + u64 data; + + /* Can fail only on some Skylake-X generations */ + if (rdmsrl_safe(MSR_OS_MAILBOX_INTERFACE, &data) || + rdmsrl_safe(MSR_OS_MAILBOX_DATA, &data)) + return -ENODEV; + } return isst_misc_reg(); } diff --git a/drivers/platform/x86/intel/speed_select_if/isst_if_common.h b/drivers/platform/x86/intel/speed_select_if/isst_if_common.h index 1004f2c9cca8..378055fe1d16 100644 --- a/drivers/platform/x86/intel/speed_select_if/isst_if_common.h +++ b/drivers/platform/x86/intel/speed_select_if/isst_if_common.h @@ -16,6 +16,9 @@ #define PCI_DEVICE_ID_INTEL_RAPL_PRIO_DEVID_1 0x3251 #define PCI_DEVICE_ID_INTEL_CFG_MBOX_DEVID_1 0x3259 +#define MSR_OS_MAILBOX_INTERFACE 0xB0 +#define MSR_OS_MAILBOX_DATA 0xB1 + /* * Validate maximum commands in a single request. * This is enough to handle command to every core in one ioctl, or all diff --git a/drivers/platform/x86/intel/speed_select_if/isst_if_mbox_msr.c b/drivers/platform/x86/intel/speed_select_if/isst_if_mbox_msr.c index 1b6eab071068..48b608eaca5f 100644 --- a/drivers/platform/x86/intel/speed_select_if/isst_if_mbox_msr.c +++ b/drivers/platform/x86/intel/speed_select_if/isst_if_mbox_msr.c @@ -21,8 +21,6 @@ #include "isst_if_common.h" -#define MSR_OS_MAILBOX_INTERFACE 0xB0 -#define MSR_OS_MAILBOX_DATA 0xB1 #define MSR_OS_MAILBOX_BUSY_BIT 31 /* From patchwork Fri May 31 08:35:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: srinivas pandruvada X-Patchwork-Id: 13681318 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 A86041514DB; Fri, 31 May 2024 08:36:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717144565; cv=none; b=CL+QQysemsn0H6aTB7Jpakv0aGwiySXYfjqAE7L9eo5kMKYZTOKD/sx/Joo4rMdGLUnAs5sg+h9eyrCGtsjqzY4YzAdhGN0PQ7q5wpKJoE1mSdfTEXBk4exDHbXybxLYDhooS6iSz5RsFIdVlEkFEFAlHYAtE8zwHl1ixT1lIzY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717144565; c=relaxed/simple; bh=AjD0KgKUTNk/qht295XZG6rAGKTm2KqnG8awsW8O1ow=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pYqOxRODuJvqJy/W6HCyauXUK1z5lsdaWNEWJCaOHSNoUrgnzinSwkAKZe6fOofriI9Z1tdojfY+ed8slI6vR3SThHKpyowJpgMx1IZWTfZJuOX6BIuJdKAzGHnWKPIE2f4CT+QVcy1u9rAaw4+NtyPU1wNbdeHX0ffBqeOiIg8= 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=mGHiXMM3; arc=none smtp.client-ip=192.198.163.19 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="mGHiXMM3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717144564; x=1748680564; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AjD0KgKUTNk/qht295XZG6rAGKTm2KqnG8awsW8O1ow=; b=mGHiXMM3uItbSmdmn5R+Fm9hxLlriJUf0jc3S0H+FwFEX6U2T77wE+VH xb9Pqhswipw5rJPeIoz/aDYTkBp8mDcGVoiyCUxUdIkiv0CuqiReSeSE+ yfcwC7BL1jH+i+FQAI+OBxia5PfzTxhQqV/EprJbMwg7GqMCrMFHtfn6h /GuP1OVcdBQkTC8tH6qvXHbmVKIcvQuSsmv3znwnypJBLGbfv8uR9TGTg 6BEGrGFQt4JKq3In2x6DQDkbX8P2i7axGOU2BbiSTliqpAE18TTy6ziK1 IOyjZ8ZD4LZYAX51fn+Vk9mP/2t6ZK/7UUmqGNnTzC/0v6PJnxCJpnY9e g==; X-CSE-ConnectionGUID: lc/f5RZ5QKKq/osUW5FWjw== X-CSE-MsgGUID: C1nU6ZZIQjSwkykIltOvuw== X-IronPort-AV: E=McAfee;i="6600,9927,11088"; a="13495954" X-IronPort-AV: E=Sophos;i="6.08,203,1712646000"; d="scan'208";a="13495954" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2024 01:36:00 -0700 X-CSE-ConnectionGUID: qjIXNYGLS7muvdOWx6t1XQ== X-CSE-MsgGUID: 8xIiutGhSgO7Onbd+mLuhA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,203,1712646000"; d="scan'208";a="36193455" Received: from spandruv-desk.jf.intel.com ([10.54.75.19]) by fmviesa009.fm.intel.com with ESMTP; 31 May 2024 01:36:00 -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, andriy.shevchenko@linux.intel.com, rui.zhang@intel.com, Srinivas Pandruvada Subject: [PATCH v2 3/3] platform/x86: ISST: Use only TPMI interface when present Date: Fri, 31 May 2024 01:35:48 -0700 Message-ID: <20240531083554.1313110-4-srinivas.pandruvada@linux.intel.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240531083554.1313110-1-srinivas.pandruvada@linux.intel.com> References: <20240531083554.1313110-1-srinivas.pandruvada@linux.intel.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When the TPMI interface is present, use this interface instead of legacy. On some systems legacy IO device is also present. Using both interfaces together is confusing and may set the hardware in inconsistent state. When TPMI interface is present, don't load legacy drivers. Signed-off-by: Srinivas Pandruvada Reviewed-by: Andy Shevchenko Reviewed-by: Zhang Rui Reviewed-by: Ilpo Järvinen --- Previously 2/2, now 3/3 No change except reviewed-by Ilpo. drivers/platform/x86/intel/speed_select_if/isst_if_common.c | 3 +++ 1 file changed, 3 insertions(+) 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 7ea058571ab5..10e21563fa46 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 @@ -775,6 +775,9 @@ int isst_if_cdev_register(int device_type, struct isst_if_cmd_cb *cb) if (device_type >= ISST_IF_DEV_MAX) return -EINVAL; + if (device_type < ISST_IF_DEV_TPMI && isst_hpm_support) + return -ENODEV; + mutex_lock(&punit_misc_dev_open_lock); /* Device is already open, we don't want to add new callbacks */ if (misc_device_open) {