提交 7122bcb3 编写于 作者: P Pali Rohár 提交者: Lorenzo Pieralisi

PCI: aardvark: Optimize writing PCI_EXP_RTCTL_PMEIE and PCI_EXP_RTSTA_PME on emulated bridge

To optimize advk_pci_bridge_emul_pcie_conf_write() code, touch
PCIE_ISR0_REG and PCIE_ISR0_MASK_REG registers only when it is really
needed, when processing PCI_EXP_RTCTL_PMEIE and PCI_EXP_RTSTA_PME bits.

Link: https://lore.kernel.org/r/20220110015018.26359-16-kabel@kernel.orgSigned-off-by: NPali Rohár <pali@kernel.org>
Signed-off-by: NMarek Behún <kabel@kernel.org>
Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
上级 735f5ae4
...@@ -925,19 +925,21 @@ advk_pci_bridge_emul_pcie_conf_write(struct pci_bridge_emul *bridge, ...@@ -925,19 +925,21 @@ advk_pci_bridge_emul_pcie_conf_write(struct pci_bridge_emul *bridge,
advk_pcie_wait_for_retrain(pcie); advk_pcie_wait_for_retrain(pcie);
break; break;
case PCI_EXP_RTCTL: { case PCI_EXP_RTCTL:
/* Only mask/unmask PME interrupt */ /* Only mask/unmask PME interrupt */
u32 val = advk_readl(pcie, PCIE_ISR0_MASK_REG) & if (mask & PCI_EXP_RTCTL_PMEIE) {
~PCIE_MSG_PM_PME_MASK; u32 val = advk_readl(pcie, PCIE_ISR0_MASK_REG);
if ((new & PCI_EXP_RTCTL_PMEIE) == 0) if (new & PCI_EXP_RTCTL_PMEIE)
val |= PCIE_MSG_PM_PME_MASK; val &= ~PCIE_MSG_PM_PME_MASK;
advk_writel(pcie, val, PCIE_ISR0_MASK_REG); else
val |= PCIE_MSG_PM_PME_MASK;
advk_writel(pcie, val, PCIE_ISR0_MASK_REG);
}
break; break;
}
case PCI_EXP_RTSTA: case PCI_EXP_RTSTA:
new = (new & PCI_EXP_RTSTA_PME) >> 9; if (new & PCI_EXP_RTSTA_PME)
advk_writel(pcie, new, PCIE_ISR0_REG); advk_writel(pcie, PCIE_MSG_PM_PME_MASK, PCIE_ISR0_REG);
break; break;
case PCI_EXP_DEVCTL: case PCI_EXP_DEVCTL:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册