Linux PTP driver issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Linux PTP driver issue

Jump to solution
478 Views
thousel
Contributor I

Hi. I'm using LinuxPTP on an i.MX7D (on a Compulab module), and I think I've found an issue with the PTP driver in drivers/net/ethernet/freescale/fec_ptp.c (which is still in the current git head at https://github.com/nxp-imx/linux-imx/blob/lf-6.12.y/drivers/net/ethernet/freescale/fec_ptp.c)

The issue is that the ENETx_ATCOR register (called FEC_ATIME_CORR in the driver) is not initialized in fec_ptp_start_cyclecounter. If fec_ptp_adjfine sets it to a weird place, there's no way to fix it, except for rebooting. Since ENETx_ATINC (FEC_ATIME_INC) is reinitialized in fec_ptp_start_cyclecounter, ENETx_ATCOR should be as well (to its reset value of 0 I believe).

Otherwise if ENETx_ATCOR starts at a bad value, LinuxPTP can get into states where it won't converge.

Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
444 Views
pengyong_zhang
NXP Employee
NXP Employee

Hi @thousel 

Thanks for your suggestion, i will contact with our sw team talk about this.

B.R

View solution in original post

0 Kudos
Reply
1 Reply
445 Views
pengyong_zhang
NXP Employee
NXP Employee

Hi @thousel 

Thanks for your suggestion, i will contact with our sw team talk about this.

B.R

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2173960%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ELinux%20PTP%20driver%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2173960%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi.%20I'm%20using%20LinuxPTP%20on%20an%20i.MX7D%20(on%20a%20Compulab%20module)%2C%20and%20I%20think%20I've%20found%20an%20issue%20with%20the%20PTP%20driver%20in%26nbsp%3Bdrivers%2Fnet%2Fethernet%2Ffreescale%2Ffec_ptp.c%20(which%20is%20still%20in%20the%20current%20git%20head%20at%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fnxp-imx%2Flinux-imx%2Fblob%2Flf-6.12.y%2Fdrivers%2Fnet%2Fethernet%2Ffreescale%2Ffec_ptp.c%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fnxp-imx%2Flinux-imx%2Fblob%2Flf-6.12.y%2Fdrivers%2Fnet%2Fethernet%2Ffreescale%2Ffec_ptp.c%3C%2FA%3E)%3C%2FP%3E%3CP%3EThe%20issue%20is%20that%20the%20ENETx_ATCOR%20register%20(called%20FEC_ATIME_CORR%20in%20the%20driver)%20is%20not%20initialized%20in%20fec_ptp_start_cyclecounter.%20If%26nbsp%3Bfec_ptp_adjfine%20sets%20it%20to%20a%20weird%20place%2C%20there's%20no%20way%20to%20fix%20it%2C%20except%20for%20rebooting.%20Since%26nbsp%3BENETx_ATINC%20(FEC_ATIME_INC)%20is%20reinitialized%20in%26nbsp%3Bfec_ptp_start_cyclecounter%2C%26nbsp%3BENETx_ATCOR%20should%20be%20as%20well%20(to%20its%20reset%20value%20of%200%20I%20believe).%3C%2FP%3E%3CP%3EOtherwise%20if%26nbsp%3BENETx_ATCOR%20starts%20at%20a%20bad%20value%2C%20LinuxPTP%20can%20get%20into%20states%20where%20it%20won't%20converge.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2173960%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3Ei.MX7Dual%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2174160%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Linux%20PTP%20driver%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2174160%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F233489%22%20target%3D%22_blank%22%3E%40thousel%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20for%20your%20suggestion%2C%20i%20will%20contact%20with%20our%20sw%20team%20talk%20about%20this.%3C%2FP%3E%0A%3CP%3EB.R%3C%2FP%3E%3C%2FLINGO-BODY%3E