drivers: pci: fix endpoint MSI setup#11561
Conversation
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
📌 Code Review Assignment🏷️ Tag: componentsReviewers: @Maihuanyi Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2026-07-06 04:39 CST)
📝 Review Instructions
|
rt_pci_ep_set_msi() checked the set_msix callback before calling set_msi. That rejects endpoint controllers that implement MSI without MSI-X, and can call through a NULL set_msi pointer when only MSI-X is provided. The same helper converts a requested MSI vector count into the log2 field passed to the controller. Stop after the first value large enough for the request so smaller requests are not widened by later loop iterations. Generated-by: OpenAI Codex Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
d40efe8 to
aa034b2
Compare
Summary
rt_pci_ep_set_msi()Why
The MSI setup path tested
ep->ops->set_msixbefore callingep->ops->set_msi. That can reject controllers that support MSI without MSI-X, and can call a NULLset_msicallback if only MSI-X is implemented.The same loop converts a requested MSI vector count into the log2 encoding passed to the controller. Without a
break, a request for a smaller count continues through later iterations and is widened to the largest supported value.Testing
git diff --check origin/master...HEADgit show --stat --check --format=fuller HEAD