* [PATCH] PCI: dwc: tegra194: Clear event counter masks before programming
@ 2026-11-02 6:38 Hans Zhang
2026-11-02 6:41 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Hans Zhang @ 2026-11-02 6:38 UTC (permalink / raw)
To: bhelgaas, lpieralisi, kwilczynski, mani, jonathanh,
thierry.reding
Cc: robh, linux-tegra, linux-pci, linux-kernel, Hans Zhang
When programming the RAS-DES event counter control register, the code only
cleared the event-selection field before OR-ing in the new group, event,
and enable values. This leaves stale bits in the group-select and enable
fields from prior writes.
Clear all three field masks before programming the register so that stale
bits are not preserved across updates.
No functional change intended beyond ensuring the register is rewritten
without carrying over previous field values.
Signed-off-by: Hans Zhang <18255117159@163.com>
---
drivers/pci/controller/dwc/pcie-tegra194.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
index 26e2ac5c5869..7a0aca54667c 100644
--- a/drivers/pci/controller/dwc/pcie-tegra194.c
+++ b/drivers/pci/controller/dwc/pcie-tegra194.c
@@ -623,7 +623,9 @@ static inline u32 event_counter_prog(struct tegra_pcie_dw *pcie, u32 event)
val = dw_pcie_readl_dbi(&pcie->pci, pcie->ras_des_cap +
RAS_DES_EVENT_COUNTER_CONTROL);
- val &= ~EVENT_COUNTER_EVENT_SEL_MASK;
+ val &= ~(EVENT_COUNTER_EVENT_SEL_MASK |
+ EVENT_COUNTER_GROUP_SEL_MASK |
+ EVENT_COUNTER_ENABLE_MASK);
val |= FIELD_PREP(EVENT_COUNTER_GROUP_SEL_MASK, EVENT_COUNTER_GROUP_5);
val |= FIELD_PREP(EVENT_COUNTER_EVENT_SEL_MASK, event);
val |= FIELD_PREP(EVENT_COUNTER_ENABLE_MASK, EVENT_COUNTER_ENABLE_ALL);
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] PCI: dwc: tegra194: Clear event counter masks before programming
2026-11-02 6:38 [PATCH] PCI: dwc: tegra194: Clear event counter masks before programming Hans Zhang
@ 2026-11-02 6:41 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-02 6:41 UTC (permalink / raw)
To: Hans Zhang; +Cc: linux-pci
> When programming the RAS-DES event counter control register, the code only
> cleared the event-selection field before OR-ing in the new group, event,
> and enable values. This leaves stale bits in the group-select and enable
> fields from prior writes.
>
> Clear all three field masks before programming the register so that stale
> bits are not preserved across updates.
>
> No functional change intended beyond ensuring the register is rewritten
> without carrying over previous field values.
>
> Signed-off-by: Hans Zhang <18255117159@163.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261102063835.3831940-1-18255117159@163.com?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-02 6:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-02 6:38 [PATCH] PCI: dwc: tegra194: Clear event counter masks before programming Hans Zhang
2026-11-02 6:41 ` sashiko-bot
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.