Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,15 @@ install(FILES ${CMAKE_BINARY_DIR}/driver/${XDNA_TAR_GZ}
COMPONENT ${XDNA_COMPONENT}
)

set(MAKE_DRV "cd driver/${XDNA_DRV_DIR}; make ${XDNA_DRV_BLD_FLAGS_DKMS} KERNEL_SRC=\${kernel_source_dir}; cd ../..")
set(CLEAN_DRV "cd driver/${XDNA_DRV_DIR}; make clean KERNEL_SRC=\${kernel_source_dir}; cd ../..")
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There's a constant error in Xilinx's code with dealing with PWD in DKMS build configuration. The dkms.conf MAKE and CLEAN directives aren't shell command, and they are run in their own subshell, so the PWD doesn't leak to the top subshell.

In addition, on Clang built kernel, DKMS appends USE_LLVM=1 to the given MAKE command so it must be a make command not a shell script.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The same is true for all XRT dkms.conf.in files that all present the same issue. Hopefully, they aren't used in this repository for this driver so it's hidden under the rug.

set(MAKE_DRV "cd driver/${XDNA_DRV_DIR}; make ${XDNA_DRV_BLD_FLAGS_DKMS} KERNEL_SRC=\${kernel_source_dir}")
set(CLEAN_DRV "cd driver/${XDNA_DRV_DIR}; make clean KERNEL_SRC=\${kernel_source_dir}")
set(MODULE_DRV "BUILT_MODULE_NAME[0]=${XDNA_DRV}
BUILT_MODULE_LOCATION[0]=\"driver/${XDNA_DRV_DIR}/build/driver/amdxdna\"
DEST_MODULE_LOCATION[0]=\"/kernel/extras\"")

if(XDNA_DRV_INT_SRC_DIR)
set(MAKE_DRV "${MAKE_DRV}; cd driver/${XDNA_DRV_INT_DIR}; make KERNEL_SRC=\${kernel_source_dir}; cd ../..")
set(CLEAN_DRV "${CLEAN_DRV}; cd driver/${XDNA_DRV_INT_DIR}; make clean KERNEL_SRC=\${kernel_source_dir}; cd ../..")
set(MAKE_DRV "${MAKE_DRV}; cd driver/${XDNA_DRV_INT_DIR}; make KERNEL_SRC=\${kernel_source_dir}")
set(CLEAN_DRV "${CLEAN_DRV}; cd driver/${XDNA_DRV_INT_DIR}; make clean KERNEL_SRC=\${kernel_source_dir}")
set(MODULE_DRV "${MODULE_DRV}
BUILT_MODULE_NAME[1]=${XDNA_DRV_INT}
BUILT_MODULE_LOCATION[1]=\"driver/${XDNA_DRV_INT_DIR}/build/driver/${XDNA_DRV_INT_DIR}\"
Expand Down
2 changes: 1 addition & 1 deletion src/driver/amdxdna/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ifeq ($(XDNA_BUS_TYPE), of)
DEFINES += -DAMDXDNA_OF
# Generate config_kernel.h when building directly (Yocto/DKMS flow)
modules: $(SRC_DIR)/config_kernel.h
$(MAKE) -C $(KERNEL_SRC) M=$(SRC_DIR) CFLAGS_MODULE="$(DEFINES)" OFT_CONFIG_AMDXDNA_PCI=$(PCI) OFT_CONFIG_AMDXDNA_OF=$(OF) modules
$(MAKE) -C $(KERNEL_SRC) M=$(SRC_DIR) CFLAGS_MODULE="$(DEFINES)" OFT_CONFIG_AMDXDNA_PCI=$(PCI) OFT_CONFIG_AMDXDNA_OF=$(OF) $(USE_LLVM) modules

$(SRC_DIR)/config_kernel.h:
@echo "[INFO] Generating config_kernel.h for OF build..."
Expand Down
2 changes: 1 addition & 1 deletion src/driver/amdxdna/aie4_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ static int aie4_pcidev_init(struct amdxdna_dev_hdl *ndev)
struct amdxdna_dev *xdna = ndev->xdna;
struct pci_dev *pdev = to_pci_dev(xdna->ddev.dev);
void __iomem *tbl[PCI_NUM_RESOURCES] = {0};
const struct firmware *npufw, *certfw;
const struct firmware *npufw = NULL, *certfw = NULL;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Without this, npufw can be used uninitialized later on in the function in the error handling code and clang errors out and refuse to build.

unsigned long bars = 0;
int ret, i;

Expand Down