Skip to contentSkip to conversation

TPMI updates for SST

PATCH In review Srinivas Pandruvada 2 participants 4 messages Jun 12, 2023 – Jun 13, 2023

Subsystems (2)
lore
Share & tools
lore

Srinivas Pandruvada

author maintainer
#0 lore raw

cover TPMI updates for SST

This series contains two fixes. Patches are on top of review-hans branch of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Since these are unlreased products, I didn't mark for stable.

Srinivas Pandruvada (2):
platform/x86: ISST: Reset default callback on unregister platform/x86: ISST: Fix usage counter

 drivers/platform/x86/intel/speed_select_if/isst_if_common.c | 1 +
 drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c | 2 ++
 2 files changed, 3 insertions(+)
Signature · 1 line
2.38.1
author maintainer
#1 lore raw

PATCH 1/2 platform/x86: ISST: Reset default callback on unregister

When multiple clients are registered and some of those modules are removed, the default IOCTL callback for those clients are still not NULL. Calling them will result in crash.

Set the default IOCTL callback pointer to NULL on unregister.

---
 drivers/platform/x86/intel/speed_select_if/isst_if_common.c | 1 +
 1 file changed, 1 insertion(+)
drivers/platform/x86/intel/speed_select_if/isst_if_common.c +1 -0
index e0572a29212e..352bf5118d17 100644
@@ -831,6 +831,7 @@ 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;
 	if (device_type == ISST_IF_DEV_MBOX)
 		isst_delete_hash();
Signature · 1 line
2.38.1
author maintainer
#2 lore raw

PATCH 2/2 platform/x86: ISST: Fix usage counter

In reply to Srinivas Pandruvada

On multi package system, the TPMI SST instance is getting allocated again as the usage counter is not getting incremented. Here the instance is allocated only when the usage count is zero. There is no need to allocate again.

Increment usage ID on successful return from isst_if_cdev_register().

---
 drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c +2 -0
index 664d2ee60385..63faa2ea8327 100644
@@ -1414,6 +1414,8 @@ int tpmi_sst_init(void)
 	ret = isst_if_cdev_register(ISST_IF_DEV_TPMI, &cb);
 	if (ret)
 		kfree(isst_common.sst_inst);
+	else
+		++isst_core_usage_count;
 init_done:
 	mutex_unlock(&isst_tpmi_dev_lock);
 	return ret;
Signature · 1 line
2.38.1
#3 lore raw
In reply to Srinivas Pandruvada

Hi,

Quoted 5 lines · Srinivas Pandruvada

This series contains two fixes. Patches are on top of review-hans branch of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Since these are unlreased products, I didn't mark for stable.

Thank you for your patch-series, I've applied the series to my review-hans branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Note it will show up in my review-hans branch once I've pushed my local branch there, which might take a while.

Once I've run some tests on this branch the patches there will be added to the platform-drivers-x86/for-next branch and eventually will be included in the pdx86 pull-request to Linus for the next merge-window.

Regards,

Hans

Quoted 8 lines

Srinivas Pandruvada (2):
platform/x86: ISST: Reset default callback on unregister platform/x86: ISST: Fix usage counter

 drivers/platform/x86/intel/speed_select_if/isst_if_common.c | 1 +
 drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c | 2 ++
 2 files changed, 3 insertions(+)