U-Boot patched with bugfix "link not estblished reliably" has strange behaviour w.r.t. pci functionality

We merged your patched U-Boot with the bugfix “physical link not established reliably” into our U-Boot.

On one single TK1 SOM assembled into the Apalis Eval Board when I execute pci enum the first time an error occurs and u-boot resets. When I abort the autoboot after the reset and execute pci enum again another error occurs.

Apalis TK1 # pci enum                                                                                                             
data abort                                                                                                                        
pc : [<fff423e8>]          lr : [<fff6f9b0>]                                                                                      
reloc pc : [<801133e8>]    lr : [<801409b0>]                                                                                      
sp : fda11840  ip : 00000001     fp : fda21258                                                                                    
r10: 00000000  r9 : fda1eee0     r8 : fda1f0b0                                                                                    
r7 : fda213c4  r6 : fffaaa74     r5 : fff96da8  r4 : fffaf16c                                                                     
r3 : 7009f000  r2 : 1c880077     r1 : fff96da8  r0 : fffaaa74                                                                     
Flags: NzCv  IRQs off  FIQs off  Mode SVC_32                                                                                      
Resetting CPU ...                                                                                                                 
                                                                                                                                  
resetting ...                                                                                                                     
                                                                                                                                  
                                                                                                                                  
U-Boot 2016.11-00119-g992e9f344b (Aug 23 2017 - 11:10:22 +0200)                                                                   
                                                                                                                                  
TEGRA124                                                                                                                          
DRAM:  2 GiB                                                                                                                      
MMC:   Tegra SD/MMC: 0, Tegra SD/MMC: 1, Tegra SD/MMC: 2                                                                          
In:    serial                                                                                                                     
Out:   serial                                                                                                                     
Err:   serial                                                                                                                     
Model: Toradex Apalis TK1 2GB V1.1A, Serial# 02911982                                                                             
Initializing leds...                                                                                                              
Net:   No ethernet found.                                                                                                         
Hit any key to stop autoboot:  0
Apalis TK1 # pci enum                                                                                                             
ERROR: failed to enable LDO9: -22                                                                                                 
                                                                                                                                  
at board/toradex/apalis-tk1/apalis-tk1.c:221/tegra_pcie_board_port_reset()                                                        
ERROR: failed to enable LDO9: -22                                                                                                 
                                                                                                                                  
at board/toradex/apalis-tk1/apalis-tk1.c:221/tegra_pcie_board_port_reset()                                                        
ERROR: failed to enable LDO9: -22                                                                                                 
                                                                                                                                  
at board/toradex/apalis-tk1/apalis-tk1.c:221/tegra_pcie_board_port_reset()                                                        
ERROR: failed to enable LDO9: -22

On the same SOM assembled into our custom baseboard I had a slightly different behaviour. When I execute pci enum the first time an error occurs and u-boot resets. When I abort the autoboot after the reset and execute pci enum again the pci devices can be detected and listed as usual.

Apalis TK1 # pci                                                                
No such bus                                                                     
Apalis TK1 # pci enum                                                           
data abort                                                                      
pc : [<fff423e8>]          lr : [<fff6f9b0>]                                    
reloc pc : [<801133e8>]    lr : [<801409b0>]                                    
sp : fda11840  ip : 00000001     fp : fda21258                                  
r10: 00000000  r9 : fda1eee0     r8 : fda1f0b0                                  
r7 : fda213c4  r6 : fffaaa74     r5 : fff96da8  r4 : fffaf16c                   
r3 : 7009f000  r2 : 16880077     r1 : fff96da8  r0 : fffaaa74                   
Flags: NzCv  IRQs off  FIQs off  Mode SVC_32                                    
Resetting CPU ...                                                               
                                                                                
resetting ...                                                                   
                                                                                
                                                                                
U-Boot 2016.11-00119-g992e9f344b (Aug 23 2017 - 11:10:22 +0200)                 
                                                                                
TEGRA124                                                                        
DRAM:  2 GiB                                                                    
MMC:   Tegra SD/MMC: 0, Tegra SD/MMC: 1, Tegra SD/MMC: 2                        
In:    serial                                                                   
Out:   serial                                                                   
Err:   serial                                                                   
Model: Toradex Apalis TK1 2GB V1.1A, Serial# 02911982                           
Initializing leds...                                                            
Net:   No ethernet found.                                                       
Hit any key to stop autoboot:  0                                                
Apalis TK1 # pci enum                                                           
Apalis TK1 # pci                                                                
Scanning PCI devices on bus 0                                                   
BusDevFun  VendorId   DeviceId   Device Class       Sub-Class                   
_____________________________________________________________                   
00.02.00   0x10de     0x0e13     Bridge device           0x04                   
Apalis TK1 #

Do you have an idea what the root cause of this behaviour could be?

While I vaguely recall having seen this once before I don’t think it ever happened with any clean build. As mentioned before we also run validation & verification tests with U-Boot in regards to gigabit Ethernet resp. PCIe enumeration and have never seen any such issue.

If this is indeed reproducible could you elaborate on the exact versions of things (both hardware as well as software) this is happening?

BTW: Meanwhile we did release 2.7b4.

I don’t think that it relates to your image. I just thought that you could have observed this behaviour during development as well (e.g. flash procedure did not work properly). Thanks for the notification.

Yes, as mentioned above I did. However I do not know what exactly caused it.