- Aug 10, 2022
-
-
Explain how to run the KUnit tests present in the AMDGPU's Display Core and clarify which architectures and tools can be used to run the tests. Moreover, explains how to add new tests to the existing tests. Signed-off-by:
Maíra Canal <mairacanal@riseup.net> Signed-off-by:
Tales Aparecida <tales.aparecida@gmail.com>
-
Add unit test to the SubVP feature in order to avoid possible regressions and assure the code robustness. Signed-off-by:
Maíra Canal <mairacanal@riseup.net> Signed-off-by:
Tales Aparecida <tales.aparecida@gmail.com>
-
This commit adds unit tests to the functions dcn20_cap_soc_clocks and dcn21_update_bw_bounding_box from dcn20/dcn20_fpu. Signed-off-by:
Magali Lemes <magalilemes00@gmail.com> Signed-off-by:
Tales Aparecida <tales.aparecida@gmail.com>
-
The display_mode_vba_20 deals with hundreds of display parameters for the DCN20 and sometimes does it in odd ways. The addition of unit tests intends to assure the quality of the code delivered by HW engineers and, also make it possible to refactor the code decreasing concerns about adding bugs to the codebase. Signed-off-by:
Maíra Canal <mairacanal@riseup.net> Signed-off-by:
Tales Aparecida <tales.aparecida@gmail.com>
-
The display_mode_vba library deals with hundreds of display parameters and sometimes does it in odd ways. The addition of unit tests intends to assure the quality of the code delivered by HW engineers and, also make it possible to refactor the code decreasing concerns about adding bugs to the codebase. Signed-off-by:
Maíra Canal <mairacanal@riseup.net> Signed-off-by:
Tales Aparecida <tales.aparecida@gmail.com>
-
This adds tests to the bit encoding format verification functions on the file. They're meant to be simpler so as to provide a proof of concept on testing DML code. Signed-off-by:
Isabella Basso <isabbasso@riseup.net> Signed-off-by:
Tales Aparecida <tales.aparecida@gmail.com>
-
KUnit unifies the test structure and provides helper tools that simplify the development of tests. Basic use case allows running tests as regular processes, which makes easier to run unit tests on a development machine and to integrate the tests in a CI system. This commit introduces a unit test to the bw_fixed library, which performs a lot of the mathematical operations involving fixed-point arithmetic and the conversion of integers to fixed-point representation inside the Display Mode Library. As fixed-point representation is the base foundation of the DML calcs operations, this unit tests intend to assure the proper functioning of the basic mathematical operations of fixed-point arithmetic, such as multiplication, conversion from fractional to fixed-point number, and more. You can run it with: ./tools/testing/kunit/kunit.py run \ --arch=x86_64 \ --kunitconfig=drivers/gpu/drm/amd/display/tests/ Signed-off-by:
Maíra Canal <maira.canal@usp.br> Co-developed-by:
Magali Lemes <magalilemes00@gmail.com> Signed-off-by:
Magali Lemes <magalilemes00@gmail.com> Co-developed-by:
Tales Aparecida <tales.aparecida@gmail.com> Signed-off-by:
Tales Aparecida <tales.aparecida@gmail.com>
-
Tales Aparecida authored
The fixed31_32 library performs a lot of the mathematical operations involving fixed-point arithmetic and the conversion of integers to fixed-point representation. This unit tests intend to assure the proper functioning of the basic mathematical operations of fixed-point arithmetic, such as multiplication, conversion from fractional to fixed-point number, and more. Use kunit_tool to run: $ ./tools/testing/kunit/kunit.py run --arch=x86_64 \ --kunitconfig=drivers/gpu/drm/amd/display/tests/ Signed-off-by:
Tales Aparecida <tales.aparecida@gmail.com>
-
- Aug 06, 2022
-
-
It's possible that memory allocation for 'filtered' will fail, but for the copy of the suite to succeed. In this case, the copy could be leaked. Properly free 'copy' in the error case for the allocation of 'filtered' failing. Note that there may also have been a similar issue in kunit_filter_subsuites, before it was removed in "kunit: flatten kunit_suite*** to kunit_suite** in .kunit_test_suites". This was reported by clang-analyzer via the kernel test robot, here: https://lore.kernel.org/all/c8073b8e-7b9e-0830-4177-87c12f16349c@intel.com/ And by smatch via Dan Carpenter and the kernel test robot: https://lore.kernel.org/all/202207101328.ASjx88yj-lkp@intel.com/ Fixes: a02353f4 ("kunit: bail out of test filtering logic quicker if OOM") Reported-by:
kernel test robot <yujie.liu@intel.com> Reported-by:
kernel test robot <lkp@intel.com> Reported-by:
Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by:
Daniel Latypov <dlatypov@google.com> Reviewed-by:
Brendan Higgins <brendanhiggins@google.com> Signed-off-by:
David Gow <davidgow@google.com> Signed-off-by:
Shuah Khan <skhan@linuxfoundation.org>
-
We currently store kunit suites in the .kunit_test_suites ELF section as a `struct kunit_suite***` (modulo some `const`s). For every test file, we store a struct kunit_suite** NULL-terminated array. This adds quite a bit of complexity to the test filtering code in the executor. Instead, let's just make the .kunit_test_suites section contain a single giant array of struct kunit_suite pointers, which can then be directly manipulated. This array is not NULL-terminated, and so none of the test filtering code needs to NULL-terminate anything. Tested-by:
Maíra Canal <maira.canal@usp.br> Reviewed-by:
Brendan Higgins <brendanhiggins@google.com> Signed-off-by:
Daniel Latypov <dlatypov@google.com> Co-developed-by:
David Gow <davidgow@google.com> Signed-off-by:
David Gow <davidgow@google.com> Signed-off-by:
Shuah Khan <skhan@linuxfoundation.org>
-
The existing logic happens to work fine on UML, but is not correct when running on other arches. 1. We didn't initialize `int err`, and kunit_filter_suites() doesn't explicitly set it to 0 on success. So we had false "failures". Note: it doesn't happen on UML, causing this to get overlooked. 2. If we error out, we do not call kunit_handle_shutdown(). This makes kunit.py timeout when using a non-UML arch, since the QEMU process doesn't ever exit. Fixes: a02353f4 ("kunit: bail out of test filtering logic quicker if OOM") Signed-off-by:
Daniel Latypov <dlatypov@google.com> Reviewed-by:
Brendan Higgins <brendanhiggins@google.com> Signed-off-by:
Shuah Khan <skhan@linuxfoundation.org>
-
When filtering what tests to run (suites and/or cases) via kunit.filter_glob (e.g. kunit.py run <glob>), we allocate copies of suites. These allocations can fail, and we largely don't handle that. Note: realistically, this probably doesn't matter much. We're not allocating much memory and this happens early in boot, so if we can't do that, then there's likely far bigger problems. This patch makes us immediately bail out from the top-level function (kunit_filter_suites) with -ENOMEM if any of the underlying kmalloc() calls return NULL. Implementation note: we used to return NULL pointers from some functions to indicate either that all suites/tests were filtered out or there was an error allocating the new array. We'll log a short error in this case and not run any tests or print a TAP header. From a kunit.py user's perspective, they'll get a message about missing/invalid TAP output and have to dig into the test.log to see it. Since hitting this error seems so unlikely, it's probably fine to not invent a way to plumb this error message more visibly. See also: https://lore.kernel.org/linux-kselftest/20220329103919.2376818-1-lv.ruyi@zte.com.cn/ Signed-off-by:
Daniel Latypov <dlatypov@google.com> Reported-by:
Zeal Robot <zealci@zte.com.cn> Reported-by:
Lv Ruyi <lv.ruyi@zte.com.cn> Reviewed-by:
Brendan Higgins <brendanhiggins@google.com> Signed-off-by:
Shuah Khan <skhan@linuxfoundation.org>
-
Currently, KUnit runs built-in tests and tests loaded from modules differently. For built-in tests, the kunit_test_suite{,s}() macro adds a list of suites in the .kunit_test_suites linker section. However, for kernel modules, a module_init() function is used to run the test suites. This causes problems if tests are included in a module which already defines module_init/exit_module functions, as they'll conflict with the kunit-provided ones. This change removes the kunit-defined module inits, and instead parses the kunit tests from their own section in the module. After module init, we call __kunit_test_suites_init() on the contents of that section, which prepares and runs the suite. This essentially unifies the module- and non-module kunit init formats. Tested-by:
Maíra Canal <maira.canal@usp.br> Reviewed-by:
Brendan Higgins <brendanhiggins@google.com> Signed-off-by:
Jeremy Kerr <jk@codeconstruct.com.au> Signed-off-by:
Daniel Latypov <dlatypov@google.com> Signed-off-by:
David Gow <davidgow@google.com> Signed-off-by:
Shuah Khan <skhan@linuxfoundation.org>
-
Make KUnit trigger the new TAINT_TEST taint when any KUnit test is run. Due to KUnit tests not being intended to run on production systems, and potentially causing problems (or security issues like leaking kernel addresses), the kernel's state should not be considered safe for production use after KUnit tests are run. This both marks KUnit modules as test modules using MODULE_INFO() and manually taints the kernel when tests are run (which catches builtin tests). Acked-by:
Luis Chamberlain <mcgrof@kernel.org> Tested-by:
Daniel Latypov <dlatypov@google.com> Reviewed-by:
Brendan Higgins <brendanhiggins@google.com> Signed-off-by:
David Gow <davidgow@google.com> Tested-by:
Maíra Canal <mairacanal@riseup.net> Signed-off-by:
Shuah Khan <skhan@linuxfoundation.org>
-
KUnit has support for setup/cleanup logic for each test case in a suite. But it lacks the ability to specify setup/cleanup for the entire suite itself. This can be used to do setup that is too expensive or cumbersome to do for each test. Or it can be used to do simpler things like log debug information after the suite completes. It's a fairly common feature, so the lack of it is noticeable. Some examples in other frameworks and languages: * https://docs.python.org/3/library/unittest.html#setupclass-and-teardownclass * https://google.github.io/googletest/reference/testing.html#Test::SetUpTestSuite Meta: This is very similar to this patch here: https://lore.kernel.org/linux-kselftest/20210805043503.20252-3-bvanassche@acm.org/ The changes from that patch: * pass in `struct kunit *` so users can do stuff like `kunit_info(suite, "debug message")` * makes sure the init failure is bubbled up as a failure * updates kunit-example-test.c to use a suite init * Updates kunit/usage.rst to mention the new support * some minor cosmetic things * use `suite_{init,exit}` instead of `{init/exit}_suite` * make suite init error message more consistent w/ test init * etc. Signed-off-by:
Daniel Latypov <dlatypov@google.com> Reviewed-by:
David Gow <davidgow@google.com> Reviewed-by:
Brendan Higgins <brendanhiggins@google.com> Signed-off-by:
Shuah Khan <skhan@linuxfoundation.org>
-
These names sound more general than they are. The _end() function increments a `static int kunit_suite_counter`, so it can only safely be called on suites, aka top-level subtests. It would need to have a separate counter for each level of subtest to be generic enough. So rename it to make it clear it's only appropriate for suites. Signed-off-by:
Daniel Latypov <dlatypov@google.com> Reviewed-by:
David Gow <davidgow@google.com> Reviewed-by:
Brendan Higgins <brendanhiggins@google.com> Signed-off-by:
Shuah Khan <skhan@linuxfoundation.org>
-
We've split out the declarations from include/kunit/test.h into resource.h. This patch splits out the definitions as well for consistency. A side effect of this is git blame won't properly track history by default, users need to run $ git blame -L ,1 -C13 lib/kunit/resource.c Signed-off-by:
Daniel Latypov <dlatypov@google.com> Reviewed-by:
David Gow <davidgow@google.com> Reviewed-by:
Brendan Higgins <brendanhiggins@google.com> Signed-off-by:
Shuah Khan <skhan@linuxfoundation.org>
-
No functional changes. This patch moves all module related code into a separate directory, modifies each file name and creates a new Makefile. Note: this effort is in preparation to refactor core module code. Reviewed-by:
Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by:
Aaron Tomlin <atomlin@redhat.com> Signed-off-by:
Luis Chamberlain <mcgrof@kernel.org>
-
Most in-kernel tests (such as KUnit tests) are not supposed to run on production systems: they may do deliberately illegal things to trigger errors, and have security implications (for example, KUnit assertions will often deliberately leak kernel addresses). Add a new taint type, TAINT_TEST to signal that a test has been run. This will be printed as 'N' (originally for kuNit, as every other sensible letter was taken.) This should discourage people from running these tests on production systems, and to make it easier to tell if tests have been run accidentally (by loading the wrong configuration, etc.) Acked-by:
Luis Chamberlain <mcgrof@kernel.org> Reviewed-by:
Brendan Higgins <brendanhiggins@google.com> Signed-off-by:
David Gow <davidgow@google.com> Signed-off-by:
Shuah Khan <skhan@linuxfoundation.org>
-
Background: Currently, a reader looking at kunit/test.h will find the file is quite long, and the first meaty comment is a doc comment about struct kunit_resource. Most users will not ever use the KUnit resource API directly. They'll use kunit_kmalloc() and friends, or decide it's simpler to do cleanups via labels (it often can be) instead of figuring out how to use the API. It's also logically separate from everything else in test.h. Removing it from the file doesn't cause any compilation errors (since struct kunit has `struct list_head resources` to store them). This commit: Let's move it into a kunit/resource.h file and give it a separate page in the docs, kunit/api/resource.rst. We include resource.h at the bottom of test.h since * don't want to force existing users to add a new include if they use the API * it accesses `lock` inside `struct kunit` in a inline func * so we can't just forward declare, and the alternatives require uninlining the func, adding hepers to lock/unlock, or other more invasive changes. Now the first big comment in test.h is about kunit_case, which is a lot more relevant to what a new user wants to know. A side effect of this is git blame won't properly track history by default, users need to run $ git blame -L ,1 -C17 include/kunit/resource.h Signed-off-by:
Daniel Latypov <dlatypov@google.com> Reviewed-by:
David Gow <davidgow@google.com> Reviewed-by:
Brendan Higgins <brendanhiggins@google.com> Signed-off-by:
Shuah Khan <skhan@linuxfoundation.org>
-
- Jul 29, 2022
-
-
Xiaojian Du authored
This patch will enable support for psp 13.0.4 blcok. Signed-off-by:
Xiaojian Du <Xiaojian.Du@amd.com> Reviewed-by:
Tim Huang <Tim.Huang@amd.com>
-
Xiaojian Du authored
This patch will add files for PSP 13.0.4. Signed-off-by:
Xiaojian Du <Xiaojian.Du@amd.com> Reviewed-by:
Tim Huang <Tim.Huang@amd.com>
-
Xiaojian Du authored
This patch will add header files for MP 13.0.4. Signed-off-by:
Xiaojian Du <Xiaojian.Du@amd.com> Reviewed-by:
Tim Huang <Tim.Huang@amd.com>
-
Xiaojian Du authored
This patch corrects RLC_RLCS_BOOTLOAD_STATUS offset and index for GC 11.0.1. Signed-off-by:
Yifan Zhang <yifan1.zhang@amd.com> Reviewed-by:
Tim Huang <Tim.Huang@amd.com>
-
Xiaojian Du authored
This patch will make SMU send msg to IMU for the front-door loading, it is required by some ASICs. Signed-off-by:
Yifan Zhang <yifan1.zhang@amd.com> Signed-off-by:
Xiaojian Du <Xiaojian.Du@amd.com> Reviewed-by:
Tim Huang <Tim.Huang@amd.com>
-
- Jul 28, 2022
-
-
time_is_before_jiffies deals with timer wrapping correctly. Signed-off-by:
Yu Zhe <yuzhe@nfschina.com> Signed-off-by:
Felix Kuehling <Felix.Kuehling@amd.com> Reviewed-by:
Felix Kuehling <Felix.Kuehling@amd.com>
-
jokim-amd authored
Hives that require psp topology info to be reflected will leak hive reference so fix it. Signed-off-by:
Jonathan Kim <jonathan.kim@amd.com> Reviewed-by:
Shaoyun Liu <shaoyun.liu@amd.com>
-
Evan Quan authored
The feature is ready with latest firmwares. Signed-off-by:
Evan Quan <evan.quan@amd.com> Reviewed-by:
Hawking Zhang <Hawking.Zhang@amd.com> Change-Id: I4907ef8c96eb8933db01818d7431afb3778d1afd
-
Evan Quan authored
And get the version bumped to 0x2C to match the latest PMFW. Signed-off-by:
Evan Quan <evan.quan@amd.com> Reviewed-by:
Hawking Zhang <Hawking.Zhang@amd.com> Change-Id: Ie4bc8fa0831ae6d1735c2dca27331ff6f6229e30
-
mes self test rely on vm mapping, move it after drm sched re-started so that vm mapping can work during gpu reset. Signed-off-by:
Jack Xiao <Jack.Xiao@amd.com> Acked-and-tested-by:
Evan Quan <evan.quan@amd.com> Change-Id: Ib202c04d86191ca47da90d27c2a8cf9e7c8e6732
-
Evan Quan authored
This extra call trace dump comes out in every gpu reset. And it gives people a wrong impression that something went wrong. Although actually there was not. Signed-off-by:
Evan Quan <evan.quan@amd.com> Acked-by:
Christian König <christian.koenig@amd.com> Change-Id: I884af405b6b3cd52b9024408a21fd39811a01f4d
-
Not enable VCN pg because encode issue Signed-off-by:
Sonny Jiang <sonny.jiang@amd.com> Reviewed-by:
James Zhu <James.Zhu@amd.com> Signed-off-by:
Alex Deucher <alexander.deucher@amd.com>
-
Enable support for vcn_4_0_2 video codec Signed-off-by:
Sonny Jiang <sonny.jiang@amd.com> Reviewed-by:
James Zhu <James.Zhu@amd.com> Signed-off-by:
Alex Deucher <alexander.deucher@amd.com>
-
Add VCN_4_0_2 firmware support Signed-off-by:
Sonny Jiang <sonny.jiang@amd.com> Reviewed-by:
James Zhu <James.Zhu@amd.com> Signed-off-by:
Alex Deucher <alexander.deucher@amd.com>
-
Add function to support VCN_4_0_2 doorbell Signed-off-by:
Sonny Jiang <sonny.jiang@amd.com> Reviewed-by:
James Zhu <James.Zhu@amd.com> Signed-off-by:
Alex Deucher <alexander.deucher@amd.com>
-
The return value should be set in vcn4 boot poll. Signed-off-by:
Sonny Jiang <sonny.jiang@amd.com> Reviewed-by:
James Zhu <James.Zhu@amd.com> Signed-off-by:
Alex Deucher <alexander.deucher@amd.com>
-
New version of uPEP will have a separate ACPI id, add that to the support list. Signed-off-by:
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Reviewed-by:
Mario Limonciello <mario.limonciello@amd.com> Signed-off-by:
Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit ed470feb)
-
PMC driver can be supported on a new upcoming platform. Add this information to the support list. Signed-off-by:
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Link: https://lore.kernel.org/r/20220630050324.3780654-2-Shyam-sundar.S-k@amd.com Reviewed-by:
Hans de Goede <hdegoede@redhat.com> Signed-off-by:
Hans de Goede <hdegoede@redhat.com> (cherry picked from commit 530ef2a6e81c74c19f918713e519e85652e53a83)
-
New version of PMC controller will have a separate ACPI id, add that to the support list. Signed-off-by:
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Link: https://lore.kernel.org/r/20220630050324.3780654-1-Shyam-sundar.S-k@amd.com Reviewed-by:
Hans de Goede <hdegoede@redhat.com> Signed-off-by:
Hans de Goede <hdegoede@redhat.com> (cherry picked from commit 0f52752973e8a6daf88c485462ff765dd81492de)
-
Currently, AMD supported platform drivers are grouped under generic "x86" folder structure. Move the current drivers (amd-pmc and amd_hsmp) to a separate directory. This would also mean the newer driver submissions to pdx86 subsystem in the future will also land in AMD specific directory. Reviewed-by:
Naveen Krishna Chatradhi <NaveenKrishna.Chatradhi@amd.com> Tested-by:
Suma Hegde <suma.hegde@amd.com> Signed-off-by:
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Link: https://lore.kernel.org/r/20220608193212.2827257-1-Shyam-sundar.S-k@amd.com Reviewed-by:
Hans de Goede <hdegoede@redhat.com> Signed-off-by:
Hans de Goede <hdegoede@redhat.com> (cherry picked from commit ef233eaf)
-