Skip to content

x86: fix issue when allocating 1 vector via MSI-X #93462

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dcpleung
Copy link
Member

  • Fix incorrect return value in arch_pcie_msi_vectors_allocate()
  • Fix an issue where allocating 1 vector via MSI-X may return error based on incorrect assumption.
  • Fix building tests/drivers/disk/disk_performace for qemu_x86_64.

dcpleung added 3 commits July 21, 2025 11:19
qemu_x86_64 has NVME disk as overlay so we need to enable
kconfig CONFIG_NVME or else it would fail to compile.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
arch_pcie_msi_vectors_allocate() has a return type of uint8_t.
One of the error path returns -1 which would result in 255
being returned. So fix that by returning 0 instead, as there is
no vector being allocated anyway.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Fix an issue where 1 vector is being requested when MSI-X is
enabled. The previous logic always assumed the PCIE device has
only fixed or single MSI when we are requesting 1 vector, which
is not entirely correct. So if there is no vector allocated
already, try to allocate one.

Fixes zephyrproject-rtos#93319

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Disk Access area: X86 x86 Architecture (32-bit)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

drivers: pcie: single vector allocation is failing with pcie_msi_vectors_allocate()
3 participants