@@ -763,6 +763,35 @@ static void cxl_dport_map_regs(struct cxl_dport *dport)
763
763
cxl_dport_map_rch_aer (dport );
764
764
}
765
765
766
+ static void cxl_disable_rch_root_ints (struct cxl_dport * dport )
767
+ {
768
+ void __iomem * aer_base = dport -> regs .dport_aer ;
769
+ struct pci_host_bridge * bridge ;
770
+ u32 aer_cmd_mask , aer_cmd ;
771
+
772
+ if (!aer_base )
773
+ return ;
774
+
775
+ bridge = to_pci_host_bridge (dport -> dport_dev );
776
+
777
+ /*
778
+ * Disable RCH root port command interrupts.
779
+ * CXL 3.0 12.2.1.1 - RCH Downstream Port-detected Errors
780
+ *
781
+ * This sequence may not be necessary. CXL spec states disabling
782
+ * the root cmd register's interrupts is required. But, PCI spec
783
+ * shows these are disabled by default on reset.
784
+ */
785
+ if (bridge -> native_cxl_error ) {
786
+ aer_cmd_mask = (PCI_ERR_ROOT_CMD_COR_EN |
787
+ PCI_ERR_ROOT_CMD_NONFATAL_EN |
788
+ PCI_ERR_ROOT_CMD_FATAL_EN );
789
+ aer_cmd = readl (aer_base + PCI_ERR_ROOT_COMMAND );
790
+ aer_cmd &= ~aer_cmd_mask ;
791
+ writel (aer_cmd , aer_base + PCI_ERR_ROOT_COMMAND );
792
+ }
793
+ }
794
+
766
795
void cxl_setup_parent_dport (struct device * host , struct cxl_dport * dport )
767
796
{
768
797
struct device * dport_dev = dport -> dport_dev ;
@@ -774,6 +803,9 @@ void cxl_setup_parent_dport(struct device *host, struct cxl_dport *dport)
774
803
775
804
dport -> reg_map .host = host ;
776
805
cxl_dport_map_regs (dport );
806
+
807
+ if (dport -> rch )
808
+ cxl_disable_rch_root_ints (dport );
777
809
}
778
810
EXPORT_SYMBOL_NS_GPL (cxl_setup_parent_dport , CXL );
779
811
0 commit comments