]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
platform/x86/intel/tpmi/plr: Prevent fault during unbind
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Thu, 30 Apr 2026 15:11:03 +0000 (08:11 -0700)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Thu, 7 May 2026 13:06:29 +0000 (16:06 +0300)
commit14473e8c4e97d51eff9b2f384ae696f7a32f182b
tree5ada87b47f50f743fb5ae3b089a42dfbd5fe5e4b
parent57c347a2e2473bfb5c1f1132a3209c55efbe640b
platform/x86/intel/tpmi/plr: Prevent fault during unbind

This driver faults when intel vsec driver is unbound from PCI driver
interface. For example:

echo 0000:00:03.1 > /sys/bus/pci/drivers/intel_vsec/unbind

This is caused by accessing plr->dbgfs_dir after vsec_tpmi driver is
removed. Here vsec_tpmi driver is the parent. On unbind, the parent
device remove callback is called first which here will remove debugfs
interface. Hence plr->dbgfs_dir is no longer valid.

Register notifier for TPMI_CORE_EXIT and make this pointer to NULL,
so that debugfs_remove_recursive() is not called with bad plr->dbgfs_dir
pointer.

After notifier is returned the vsec_tpmi driver will call remove debugfs
by calling debugfs_remove_recursive().

Fixes: 811f67c51636 ("platform/x86/intel/tpmi: Add new auxiliary driver for performance limits")
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Stable@vger.kernel.org
Link: https://patch.msgid.link/20260430151103.1549733-4-srinivas.pandruvada@linux.intel.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/intel/plr_tpmi.c