accel/amdxdna: Add iommu_bypass debugfs for aie4 only#1297
Conversation
Add debug only debugfs for aie4. Signed-off-by: David Zhang <yidong.zhang@amd.com>
There was a problem hiding this comment.
Pull request overview
Adds an AIE4-specific debugfs hook to the amdxdna driver so device-specific debugfs entries can be registered (intended for an iommu_bypass debug control on AIE4).
Changes:
- Extend
struct amdxdna_dev_opswith a per-devicedebugfs()callback and invoke it from the common debugfs init path. - Add AIE4 debugfs support (
aie4_debugfs.c) and wire it into AIE4 ops. - Extend AIE4 mailbox protocol definitions with an
ECHOopcode and request/response structs.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| drivers/accel/amdxdna/Kbuild | Adds aie4_debugfs.o to the DEBUG_FS build. |
| drivers/accel/amdxdna/amdxdna_pci_drv.h | Adds a debugfs callback to device ops. |
| drivers/accel/amdxdna/amdxdna_pci_drv.c | No functional change (whitespace only in shown hunk). |
| drivers/accel/amdxdna/amdxdna_debugfs.c | Calls the device-specific debugfs hook if present. |
| drivers/accel/amdxdna/aie4_pci.h | Declares AIE4 debugfs init entrypoint. |
| drivers/accel/amdxdna/aie4_pci.c | Wires .debugfs = aie4_debugfs_init into AIE4 ops. |
| drivers/accel/amdxdna/aie4_msg_priv.h | Adds AIE4 echo opcode and message structs. |
| drivers/accel/amdxdna/aie4_debugfs.c | Introduces AIE4 debugfs file iommu_bypass and echo-based write path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /* aie4_debugfs.c */ | ||
| void aie4_debugfs_init(struct amdxdna_dev *xdna); |
| if (ret) | ||
| XDNA_ERR(xdna, "echo failed: %d", ret); |
| XDNA_INFO(xdna, "echo finished, response correct value."); | ||
| else | ||
| XDNA_WARN(xdna, "echo finished, expect: 0x%x,0x%x, got: 0x%x,0x%x", | ||
| req.val1, req.val1, resp.val1, resp.val2); |
| } | ||
|
|
||
| /* | ||
| * Input/output format: <carveout_size>@<carveout_address> |
maxzhen
left a comment
There was a problem hiding this comment.
Is the bypass mode value differing from system to system? If not, you don't really need a debugfs node for this. You can have a global macro to define the mode and make compile time decision. This is much simpler and easier to upstream, I think.
I would keep this debug only for bringup. We do not need to upstream this. |
after talking with Max. I think we need to do 2 things:
|
Add debug only debugfs for aie4.