Separated command driver code and added a placeholder for ve2 aux driver#9
Separated command driver code and added a placeholder for ve2 aux driver#9saifuddin-xilinx wants to merge 2 commits intomainfrom
Conversation
Signed-off-by: Saifuddin Kaijar <saifuddin.kaijar@amd.com>
There was a problem hiding this comment.
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.
Signed-off-by: Saifuddin Kaijar <saifuddin.kaijar@amd.com>
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
| init_srcu_struct(&client->hwctx_srcu); | |
| ret = init_srcu_struct(&client->hwctx_srcu); | |
| if (ret) { | |
| mmput(client->mm); | |
| goto unbind_sva; | |
| } |
No description provided.