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

Fix ufs #171

Merged
merged 2 commits into from
Jan 31, 2024
Merged

Fix ufs #171

merged 2 commits into from
Jan 31, 2024

Conversation

Yujie-Liu
Copy link
Contributor

Hi @qwang59, we noticed some possible problems when running the ufs tests in 0-Day CI. Not sure if we did the correct fix. Could you please help review? Thanks.

The sysfs_verify function sets test type as "dir", "file" or "exist"
from the parameter, but there is no code that really does the check.
The test_print_trc function simply echoes a line no matter the path
exists or not. This may cause some false test results such as:

$ ls /sys/devices/system/cpu/intel_uncore_frequency/current_freq_khz
ls: cannot access '/sys/devices/system/cpu/intel_uncore_frequency/current_freq_khz': No such file or directory

$ sudo ./runtests -c "./ufs/tpmi_ufs.sh -t check_ufs_sysfs_attr"
<<<test start - './ufs/tpmi_ufs.sh -t check_ufs_sysfs_attr'>>
|0122_171944.874|TRACE|Check TPMI_UFS driver sysfs attribute:|
|0122_171944.876|TRACE|/sys/devices/system/cpu/intel_uncore_frequency/current_freq_khz does exist|
|0122_171944.879|TRACE|/sys/devices/system/cpu/intel_uncore_frequency/initial_max_freq_khz does exist|
|0122_171944.881|TRACE|/sys/devices/system/cpu/intel_uncore_frequency/domain_id does exist|
|0122_171944.883|TRACE|/sys/devices/system/cpu/intel_uncore_frequency/fabric_cluster_id does exist|
|0122_171944.886|TRACE|/sys/devices/system/cpu/intel_uncore_frequency/initial_min_freq_khz does exist|
|0122_171944.888|TRACE|/sys/devices/system/cpu/intel_uncore_frequency/max_freq_khz does exist|
|0122_171944.891|TRACE|/sys/devices/system/cpu/intel_uncore_frequency/min_freq_khz does exist|
|0122_171944.893|TRACE|/sys/devices/system/cpu/intel_uncore_frequency/package_id does exist|
|0122_171944.899|TRACE|package_00_die_00|
<<<test end, result: PASS, duration: 0.057>>

Test Start Time: 2024-01-22_17-19-44
--------------------------------------------------------
Testcase                                                                    Result     Exit Value  Duration
--------                                                                    ------     ----------  --------
[RESULT][./ufs/tpmi_ufs.sh -t check_ufs_sysfs_attr]                          [PASS]    [0]         [0.057s]
--------------------------------------------------------

Reported-by: kernel test robot <[email protected]>
Signed-off-by: Yujie Liu <[email protected]>
…t exist

If the kernel is built without CONFIG_INTEL_UNCORE_FREQ_CONTROL enabled,
the driver sysfs path won't exist, so the tests are expected to fail,
but actually it gives PASS results:

<<<test start - 'tpmi_ufs.sh -t check_ufs_init_min_max_value'>>
ls: cannot access '/sys/devices/system/cpu/intel_uncore_frequency': No such file or directory
|1214_133318.071|TRACE|Uncore number: 0|
<<<test end, result: PASS, duration: 0.032>>

<<<test start - 'tpmi_ufs.sh -t check_ufs_min_equals_to_max'>>
ls: cannot access '/sys/devices/system/cpu/intel_uncore_frequency': No such file or directory
<<<test end, result: PASS, duration: 0.030>>

<<<test start - 'tpmi_ufs.sh -t check_ufs_max_equals_to_min'>>
ls: cannot access '/sys/devices/system/cpu/intel_uncore_frequency': No such file or directory
<<<test end, result: PASS, duration: 0.031>>

<<<test start - 'tpmi_ufs.sh -t check_ufs_current_dynamic'>>
ls: cannot access '/sys/devices/system/cpu/intel_uncore_frequency': No such file or directory
<<<test end, result: PASS, duration: 0.030>>

After CONFIG_INTEL_UNCORE_FREQ_CONTROL being enabled in the kernel, if
the uncore number is 0, the tests are not done, either, so it is
expected to be shown as BLOCK instead of PASS.

<<<test start - 'tpmi_ufs.sh -t check_ufs_init_min_max_value'>>
|0122_044137.087|TRACE|Uncore number: 0|
<<<test end, result: PASS, duration: 0.099>>

<<<test start - 'tpmi_ufs.sh -t check_ufs_min_equals_to_max'>>
<<<test end, result: PASS, duration: 0.089>>

<<<test start - 'tpmi_ufs.sh -t check_ufs_max_equals_to_min'>>
<<<test end, result: PASS, duration: 0.091>>

<<<test start - 'tpmi_ufs.sh -t check_ufs_current_dynamic'>>
<<<test end, result: PASS, duration: 0.099>>

Reported-by: kernel test robot <[email protected]>
Signed-off-by: Yujie Liu <[email protected]>
@ysun
Copy link
Contributor

ysun commented Jan 31, 2024

Thanks Yujie for your patch!

@ysun ysun merged commit 96a42ee into intel:main Jan 31, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants