Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test-ci: ptp_clock_test : test failure on frdm_k64f platform #38731

Closed
hakehuang opened this issue Sep 22, 2021 · 1 comment · Fixed by #38757
Closed

test-ci: ptp_clock_test : test failure on frdm_k64f platform #38731

hakehuang opened this issue Sep 22, 2021 · 1 comment · Fixed by #38757
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug platform: NXP NXP priority: low Low impact/importance bug

Comments

@hakehuang
Copy link
Collaborator

Describe the bug
ptp clock test failure
syscall z_vrfy_ptp_clock_get failed check: access denied

To Reproduce
Steps to reproduce the behavior:

  1. cd tests/net/ptp/clock; mkdir build; cd build
  2. cmake -DBOARD=frdm_k64f
  3. make
  4. See error

Expected behavior
Test pass

Impact
ptp usage

Logs and console output
If applicable, add console logs or other types of debug information
e.g Wireshark capture or Logic analyzer capture (upload in zip archive).
copy-and-paste text and put a code fence (```) before and after, to help
explain the issue. (if unable to obtain text log, add a screenshot)

    *** Booting Zephyr OS builW: iface 0x20008e84 is down

    d v2.7.0-rc2  ***

    Running test suite ptp_clock_test

    ===================================================================

    START - test_check_interfaces

     PASS - test_check_interfaces in 0.1 seconds

    ===================================================================

    START - test_address_setup

     PASS - test_address_setup in 0.1 seconds

    ===================================================================

    START - test_ptp_clock_interfaces

     PASS - test_ptp_clock_interfaces in 0.1 seconds

    ===================================================================

    START - test_ptp_clock_iface_1

     PASS - test_ptp_clock_iface_1 in 0.1 seconds

    ===================================================================

    START - test_ptp_clock_iface_2

     PASS - test_ptp_clock_iface_2 in 0.1 seconds

    ===================================================================

    START - test_ptp_clock_get_by_index

     PASS - test_ptp_clock_get_by_index in 0.1 seconds

    ===================================================================

    START - test_ptp_clock_get_by_index_user

     PASS - test_ptp_clock_get_by_index_user in 0.1 seconds

    ===================================================================

    START - test_ptp_clock_get_kernel

     PASS - test_ptp_clock_get_kernel in 0.1 seconds

    ===================================================================

    START - test_ptp_clock_get_user

    E: thread 0x200018a8 (4) does not have permission on ptp_clock driver 0x1ab08

    E: permission bitmap

    E: 00 00                   |..      

    E: syscall z_vrfy_ptp_clock_get failed check: access denied

    E: r0/a1:  0x00000000  r1/a2:  0x00000000  r2/a3:  0x00000000

    E: r3/a4:  0x00000000 r12/ip:  0x00000000 r14/lr:  0x00000000

    E:  xpsr:  0x00000000

    E: Faulting instruction address (r15/pc): 0x00000000

    E: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0

    E: Current thread: 0x200018a8 (test_ptp_clock_get_user)

    E: Halting system

Environment (please complete the following information):

  • OS: (e.g. Linux, )
  • Toolchain (e.g Zephyr SDK, )
  • Commit SHA or Version used: v2.7.0-rc2
@hakehuang hakehuang added the bug The issue is a bug, or the PR is fixing a bug label Sep 22, 2021
@hakehuang
Copy link
Collaborator Author

@dleach02

@nashif nashif added the priority: low Low impact/importance bug label Sep 22, 2021
@danieldegrasse danieldegrasse self-assigned this Sep 22, 2021
danieldegrasse added a commit to nxp-zephyr/zephyr that referenced this issue Sep 22, 2021
ptp_clock_test was failing when trying to access the ptp clock from user
mode. This was due to an arbitrary initialization priority between the
virtual PTP clock devices created by the ptp clocking test and the
physical PTP clock on the frdm_k64f board. Since the ptp test
initializes the virtual clock with the same device name as the physical
clock, if the physical clock was initialized first this test would
incorrectly reference the physical device during testing, instead of the
virtual one.

This fix simply defines the virtual ptp clock with a custom name, so
that the test will always locate the correct ptp clock.
Fixes zephyrproject-rtos#38731

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
cfriedt pushed a commit that referenced this issue Sep 23, 2021
ptp_clock_test was failing when trying to access the ptp clock from user
mode. This was due to an arbitrary initialization priority between the
virtual PTP clock devices created by the ptp clocking test and the
physical PTP clock on the frdm_k64f board. Since the ptp test
initializes the virtual clock with the same device name as the physical
clock, if the physical clock was initialized first this test would
incorrectly reference the physical device during testing, instead of the
virtual one.

This fix simply defines the virtual ptp clock with a custom name, so
that the test will always locate the correct ptp clock.
Fixes #38731

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Rushybrook pushed a commit to Rushybrook/zephyr that referenced this issue Oct 21, 2021
ptp_clock_test was failing when trying to access the ptp clock from user
mode. This was due to an arbitrary initialization priority between the
virtual PTP clock devices created by the ptp clocking test and the
physical PTP clock on the frdm_k64f board. Since the ptp test
initializes the virtual clock with the same device name as the physical
clock, if the physical clock was initialized first this test would
incorrectly reference the physical device during testing, instead of the
virtual one.

This fix simply defines the virtual ptp clock with a custom name, so
that the test will always locate the correct ptp clock.
Fixes zephyrproject-rtos#38731

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug platform: NXP NXP priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants