mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
PCI: aardvark: Fix PCI_EXP_RTCTL register configuration
commitc0f05a6ab5upstream. PCI_EXP_RTCTL is used to activate PME interrupt only, so writing into it should not modify other interrupts' mask. The ISR mask polarity was also inverted, when PCI_EXP_RTCTL_PMEIE is set PCIE_MSG_PM_PME_MASK mask bit should actually be cleared. Fixes:8a3ebd8de3("PCI: aardvark: Implement emulated root PCI bridge config space") Signed-off-by: Remi Pommarel <repk@triplefau.lt> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Acked-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
8bb461eced
commit
ec93279384
@@ -428,7 +428,7 @@ advk_pci_bridge_emul_pcie_conf_read(struct pci_bridge_emul *bridge,
|
||||
|
||||
case PCI_EXP_RTCTL: {
|
||||
u32 val = advk_readl(pcie, PCIE_ISR0_MASK_REG);
|
||||
*value = (val & PCIE_MSG_PM_PME_MASK) ? PCI_EXP_RTCTL_PMEIE : 0;
|
||||
*value = (val & PCIE_MSG_PM_PME_MASK) ? 0 : PCI_EXP_RTCTL_PMEIE;
|
||||
return PCI_BRIDGE_EMUL_HANDLED;
|
||||
}
|
||||
|
||||
@@ -478,10 +478,15 @@ advk_pci_bridge_emul_pcie_conf_write(struct pci_bridge_emul *bridge,
|
||||
advk_pcie_wait_for_retrain(pcie);
|
||||
break;
|
||||
|
||||
case PCI_EXP_RTCTL:
|
||||
new = (new & PCI_EXP_RTCTL_PMEIE) << 3;
|
||||
advk_writel(pcie, new, PCIE_ISR0_MASK_REG);
|
||||
case PCI_EXP_RTCTL: {
|
||||
/* Only mask/unmask PME interrupt */
|
||||
u32 val = advk_readl(pcie, PCIE_ISR0_MASK_REG) &
|
||||
~PCIE_MSG_PM_PME_MASK;
|
||||
if ((new & PCI_EXP_RTCTL_PMEIE) == 0)
|
||||
val |= PCIE_MSG_PM_PME_MASK;
|
||||
advk_writel(pcie, val, PCIE_ISR0_MASK_REG);
|
||||
break;
|
||||
}
|
||||
|
||||
case PCI_EXP_RTSTA:
|
||||
new = (new & PCI_EXP_RTSTA_PME) >> 9;
|
||||
|
||||
Reference in New Issue
Block a user