Skip to content

Separated command driver code and added a placeholder for ve2 aux driver#9

Open
saifuddin-xilinx wants to merge 2 commits intomainfrom
linux_upstream_ve2
Open

Separated command driver code and added a placeholder for ve2 aux driver#9
saifuddin-xilinx wants to merge 2 commits intomainfrom
linux_upstream_ve2

Conversation

@saifuddin-xilinx
Copy link
Copy Markdown
Owner

No description provided.

Signed-off-by: Saifuddin Kaijar <saifuddin.kaijar@amd.com>
Copy link
Copy Markdown

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 refactors the AMD XDNA accel driver by extracting common DRM driver/device lifecycle logic into a shared driver unit and introducing an auxiliary-bus (VE2 / DT-based) driver stub, while also renaming some AIE2-era headers/guards to amdxdna naming.

Changes:

  • Introduce amdxdna_drv.[ch] to host common DRM driver definition plus shared device init/cleanup, and update consumers to include the new header.
  • Add a placeholder AUX-bus driver (amdxdna_aux_drv.c) and Kbuild/Makefile plumbing for selecting PCI vs AUX builds.
  • Rename solver/mailbox header guards and update solver includes to amdxdna_solver.h.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
drivers/accel/amdxdna/amdxdna_drv.h New common driver header; centralizes macros/types and declares shared init/cleanup
drivers/accel/amdxdna/amdxdna_drv.c New common DRM driver + shared device init/cleanup implementation
drivers/accel/amdxdna/amdxdna_pci_drv.c Reduced to PCI probe/remove wiring; calls shared init/cleanup
drivers/accel/amdxdna/amdxdna_pci_drv.h Now a thin wrapper including the common driver header and device info externs
drivers/accel/amdxdna/amdxdna_aux_drv.c Adds AUX-bus driver placeholder for VE2
drivers/accel/amdxdna/Makefile Adds AUX build option and changes bus-type selection logic/default
drivers/accel/amdxdna/Kbuild Adds new objects and conditionally builds PCI vs AUX driver objects
drivers/accel/amdxdna/amdxdna_solver.[ch] Renames include usage and adjusts include guards
drivers/accel/amdxdna/amdxdna_mailbox.h Renames include guard to amdxdna naming
drivers/accel/amdxdna/{amdxdna_ctx.c,amdxdna_gem.c,amdxdna_gem.h,amdxdna_pm.h,amdxdna_sysfs.c,amdxdna_ubuf.c,amdxdna_mailbox_helper.c} Switch includes from amdxdna_pci_drv.h to amdxdna_drv.h
drivers/accel/amdxdna/{aie2_pci.c,aie2_ctx.c} Update solver include to amdxdna_solver.h

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

Comment thread drivers/accel/amdxdna/amdxdna_drv.h Outdated
Comment thread drivers/accel/amdxdna/Makefile Outdated
Comment thread drivers/accel/amdxdna/amdxdna_aux_drv.c
Signed-off-by: Saifuddin Kaijar <saifuddin.kaijar@amd.com>
Copy link
Copy Markdown

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

Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.


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

}
client->mm = current->mm;
mmgrab(client->mm);
init_srcu_struct(&client->hwctx_srcu);
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

init_srcu_struct(&client->hwctx_srcu) returns an error code on allocation failure; ignoring it can leave hwctx_srcu uninitialized and later lead to crashes in paths that use client->hwctx_srcu. Please capture the return value, and on failure unwind (mmdrop/mmgrab, SVA unbind if already bound, kfree client) and return the error.

Suggested change
init_srcu_struct(&client->hwctx_srcu);
ret = init_srcu_struct(&client->hwctx_srcu);
if (ret) {
mmput(client->mm);
goto unbind_sva;
}

Copilot uses AI. Check for mistakes.
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