@@ -579,7 +579,8 @@ static void __init pci_mmcfg_reject_broken(int early)
579579
580580 list_for_each_entry (cfg , & pci_mmcfg_list , list ) {
581581 if (pci_mmcfg_check_reserved (NULL , cfg , early ) == 0 ) {
582- pr_info (PREFIX "not using MMCONFIG\n" );
582+ pr_info (PREFIX "not using MMCONFIG (%pR not reserved)\n" ,
583+ & cfg -> res );
583584 free_all_mmcfg ();
584585 return ;
585586 }
@@ -676,6 +677,8 @@ static int pci_mmcfg_for_each_region(int (*func)(__u64 start, __u64 size,
676677
677678static void __init __pci_mmcfg_init (int early )
678679{
680+ pr_debug (PREFIX "%s(%s)\n" , __func__ , early ? "early" : "late" );
681+
679682 pci_mmcfg_reject_broken (early );
680683 if (list_empty (& pci_mmcfg_list ))
681684 return ;
@@ -702,6 +705,8 @@ static int __initdata known_bridge;
702705
703706void __init pci_mmcfg_early_init (void )
704707{
708+ pr_debug (PREFIX "%s() pci_probe %#x\n" , __func__ , pci_probe );
709+
705710 if (pci_probe & PCI_PROBE_MMCONF ) {
706711 if (pci_mmcfg_check_hostbridge ())
707712 known_bridge = 1 ;
@@ -715,6 +720,8 @@ void __init pci_mmcfg_early_init(void)
715720
716721void __init pci_mmcfg_late_init (void )
717722{
723+ pr_debug (PREFIX "%s() pci_probe %#x\n" , __func__ , pci_probe );
724+
718725 /* MMCONFIG disabled */
719726 if ((pci_probe & PCI_PROBE_MMCONF ) == 0 )
720727 return ;
@@ -735,6 +742,8 @@ static int __init pci_mmcfg_late_insert_resources(void)
735742
736743 pci_mmcfg_running_state = true;
737744
745+ pr_debug (PREFIX "%s() pci_probe %#x\n" , __func__ , pci_probe );
746+
738747 /* If we are not using MMCONFIG, don't insert the resources. */
739748 if ((pci_probe & PCI_PROBE_MMCONF ) == 0 )
740749 return 1 ;
@@ -744,9 +753,12 @@ static int __init pci_mmcfg_late_insert_resources(void)
744753 * marked so it won't cause request errors when __request_region is
745754 * called.
746755 */
747- list_for_each_entry (cfg , & pci_mmcfg_list , list )
748- if (!cfg -> res .parent )
756+ list_for_each_entry (cfg , & pci_mmcfg_list , list ) {
757+ if (!cfg -> res .parent ) {
758+ pr_debug (PREFIX "%s() insert %pR\n" , __func__ , & cfg -> res );
749759 insert_resource (& iomem_resource , & cfg -> res );
760+ }
761+ }
750762
751763 return 0 ;
752764}
@@ -766,6 +778,8 @@ int pci_mmconfig_insert(struct device *dev, u16 seg, u8 start, u8 end,
766778 struct resource * tmp = NULL ;
767779 struct pci_mmcfg_region * cfg ;
768780
781+ dev_dbg (dev , "%s(%04x [bus %02x-%02x])\n" , __func__ , seg , start , end );
782+
769783 if (!(pci_probe & PCI_PROBE_MMCONF ) || pci_mmcfg_arch_init_failed )
770784 return - ENODEV ;
771785
@@ -810,8 +824,7 @@ int pci_mmconfig_insert(struct device *dev, u16 seg, u8 start, u8 end,
810824 "%s %pR\n" ,
811825 & cfg -> res , tmp -> name , tmp );
812826 } else if (pci_mmcfg_arch_map (cfg )) {
813- dev_warn (dev , "fail to map MMCONFIG %pR.\n" ,
814- & cfg -> res );
827+ dev_warn (dev , "fail to map MMCONFIG %pR\n" , & cfg -> res );
815828 } else {
816829 list_add_sorted (cfg );
817830 dev_info (dev , "MMCONFIG at %pR (base %#lx)\n" ,
0 commit comments