Skip to content

Conversation

@charis-poag-amd
Copy link
Contributor

@charis-poag-amd charis-poag-amd commented Jan 20, 2026

[SWDEV-552020/SWDEV-563971] Fail memory partition tests if ASIC supports memory partitions & kmod not installed
Updates:

  • Now provide more details on kmod being missing and how to install.
  • Cleaned up comparison logic, regardless if memory partition set/driver reload was
    successful or not.

Copilot AI review requested due to automatic review settings January 20, 2026 15:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances memory partition testing in AMD SMI by adding proper validation for kernel module (kmod) availability and improving test assertions based on driver reload success. The changes ensure that memory partition tests fail gracefully when kmod is not installed on systems that support memory partitions, rather than allowing tests to pass incorrectly.

Changes:

  • Added kmod installation detection to fail tests early when required tooling is missing
  • Enhanced test assertions to differentiate between successful driver reloads with/without NPS mode changes
  • Improved verbose logging to track memory partition state transitions throughout testing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@charis-poag-amd charis-poag-amd force-pushed the users/charis-poag-amd/SWDEV-552020_MemoryPartitionFailureIfKmodNotInstalled branch from 31d8d19 to 9d542f6 Compare January 20, 2026 15:42
…rts memory partitions

Updates:
  - Now provide more details on kmod being missing and how to install.
  - Cleaned up comparison logic, regardless if memory partition set was
successful or not.
@charis-poag-amd charis-poag-amd force-pushed the users/charis-poag-amd/SWDEV-552020_MemoryPartitionFailureIfKmodNotInstalled branch from 9d542f6 to 1f74229 Compare January 20, 2026 15:43
@charis-poag-amd charis-poag-amd changed the title users/charis poag amd/SWDEV 552020 MemoryPartitionFailureIfKmodNotInstalled [SWDEV-552020/SWDEV-563971] Fail memory partition tests if ASIC supports memory partitions Jan 20, 2026
@charis-poag-amd charis-poag-amd changed the title [SWDEV-552020/SWDEV-563971] Fail memory partition tests if ASIC supports memory partitions [SWDEV-552020/SWDEV-563971] Fail memory partition if ASIC supports memory partitions and kmod not installed Jan 20, 2026
@charis-poag-amd charis-poag-amd changed the title [SWDEV-552020/SWDEV-563971] Fail memory partition if ASIC supports memory partitions and kmod not installed [SWDEV-552020/SWDEV-563971] Fail memory partition tests if ASIC supports memory partitions and kmod not installed Jan 20, 2026
@charis-poag-amd charis-poag-amd changed the title [SWDEV-552020/SWDEV-563971] Fail memory partition tests if ASIC supports memory partitions and kmod not installed [SWDEV-552020/SWDEV-563971] Fail memory partition tests if ASIC supports memory partitions & kmod not installed Jan 20, 2026
Comment on lines +100 to +101
bool IsKmodInstalled() {
// Check common paths for modprobe

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this function is called more than once, but the answer isn't likely to change between calls, consider nesting the body in a lambda function that initializes a static bool to avoid repeating the investigation, something like this:

bool IsKmodInstalled() {
  static bool installed = [] {
    // what you already have
  }();
  return installed;
}

Alternatively, if you don't actually need it to be lazy, move the check to a chosen point in the test setup code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants