2023-06-12 23:05:52

by srinivas pandruvada

[permalink] [raw]
Subject: [PATCH 0/2] 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(+)

--
2.38.1



2023-06-12 23:06:07

by srinivas pandruvada

[permalink] [raw]
Subject: [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.

Signed-off-by: Srinivas Pandruvada <[email protected]>
---
drivers/platform/x86/intel/speed_select_if/isst_if_common.c | 1 +
1 file changed, 1 insertion(+)

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..352bf5118d17 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
@@ -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();
--
2.38.1


2023-06-12 23:06:12

by srinivas pandruvada

[permalink] [raw]
Subject: [PATCH 2/2] platform/x86: ISST: Fix usage counter

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().

Signed-off-by: Srinivas Pandruvada <[email protected]>
---
drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
index 664d2ee60385..63faa2ea8327 100644
--- a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
+++ b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
@@ -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;
--
2.38.1


2023-06-13 10:57:22

by Hans de Goede

[permalink] [raw]
Subject: Re: [PATCH 0/2] TPMI updates for SST

Hi,

On 6/13/23 00:40, Srinivas Pandruvada wrote:
> 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




> 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(+)
>