All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] TPMI updates for SST
@ 2023-06-12 22:40 Srinivas Pandruvada
  2023-06-12 22:40 ` [PATCH 1/2] platform/x86: ISST: Reset default callback on unregister Srinivas Pandruvada
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Srinivas Pandruvada @ 2023-06-12 22:40 UTC (permalink / raw)
  To: hdegoede, markgross
  Cc: platform-driver-x86, linux-kernel, 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.

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] platform/x86: ISST: Reset default callback on unregister
  2023-06-12 22:40 [PATCH 0/2] TPMI updates for SST Srinivas Pandruvada
@ 2023-06-12 22:40 ` Srinivas Pandruvada
  2023-06-12 22:40 ` [PATCH 2/2] platform/x86: ISST: Fix usage counter Srinivas Pandruvada
  2023-06-13 10:35 ` [PATCH 0/2] TPMI updates for SST Hans de Goede
  2 siblings, 0 replies; 4+ messages in thread
From: Srinivas Pandruvada @ 2023-06-12 22:40 UTC (permalink / raw)
  To: hdegoede, markgross
  Cc: platform-driver-x86, linux-kernel, Srinivas Pandruvada

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 <srinivas.pandruvada@linux.intel.com>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] platform/x86: ISST: Fix usage counter
  2023-06-12 22:40 [PATCH 0/2] TPMI updates for SST Srinivas Pandruvada
  2023-06-12 22:40 ` [PATCH 1/2] platform/x86: ISST: Reset default callback on unregister Srinivas Pandruvada
@ 2023-06-12 22:40 ` Srinivas Pandruvada
  2023-06-13 10:35 ` [PATCH 0/2] TPMI updates for SST Hans de Goede
  2 siblings, 0 replies; 4+ messages in thread
From: Srinivas Pandruvada @ 2023-06-12 22:40 UTC (permalink / raw)
  To: hdegoede, markgross
  Cc: platform-driver-x86, linux-kernel, 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().

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] TPMI updates for SST
  2023-06-12 22:40 [PATCH 0/2] TPMI updates for SST Srinivas Pandruvada
  2023-06-12 22:40 ` [PATCH 1/2] platform/x86: ISST: Reset default callback on unregister Srinivas Pandruvada
  2023-06-12 22:40 ` [PATCH 2/2] platform/x86: ISST: Fix usage counter Srinivas Pandruvada
@ 2023-06-13 10:35 ` Hans de Goede
  2 siblings, 0 replies; 4+ messages in thread
From: Hans de Goede @ 2023-06-13 10:35 UTC (permalink / raw)
  To: Srinivas Pandruvada, markgross; +Cc: platform-driver-x86, linux-kernel

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-13 10:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-12 22:40 [PATCH 0/2] TPMI updates for SST Srinivas Pandruvada
2023-06-12 22:40 ` [PATCH 1/2] platform/x86: ISST: Reset default callback on unregister Srinivas Pandruvada
2023-06-12 22:40 ` [PATCH 2/2] platform/x86: ISST: Fix usage counter Srinivas Pandruvada
2023-06-13 10:35 ` [PATCH 0/2] TPMI updates for SST Hans de Goede

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.