mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] PCI: dwc: tegra194: Clear event counter masks before programming
@ 2026-11-02  6:38 Hans Zhang
  2026-11-07 21:50 ` Manivannan Sadhasivam
  0 siblings, 1 reply; 3+ 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	[flat|nested] 3+ 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-07 21:50 ` Manivannan Sadhasivam
  2026-11-07 23:15   ` Hans Zhang
  0 siblings, 1 reply; 3+ messages in thread
From: Manivannan Sadhasivam @ 2026-11-07 21:50 UTC (permalink / raw)
  To: Hans Zhang
  Cc: bhelgaas, lpieralisi, kwilczynski, mani, jonathanh,
	thierry.reding, robh, linux-tegra, linux-pci, linux-kernel

On 2026-11-02 14:38 +0800, Hans Zhang wrote:
> 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>

This patch got superseded by this commit:
https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/commit/?h=controller/dwc&id=fe84c0b370889bbf65f75bb75a1810227c7ce150

- Mani



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

* Re: [PATCH] PCI: dwc: tegra194: Clear event counter masks before programming
  2026-11-07 21:50 ` Manivannan Sadhasivam
@ 2026-11-07 23:15   ` Hans Zhang
  0 siblings, 0 replies; 3+ messages in thread
From: Hans Zhang @ 2026-11-07 23:15 UTC (permalink / raw)
  To: Manivannan Sadhasivam
  Cc: bhelgaas, lpieralisi, kwilczynski, mani, jonathanh,
	thierry.reding, robh, linux-tegra, linux-pci, linux-kernel



On 11/8/26 05:50, Manivannan Sadhasivam wrote:
> On 2026-11-02 14:38 +0800, Hans Zhang wrote:
>> 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>
> 
> This patch got superseded by this commit:
> https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/commit/?h=controller/dwc&id=fe84c0b370889bbf65f75bb75a1810227c7ce150
> 
> - Mani
> 

Hello Mani,

This is an evaluation comment from Bjorn regarding me. I didn't notice 
that Manikanta Maddireddy had made the changes. Please drop this patch.


https://lore.kernel.org/linux-pci/20261019171244.GA2200874@bhelgaas/


Best regards,
Hans


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

end of thread, other threads:[~2026-11-07 23:16 UTC | newest]

Thread overview: 3+ 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-07 21:50 ` Manivannan Sadhasivam
2026-11-07 23:15   ` Hans Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®