This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/TDA2: pci_endpoint_test not registering device in /dev

Part Number: TDA2

Tool/software: Linux

Hello, I am trying to test a PCIe connection between a PC running Ubuntu 16.04 with kernel 4.16.7 and a TDA2p's ARM running kernel 4.4.84.

I have followed the instructions from this link: http://processors.wiki.ti.com/index.php/Linux_Core_PCIe_EP_User%27s_Guide and managed to run the TDA2p's PCIe controller in EP mode. I can verify this because the PC enumerated it as an Endpoint (this info obtained from lspci output on PC).

When inserting pci_endpoint_test module on PC there are no errors present in dmesg output but the pcitest.sh does not work, says that there is no endpoint test device registered. Upon futher inspection, I've seen that the pci_endpoint_test module is supposed to register a misc device that is to be bound to the endpoint test. However, there is not any device like this in /dev.

Thank you for the help in advance.

Regards,

Nick

  • Hi Nick,

    Can you please describe the sequence of operations being followed? Are you powering the TDA2P board after the PC is powered up? 

    If this is the case you may need to rescan the bus after inserting the PCIe? You can also try to remove the parent PCIe bridge before running the rescan of the bus (The below example assumes the parent bridge is 0000\:00\:1d.0. To get the bridge run lspci -tvv)

    echo 1 > /sys/bus/pci/devices/0000\:00\:1d.0/remove 

    echo 1 > /sys/bus/pci/rescan

    Regards
    Shravan

  • Hi Shravan,

    This is not giving me trouble, PC correctly enumerates the TDA2p. The question is related to pci_endpoint_test module that is to be inserted on RC side. I've looked into the code and it is supposed to create an endpoint test device but there were no errors while modprobing so I am not sure what the problem is.

    Regards,
    Nick
  • Hi Nick,

    Can you please attach the output of lscpi -vv run on your PC? It could be the endpoint test driver isn't bound to the TDA2P device.
    Also can you attach the dmesg logs from your PC?

    Regards
    Shravan
  • Hi Shravan,

    I have attached two files with this post, 'lspci_log.txt' is a lspci output of the TDA2p device on PCIe bus and the 'dmesg_log.txt' is a dmesg output after executing 'sudo modprobe pci_endpoint_test' and that module is present in lsmod output.

    lspci_log.txt
    06:00.0 Unassigned class [ff00]: Texas Instruments Device ffff
    	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
    	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
    	Latency: 0, Cache Line Size: 64 bytes
    	Interrupt: pin A routed to IRQ 11
    	Region 0: Memory at f7c06000 (32-bit, non-prefetchable) [size=256]
    	Region 1: Memory at f7c05000 (32-bit, non-prefetchable) [size=512]
    	Region 2: Memory at f7c04000 (32-bit, non-prefetchable) [size=1K]
    	Region 3: Memory at f7c00000 (32-bit, non-prefetchable) [size=16K]
    	Region 4: Memory at <unassigned> (32-bit, prefetchable)
    	Capabilities: [40] Power Management version 3
    		Flags: PMEClk- DSI- D1+ D2- AuxCurrent=0mA PME(D0+,D1+,D2-,D3hot+,D3cold-)
    		Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
    	Capabilities: [50] MSI: Enable- Count=1/16 Maskable- 64bit-
    		Address: 00000000  Data: 0000
    	Capabilities: [70] Express (v2) Endpoint, MSI 00
    		DevCap:	MaxPayload 256 bytes, PhantFunc 0, Latency L0s <64ns, L1 <1us
    			ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
    		DevCtl:	Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
    			RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop+
    			MaxPayload 128 bytes, MaxReadReq 512 bytes
    		DevSta:	CorrErr+ UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
    		LnkCap:	Port #0, Speed 5GT/s, Width x2, ASPM L0s L1, Exit Latency L0s <512ns, L1 <64us
    			ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp+
    		LnkCtl:	ASPM Disabled; RCB 64 bytes Disabled- CommClk-
    			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
    		LnkSta:	Speed 5GT/s, Width x2, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
    		DevCap2: Completion Timeout: Range ABCD, TimeoutDis+, LTR-, OBFF Not Supported
    		DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, OBFF Disabled
    		LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- SpeedDis-
    			 Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
    			 Compliance De-emphasis: -6dB
    		LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete-, EqualizationPhase1-
    			 EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
    	Capabilities: [100 v2] Advanced Error Reporting
    		UESta:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
    		UEMsk:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
    		UESvrt:	DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
    		CESta:	RxErr+ BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-
    		CEMsk:	RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
    		AERCap:	First Error Pointer: 00, GenCap+ CGenEn- ChkCap+ ChkEn-
    
    
    

    2133.dmesg_log.txt

    Regards,

    Nick

  • Hi Nick,

    Thank you for the logs. From your logs its clear that the endpoint-test driver isn't bound to the endpoint device.
    Which kernel version are you using? If you're using kernel 4.4 please set the vendor_id and MSI interrupt count as per the instructions mentioned in the PCIe EP User guide. If you're using the kernel 4.9 and beyond please set the device_id in addition to the vendor_id and MSI count.

    Regards
    Shravan
  • Hi Shravan,

    I use kernel 4.4.84 and I'm executing the following script on my TDA2p before I power up the PC and insert the pci_endpoint_test module.

    #!/bin/sh
    modprobe pci_epf_test
    mount -t configfs none /sys/kernel/config
    cd /sys/kernel/config/pci_ep/
    mkdir pci_epf_test.0
    cd pci_epf_test.0
    echo 0x104c > vendorid
    echo 16 > msi_interrupts
    echo "51000000.pcie_ep" > epc

    I think that everything here is done according to the instructions.

    Regards,
    Nick

  • Hi Nick,

    Can you set CONFIG_PCI_EPF_TEST=y instead of building it as a module and see if the issue is still observed? I would assume CONFIG_PCI_ENDPOINT and CONFIG_PCI_DRA7XX_EP are inbuilt.

    Regards
    Shravan
  • Hi Nick,

    As an additional step, can you also set the device id (as indicated in the instruction for the 4.9 kernel, this is in addition to the vendor-id and msi count).
    If it still fails, can you add prints in the probe of the pci_endpoint_test and let us know where the probe fails.

    Regards
    Shravan
  • Hi Shravan,

    It seems that something is wrong with the PCIe slot (or something else) of my PC. I tried the test on another one and it worked. Sorry for the inconvenience and thank you for your help so far.

    Regards,
    Nick
  • Hi Nick,

    No issues. Thank you for the update. I will close this thread now.

    Regards
    Shravan