[PATCH 10/12] perf/x86/intel/uncore: Program SNR PCIe3 upper filter before enable
From: Zide Chen
Date: Fri Dec 04 2026 - 22:34:49 EST
snr_uncore_pci_enable_event() wrote the enable bit before programming
the upper filter dword, risking stale filtering. Switch snr_uncore_pcie3
to ivbep_uncore_pci_ops, which safely writes the upper dword first, and
drop the redundant custom ops.
Fixes: a3b1e8451d3f ("perf/x86/intel/uncore: Support PCIe3 unit on Snow Ridge")
Signed-off-by: Zide Chen <zide.chen@xxxxxxxxx>
---
arch/x86/events/intel/uncore_snbep.c | 20 +-------------------
1 file changed, 1 insertion(+), 19 deletions(-)
diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index 3f6fd636829a..4bc7e10fcaba 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -4885,24 +4885,6 @@ static struct intel_uncore_type snr_uncore_m2m = {
.format_group = &snr_m2m_uncore_format_group,
};
-static void snr_uncore_pci_enable_event(struct intel_uncore_box *box, struct perf_event *event)
-{
- struct pci_dev *pdev = box->pci_dev;
- struct hw_perf_event *hwc = &event->hw;
-
- pci_write_config_dword(pdev, hwc->config_base, (u32)(hwc->config | SNBEP_PMON_CTL_EN));
- pci_write_config_dword(pdev, hwc->config_base + 4, (u32)(hwc->config >> 32));
-}
-
-static struct intel_uncore_ops snr_pcie3_uncore_pci_ops = {
- .init_box = snr_m2m_uncore_pci_init_box,
- .disable_box = snbep_uncore_pci_disable_box,
- .enable_box = snbep_uncore_pci_enable_box,
- .disable_event = snbep_uncore_pci_disable_event,
- .enable_event = snr_uncore_pci_enable_event,
- .read_counter = snbep_uncore_pci_read_counter,
-};
-
static struct intel_uncore_type snr_uncore_pcie3 = {
.name = "pcie3",
.num_counters = 4,
@@ -4914,7 +4896,7 @@ static struct intel_uncore_type snr_uncore_pcie3 = {
.event_mask_ext = SKX_IIO_PMON_RAW_EVENT_MASK_EXT,
.box_ctl = SNR_PCIE3_PCI_PMON_BOX_CTL,
.ctl_offs8 = 1,
- .ops = &snr_pcie3_uncore_pci_ops,
+ .ops = &ivbep_uncore_pci_ops,
.format_group = &skx_uncore_iio_format_group,
};
--
2.56.1