In reference to the TDM_LOOPBACK_TEST.c within TDM driver of SDK1.9
TDM_LOOPBACK_TEST is not dependable…
The way TDM_LOOPBACK_TEST.c is written one is bound to get erroneous results claiming that this test is PASSing when indeed it does not…
Since, if too many poll cycles where shortened by continue; j variable might never get higher than BUF_COUNT which is equal 5 in which case tdm_check_data() never gets entered thus data is not compared and test returns PASSing results… If one will redefine POLL_COUNT to be 60 or higher I assure you that you will see this test FAILing every time…
#define POLL_COUNT 15
#define BUF_COUNT 5
static int poll_count = POLL_COUNT;
...
int poll = 0;
...
while ( ( poll < poll_count ) && !kthread_should_stop() )
{
poll++;
ret = tdm_ch_poll( h_channel1, 10 );
if ( ret != TDM_E_OK )
continue;
...
...
if ( ++j >= BUF_COUNT )
error_count += tdm_check_data( tx_data[ ( index + 1 ) % BUF_COUNT ], rx_data[ index ] );
index++;
index = index % BUF_COUNT;
}
...
if ( ( error_count == 0 ) && ( j != 0 ) )
pr_info( "%s TDM loopback test PASSED!\n", in_loopback ? "Internal" : "External" );
else
pr_info( "%s TDM loopback test FAILED!\n", in_loopback ? "Internal" : "External" );
Thanks
Naum
Here is the proof of what I am claiming all along…
Same test is being run every time after power cycle…
It may arbitrarily PASS or FAIL depending on how many
continue; statements the while loop was forced to use…
Switching control for channel 1 is 20
Operating Fun for channel 2 is a0
Cadence Timer Reg for CH2 before is 7 ff0 0
Cadence Timer Reg for CH2 after is 1 903 20
Switching control for channel 2 is 20
SLIC 2 configuration success
TDM LOOPBACK TEST:
TDM Driver(ID=1)is attached with Adapterfsl_tdm(ID = 0) drv_count=1
TDM LOOPBACK TEST module installed
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 4 ports detected
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
snd-soc-p1022ds: missing/invalid global utils node
ipip: IPv4 over IPv4 tunneling driver
TCP: cubic registered
Initializing XFRM netlink socket
NET: Registered protocol family 10
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
NET: Registered protocol family 15
Key type dns_resolver registered
/home/ngrutman/QorIQ-SDK-V1.9-20151210-yocto/build_p1020rdb/tmp/work-shared/p1020rdb/kernel-source/drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
snd-soc-p1022rdk: missing/invalid global utils node
ALSA device list:
No soundcards found.
TDM Loopback test completed... continued=11 and j=4
Internal TDM loopback test PASSED!
ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 0)
ata1.00: ATA-8: WDC WD3200BEKT-60PVMR0, 01.01A01, max UDMA/133
ata1.00: 625142448 sectors, multi 0: LBA48 NCQ (depth 31/32)
ata1.00: configured for UDMA/100
scsi 0:0:0:0: Direct-Access ATA WDC WD3200BEKT-6 01.0 PQ: 0 ANSI: 5
sd 0:0:0:0: [sda] 625142448 512-byte logical blocks: (320 GB/298 GiB)
sd 0:0:0:0: [sda] 4096-byte physical blocks
sd 0:0:0:0: Attached scsi generic sg0 type 0
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
sda: sda1 sda2 sda3 sda4
...
...
...
Switching control for channel 2 is 20
SLIC 2 configuration success
TDM LOOPBACK TEST:
TDM Driver(ID=1)is attached with Adapterfsl_tdm(ID = 0) drv_count=1
TDM LOOPBACK TEST module installed
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
snd-soc-p1022ds: missing/invalid global utils node
ipip: IPv4 over IPv4 tunneling driver
TCP: cubic registered
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 4 ports detected
Initializing XFRM netlink socket
NET: Registered protocol family 10
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
NET: Registered protocol family 15
Key type dns_resolver registered
/home/ngrutman/QorIQ-SDK-V1.9-20151210-yocto/build_p1020rdb/tmp/work-shared/p1020rdb/kernel-source/drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
snd-soc-p1022rdk: missing/invalid global utils node
ALSA device list:
No soundcards found.
TX and RX buffer do NOT match. Err_count:79
TDM Loopback test completed... continued=10 and j=5
Internal TDM loopback test FAILED!
ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 0)
ata1.00: ATA-8: WDC WD3200BEKT-60PVMR0, 01.01A01, max UDMA/133
ata1.00: 625142448 sectors, multi 0: LBA48 NCQ (depth 31/32)
ata1.00: configured for UDMA/100
scsi 0:0:0:0: Direct-Access ATA WDC WD3200BEKT-6 01.0 PQ: 0 ANSI: 5
sd 0:0:0:0: [sda] 625142448 512-byte logical blocks: (320 GB/298 GiB)
sd 0:0:0:0: [sda] 4096-byte physical blocks
sd 0:0:0:0: Attached scsi generic sg0 type 0
sd 0:0:0:0: [sda] Write Protect is off
Hello Naum Grutman,
Please refer to TDM Driver Working in Internal Loopback mode During Validation , please use the file tdm_loopback_test.c which I provided recently.
Have a great day,
Yiping
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Yiping,
Thank you for your attention to this issue...
I am out of the office until January 3rd...
I will try your new proposed test as soon as I get back to the office
on Jan 3rd and let you know of the progress...
Meanwhile, I wish Happy New Year...
Thanks again,
Naum