Re: [PATCH V1] accel/amdxdna: Support submit commands without arguments

2025-05-08 Thread Lizhi Hou
Merged to drm-misc-next On 5/7/25 10:31, Lizhi Hou wrote: On 5/7/25 09:29, Mario Limonciello wrote: On 5/7/2025 11:15 AM, Lizhi Hou wrote: The latest userspace runtime allows generating commands which do not have any argument. Remove the corresponding check in driver IOCTL to enable this use

Re: [PATCH V1] accel/amdxdna: Support submit commands without arguments

2025-05-07 Thread Lizhi Hou
On 5/7/25 09:29, Mario Limonciello wrote: On 5/7/2025 11:15 AM, Lizhi Hou wrote: The latest userspace runtime allows generating commands which do not have any argument. Remove the corresponding check in driver IOCTL to enable this use case. Signed-off-by: Lizhi Hou Can the userspace

[PATCH V1] accel/amdxdna: Support submit commands without arguments

2025-05-07 Thread Lizhi Hou
The latest userspace runtime allows generating commands which do not have any argument. Remove the corresponding check in driver IOCTL to enable this use case. Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/amdxdna_ctx.c | 22 -- 1 file changed, 12 insertions(+), 10

Re: [PATCH] accel/ivpu: Use firmware names from upstream repo

2025-05-07 Thread Lizhi Hou
On 5/6/25 23:59, Jacek Lawrynowicz wrote: Hi, On 5/6/2025 5:41 PM, Lizhi Hou wrote: On 5/6/25 02:20, Jacek Lawrynowicz wrote: Use FW names from linux-firmware repo instead of deprecated ones. Fixes: c140244f0cfb ("accel/ivpu: Add initial Panther Lake support") Cc: # v6.13+ Sig

Re: [PATCH] accel/ivpu: Use firmware names from upstream repo

2025-05-06 Thread Lizhi Hou
On 5/6/25 02:20, Jacek Lawrynowicz wrote: Use FW names from linux-firmware repo instead of deprecated ones. Fixes: c140244f0cfb ("accel/ivpu: Add initial Panther Lake support") Cc: # v6.13+ Signed-off-by: Jacek Lawrynowicz --- drivers/accel/ivpu/ivpu_fw.c | 12 ++-- 1 file changed

Re: [PATCH] accel/ivpu: Improve buffer object logging

2025-05-06 Thread Lizhi Hou
ad(&bo->base.base.refcount)); if (bo->base.pages) diff --git a/drivers/accel/ivpu/ivpu_gem.h b/drivers/accel/ivpu/ivpu_gem.h index a222a9ec9d611..0c93118c85bd3 100644 --- a/drivers/accel/ivpu/ivpu_gem.h +++ b/drivers/accel/ivpu/ivpu_gem.h @@ -21,6 +21,7 @@ struct ivpu_bo { u64 vpu_addr; u32 flags; u32 job_status; /* Valid only for command buffer */ + u32 ctx_id; Reviewed-by: Lizhi Hou bool mmu_mapped; };

Re: [PATCH V1] accel/amdxdna: Fix incorrect size of ERT_START_NPU commands

2025-04-10 Thread Lizhi Hou
On 4/10/25 00:27, Falkowski, Maciej wrote: On 4/9/2025 11:00 PM, Lizhi Hou wrote: When multiple ERT_START_NPU commands are combined in one buffer, the buffer size calculation is incorrect. Also, the condition to make sure the buffer size is not beyond 4K is also fixed. Fixes: aac243092b70

[PATCH V1] accel/amdxdna: Fix incorrect size of ERT_START_NPU commands

2025-04-09 Thread Lizhi Hou
When multiple ERT_START_NPU commands are combined in one buffer, the buffer size calculation is incorrect. Also, the condition to make sure the buffer size is not beyond 4K is also fixed. Fixes: aac243092b70 ("accel/amdxdna: Add command execution") Signed-off-by: Lizhi Hou --- dri

Re: [PATCH] accel/ivpu: Add cmdq_id to job related logs

2025-04-04 Thread Lizhi Hou
ount %u\n", file_priv->ctx.id, buffer_count); + ivpu_dbg(vdev, JOB, "Submit ioctl: ctx %u cmdq_id %u buf_count %u\n", +file_priv->ctx.id, cmdq_id, buffer_count); Reviewed-by: Lizhi Hou job = ivpu_job_create(file_priv, engine, buffer_count); if (!job) {

Re: [PATCH] accel/ivpu: Update FW Boot API to version 3.28.3

2025-04-03 Thread Lizhi Hou
On 4/1/25 08:58, Maciej Falkowski wrote: From: Karol Wachowski This commit bumps FW Boot API to 3.28.3. Bump FW Boot API ... Please see: https://www.kernel.org/doc/html/v6.14/process/submitting-patches.html Lizhi Use new preemption buffer size fields from FW header added to firmware

Re: [PATCH] accel/ivpu: Flush pending jobs of device's workqueues

2025-04-03 Thread Lizhi Hou
flush_work(&vdev->irq_ipc_work); + flush_work(&vdev->irq_dct_work); + flush_work(&vdev->context_abort_work); Reviewed-by: Lizhi Hou ivpu_ipc_disable(vdev); ivpu_mmu_disable(vdev); }

Re: [PATCH V3] accel/amdxdna: Add BO import and export

2025-03-28 Thread Lizhi Hou
On 3/28/25 09:16, Jeff Hugo wrote: On 3/25/2025 2:01 PM, Lizhi Hou wrote: Add amdxdna_gem_prime_export() and amdxdna_gem_prime_import() for BO import and export. Register mmu notifier for imported BO as well. When MMU_NOTIFIER_UNMAP event is received, queue work to remove the notifier. The

Re: [PATCH 2/2] accel/ivpu: Fix PM related deadlocks in MS IOCTLs

2025-03-28 Thread Lizhi Hou
k); ms = get_instance_by_mask(file_priv, args->metric_group_mask); @@ -218,6 +235,7 @@ int ivpu_ms_stop_ioctl(struct drm_device *dev, void *data, struct drm_file *file mutex_unlock(&file_priv->ms_lock); + ivpu_rpm_put(vdev); Reviewed-by: Lizhi Hou return ms ? 0 : -EINVAL; }

Re: [PATCH 1/2] accel/ivpu: Fix deadlock in ivpu_ms_cleanup()

2025-03-28 Thread Lizhi Hou
On 3/28/25 01:23, Jacek Lawrynowicz wrote: On 3/27/2025 6:38 PM, Lizhi Hou wrote: On 3/26/25 01:06, Jacek Lawrynowicz wrote: Hi, On 3/25/2025 9:50 PM, Lizhi Hou wrote: On 3/25/25 04:43, Maciej Falkowski wrote: From: Jacek Lawrynowicz Fix deadlock in ivpu_ms_cleanup() by preventing

Re: [PATCH 1/2] accel/ivpu: Fix deadlock in ivpu_ms_cleanup()

2025-03-27 Thread Lizhi Hou
On 3/26/25 01:06, Jacek Lawrynowicz wrote: Hi, On 3/25/2025 9:50 PM, Lizhi Hou wrote: On 3/25/25 04:43, Maciej Falkowski wrote: From: Jacek Lawrynowicz Fix deadlock in ivpu_ms_cleanup() by preventing runtime resume after file_priv->ms_lock is acquired. During a failure in runtime res

Re: [PATCH] accel/ivpu: Fix warning in ivpu_ipc_send_receive_internal()

2025-03-27 Thread Lizhi Hou
&vdev->drm, pm_runtime_status_suspended(vdev->drm.dev)); + drm_WARN_ON(&vdev->drm, pm_runtime_status_suspended(vdev->drm.dev) && + pm_runtime_enabled(vdev->drm.dev)); Reviewed-by: Lizhi Hou ivpu_ipc_consumer_add(vdev, &cons, channel, NULL);

Re: [PATCH V1] accel/amdxdna: Add BO import and export

2025-03-25 Thread Lizhi Hou
Hi Jeff, Just noticed that the driver should not use import_attach. https://lore.kernel.org/all/20250317131923.238374-1-tzimmerm...@suse.de/ I will remove the import_attach usage and send V3 patch. Thanks Lizhi On 3/21/25 12:52, Lizhi Hou wrote: On 3/21/25 08:15, Jeff Hugo wrote: On 3

Re: [PATCH 1/2] accel/ivpu: Fix deadlock in ivpu_ms_cleanup()

2025-03-25 Thread Lizhi Hou
On 3/25/25 04:43, Maciej Falkowski wrote: From: Jacek Lawrynowicz Fix deadlock in ivpu_ms_cleanup() by preventing runtime resume after file_priv->ms_lock is acquired. During a failure in runtime resume, a cold boot is executed, which calls ivpu_ms_cleanup_all(). This function calls ivpu_ms_c

[PATCH V3] accel/amdxdna: Add BO import and export

2025-03-25 Thread Lizhi Hou
application. Use a link list to track VMAs the BO been mapped. Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/TODO | 1 - drivers/accel/amdxdna/aie2_ctx.c| 65 ++-- drivers/accel/amdxdna/amdxdna_gem.c | 409 +++- drivers/accel/amdxdna/amdxdna_gem.h

Re: [PATCH V1] accel/amdxdna: Add BO import and export

2025-03-24 Thread Lizhi Hou
On 3/21/25 08:15, Jeff Hugo wrote: On 3/6/2025 11:03 AM, Lizhi Hou wrote: +struct drm_gem_object * +amdxdna_gem_prime_import(struct drm_device *dev, struct dma_buf *dma_buf) +{ +    struct dma_buf_attachment *attach; +    struct drm_gem_object *gobj; +    struct sg_table *sgt; +    int ret

[PATCH V2] accel/amdxdna: Add BO import and export

2025-03-22 Thread Lizhi Hou
application. Use a link list to track VMAs the BO been mapped. Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/TODO | 1 - drivers/accel/amdxdna/aie2_ctx.c| 65 ++-- drivers/accel/amdxdna/amdxdna_gem.c | 397 +++- drivers/accel/amdxdna/amdxdna_gem.h

[PATCH V1] accel/amdxdna: Add BO import and export

2025-03-06 Thread Lizhi Hou
application. Use a link list to track VMAs the BO been mapped. Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/TODO | 1 - drivers/accel/amdxdna/aie2_ctx.c| 65 +++-- drivers/accel/amdxdna/amdxdna_gem.c | 320 drivers/accel/amdxdna/amdxdna_gem.h

Re: [PATCH] accel/qaic: Fix possible data corruption in BOs > 2G

2025-03-06 Thread Lizhi Hou
nents = 0; + offf = 0; + offl = 0; Reviewed-by: Lizhi Hou size = size ? size : PAGE_SIZE; for_each_sgtable_dma_sg(sgt_in, sg, j) {

[PATCH V2] accel/amdxdna: Check interrupt register before mailbox_rx_worker exits

2025-02-26 Thread Lizhi Hou
this failure, driver checks the interrupt register before exiting mailbox_rx_worker(). If there is a new response, driver goes back to process it. Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/amdxdna_mailbox.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git

Re: [PATCH] accel/amdxdna: Check interrupt register before mailbox_rx_worker exits

2025-02-26 Thread Lizhi Hou
On 2/26/25 01:30, Jacek Lawrynowicz wrote: Hi, On 2/25/2025 6:26 PM, Lizhi Hou wrote: There is a timeout failure been found during stress tests. If the firmware generates a mailbox response right after driver clears the mailbox channel interrupt register, the hardware will not generate an

[PATCH] accel/amdxdna: Check interrupt register before mailbox_rx_worker exits

2025-02-25 Thread Lizhi Hou
this failure, driver checks the interrupt register before exiting mailbox_rx_worker(). If there is a new response, driver goes back to process it. Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/amdxdna_mailbox.c | 18 +++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff

Re: [PATCH v2] accel/amdxdna: Add missing include linux/slab.h

2025-02-19 Thread Lizhi Hou
) + pkg_size, GFP_KERNEL);    |   ^~~ Add the missing include. Fixes: b87f920b9344 ("accel/amdxdna: Support hardware mailbox") Signed-off-by: Su Hui Reviewed-by: Lizhi Hou Reviewed-by: Jeffrey Hugo Pushed to drm-misc-fixes Thanks, Lizhi

Re: [PATCH v4] drm/sched: Use struct for drm_sched_init() params

2025-02-11 Thread Lizhi Hou
>name, xdna->ddev.dev); + ret = drm_sched_init(sched, &args); Reviewed-by: Lizhi Hou if (ret) { XDNA_ERR(xdna, "Failed to init DRM scheduler. ret %d", ret); goto free_cmd_bufs;

Re: [PATCH] accel/amdxdna: Add missing include linux/slab.h

2025-02-10 Thread Lizhi Hou
ox.c index 814b16bb1953..80b4b20addd6 100644 --- a/drivers/accel/amdxdna/amdxdna_mailbox.c +++ b/drivers/accel/amdxdna/amdxdna_mailbox.c @@ -12,6 +12,7 @@ #define CREATE_TRACE_POINTS #include +#include Reviewed-by: Lizhi Hou #include "amdxdna_mailbox.h"

Re: [PATCH] accel/amdxdna: Add MODULE_FIRMWARE() declarations

2025-02-04 Thread Lizhi Hou
efine AMDXDNA_AUTOSUSPEND_DELAY 5000 /* milliseconds */ +MODULE_FIRMWARE("amdnpu/1502_00/npu.sbin"); +MODULE_FIRMWARE("amdnpu/17f0_10/npu.sbin"); +MODULE_FIRMWARE("amdnpu/17f0_11/npu.sbin"); +MODULE_FIRMWARE("amdnpu/17f0_20/npu.sbin"); + Reviewed-by: Lizhi Hou

[PATCH] accel/amdxdna: Refactor hardware context destroy routine

2025-01-24 Thread Lizhi Hou
. (drm_sched_entity_destroy) 2. Wait up to 2 seconds for pending commands. 3. Destroy hardware context and cancel the rest pending requests. 4. Wait all jobs associated with the hwctx are freed. 5. Free job resources. Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_ctx.c| 29

[PATCH 1/2] accel/amdxdna: Remove casting mailbox payload pointer

2025-01-13 Thread Lizhi Hou
//lore.kernel.org/oe-kbuild-all/202501130921.ktqwsmlh-...@intel.com/ Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_ctx.c | 22 +-- drivers/accel/amdxdna/aie2_error.c| 8 +++ drivers/accel/amdxdna/aie2_message.c | 10 - drivers/acce

[PATCH 2/2] accel/amdxdna: Declare sched_ops as static

2025-01-13 Thread Lizhi Hou
Fix sparse warning: symbol 'sched_ops' was not declared. Should it be static? Fixes: aac243092b70 ("accel/amdxdna: Add command execution") Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_ctx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d

[PATCH v2] accel/amdxdna: Return error when setting clock failed for npu1

2025-01-09 Thread Lizhi Hou
nter Closes: https://lore.kernel.org/dri-devel/202267d0-882e-4593-b58d-be9274592f9b@stanley.mountain/ Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_smu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/accel/amdxdna/aie2_smu.c b/drivers/accel/amdxdna/aie2_smu.

[PATCH] accel/amdxdna: Return error when setting clock failed for npu1

2025-01-08 Thread Lizhi Hou
nter Closes: https://lore.kernel.org/dri-devel/202267d0-882e-4593-b58d-be9274592f9b@stanley.mountain/ Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_smu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/accel/amdxdna/aie2_smu.c b/drivers/accel/amdx

Re: [PATCH 04/14] accel/ivpu: Expose NPU memory utilization info in sysfs

2025-01-08 Thread Lizhi Hou
On 1/7/25 09:32, Maciej Falkowski wrote: Expose NPU memory utilization info in sysfs in bytes to show total memory used by NPU (FW + runtime). Signed-off-by: Maciej Falkowski --- drivers/accel/ivpu/ivpu_sysfs.c | 30 +- 1 file changed, 29 insertions(+), 1 deleti

Re: [bug report] accel/amdxdna: Enhance power management settings

2025-01-08 Thread Lizhi Hou
On 1/8/25 00:40, Dan Carpenter wrote: Hello Lizhi Hou, Commit f4d7b8a6bc8c ("accel/amdxdna: Enhance power management settings") from Dec 13, 2024 (linux-next), leads to the following Smatch static checker warning: drivers/accel/amdxdna/aie2_smu.c:68 npu1_set_dpm()

[PATCH V1 6/7] accel/amdxdna: Add __user to second parameter of aie2_query_status

2025-01-02 Thread Lizhi Hou
vq2wjb-...@intel.com/ Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_pci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/accel/amdxdna/aie2_pci.h b/drivers/accel/amdxdna/aie2_pci.h index cc159cadff9f..f2d95531ddc2 100644 --- a/drivers/accel/amdxdna/aie2_pci.h

[PATCH V1 4/7] accel/amdxdna: Use rcu_access_pointer for __rcu pointer

2025-01-02 Thread Lizhi Hou
Use rcu_access_pointer for pid in struct drm_file. This fixes sparse warning. Fixes: be462c97b7df ("accel/amdxdna: Add hardware context") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202412311210.lfehtzlw-...@intel.com/ Signed-off-by: Lizhi Hou --

[PATCH V1 1/7] accel/amdxdna: Declare npu device profile as static variables

2025-01-02 Thread Lizhi Hou
v_priv' was not declared. Should it be static? Fixes: 8c9ff1b181ba ("accel/amdxdna: Add a new driver for AMD AI Engine") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202412310648.dtmhggem-...@intel.com/ Signed-off-by: Lizhi Hou --- drivers/accel

[PATCH V1 7/7] accel/amdxdna: Declare npu6_dev_priv as static

2025-01-02 Thread Lizhi Hou
Fix sparse warning: symbol 'npu6_dev_priv' was not declared. Should it be static? Fixes: 273b5176ac17 ("accel/amdxdna: Add RyzenAI-npu6 support") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202412311819.9mz11uak-...@intel.com/ Sign

[PATCH V1 5/7] accel/amdxdna: Declare force_cmdlist as static

2025-01-02 Thread Lizhi Hou
Fix sparse warning: symbol 'force_cmdlist' was not declared. Should it be static? Fixes: aac243092b70 ("accel/amdxdna: Add command execution") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202412311448.gkqj7upz-...@intel.com/ Sign

[PATCH V1 2/7] accel/amdxdna: Declare mailbox register base as __iomem pointer

2025-01-02 Thread Lizhi Hou
Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202412310857.syd1sxxo-...@intel.com/ Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_pci.c| 4 ++-- drivers/accel/amdxdna/amdxdna_mailbox.c | 24 drivers/accel/amdxdna/amdxdna_mailbo

[PATCH V1 3/7] accel/amdxdna: Declare aie2_max_col as static

2025-01-02 Thread Lizhi Hou
Fix the sparse warning: symbol 'aie2_max_col' was not declared. Should it be static? Fixes: c88d3325ae69 ("accel/amdxdna: Add hardware resource solver") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202412311028.x2utcshm-...@intel.com/ Sign

Re: [PATCH 6/7] accel/qaic: Add config structs for supported cards

2024-12-20 Thread Lizhi Hou
On 12/20/24 09:15, Jeffrey Hugo wrote: On 12/13/2024 5:35 PM, Lizhi Hou wrote: On 12/13/24 13:33, Jeffrey Hugo wrote: -static struct qaic_device *create_qdev(struct pci_dev *pdev, const struct pci_device_id *id) +static struct qaic_device *create_qdev(struct pci_dev *pdev

Re: [PATCH 7/7] accel/qaic: Add AIC200 support

2024-12-20 Thread Lizhi Hou
On 12/20/24 09:50, Jeffrey Hugo wrote: On 12/20/2024 10:33 AM, Lizhi Hou wrote: On 12/20/24 09:26, Jeffrey Hugo wrote: On 12/13/2024 5:49 PM, Lizhi Hou wrote: On 12/13/24 13:33, Jeffrey Hugo wrote: +static const struct qaic_device_config aic200_config = { +    .family = FAMILY_AIC200

Re: [PATCH 7/7] accel/qaic: Add AIC200 support

2024-12-20 Thread Lizhi Hou
On 12/20/24 09:26, Jeffrey Hugo wrote: On 12/13/2024 5:49 PM, Lizhi Hou wrote: On 12/13/24 13:33, Jeffrey Hugo wrote: @@ -573,6 +898,13 @@ struct mhi_controller *qaic_mhi_register_controller(struct pci_dev *pci_dev, voi   mhi_cntrl->nr_irqs = 1;   mhi_cntrl->irq = devm_k

[PATCH V1 2/2] accel/amdxdna: Remove DRM_AMDXDNA_HWCTX_CONFIG_NUM

2024-12-17 Thread Lizhi Hou
Defining a number of enum elements in uapi header is meaningless. It will not be used as expected and can potentially lead to incompatible issue between user space application and driver. Signed-off-by: Lizhi Hou --- include/uapi/drm/amdxdna_accel.h | 1 - 1 file changed, 1 deletion(-) diff

[PATCH V1 1/2] accel/amdxdna: Add zero check for pad in ioctl input structures

2024-12-17 Thread Lizhi Hou
For input ioctl structures, it is better to check if the pad is zero. Thus, the pad bytes might be usable in the future. Suggested-by: Jeffrey Hugo Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_ctx.c | 3 +++ drivers/accel/amdxdna/aie2_message.c | 3 +++ drivers/accel/amdxdna

Re: [PATCH V3 5/5] accel/amdxdna: Add zero check for pad in ioctl input structures

2024-12-16 Thread Lizhi Hou
On 12/16/24 12:38, Mario Limonciello wrote: On 12/13/2024 17:29, Lizhi Hou wrote: For input structures, it is better to check if the pad is zero. Thus, the pad bytes might be usable in the future. IIRC you should pick up: Suggested-by: Jeffrey Hugo Sure. Will add it. Signed-off-by

Re: [PATCH 7/7] accel/qaic: Add AIC200 support

2024-12-13 Thread Lizhi Hou
On 12/13/24 13:33, Jeffrey Hugo wrote: Add basic support for the new AIC200 product. The PCIe Device ID is 0xa110. With this, we can turn on the lights for AIC200 by leveraging much of the existing driver. Co-developed-by: Youssef Samir Signed-off-by: Youssef Samir Signed-off-by: Jeffrey Hug

Re: [PATCH 5/7] accel/qaic: Mask out SR-IOV PCI resources

2024-12-13 Thread Lizhi Hou
= pci_select_bars(pdev, IORESOURCE_MEM) & 0x3f; /* make sure the device has the expected BARs */ if (bars != (BIT(0) | BIT(2) | BIT(4))) { Reviewed-by: Lizhi Hou

Re: [PATCH 6/7] accel/qaic: Add config structs for supported cards

2024-12-13 Thread Lizhi Hou
On 12/13/24 13:33, Jeffrey Hugo wrote: As the number of cards supported by the driver grows, their configurations will differ. The driver needs to become more dynamic to support these configurations. Currently, each card may differ in the exposed BARs, the regions they map to, and the family.

Re: [PATCH 4/7] accel/qaic: Add support for MSI-X

2024-12-13 Thread Lizhi Hou
, 1, PCI_IRQ_MSI | PCI_IRQ_MSIX); if (ret < 0) return ret; Reviewed-by: Lizhi Hou

Re: [PATCH 3/7] accel/qaic: Allocate an exact number of MSIs

2024-12-13 Thread Lizhi Hou
d MSIs failed, operating in 1 MSI mode. Performance may be impacted.\n", +irq_count); } else if (ret < 0) { return ret; } Reviewed-by: Lizhi Hou

[PATCH V3 4/5] accel/amdxdna: Read firmware interface version from registers

2024-12-13 Thread Lizhi Hou
by: Min Ma Signed-off-by: Min Ma Reviewed-by: Mario Limonciello Reviewed-by: Jeffrey Hugo Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_message.c | 26 -- drivers/accel/amdxdna/aie2_pci.c | 74 ++-- drivers/accel/amdxdna/aie2_pci.h | 6 +-- dri

[PATCH V3 3/5] accel/amdxdna: Enhance power management settings

2024-12-13 Thread Lizhi Hou
DPM level been set. Initially, the driver set the power mode to default mode. Co-developed-by: Narendra Gutta Signed-off-by: Narendra Gutta Co-developed-by: George Yang Signed-off-by: George Yang Reviewed-by: Mario Limonciello Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/Makefile

[PATCH V3 2/5] accel/amdxdna: Replace idr api with xarray

2024-12-13 Thread Lizhi Hou
Switch mailbox message id and hardware context id management over from the idr api to the xarray api. Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/TODO | 1 - drivers/accel/amdxdna/aie2_ctx.c| 5 ++- drivers/accel/amdxdna/aie2_message.c| 5 ++- drivers/accel

[PATCH V3 5/5] accel/amdxdna: Add zero check for pad in ioctl input structures

2024-12-13 Thread Lizhi Hou
For input structures, it is better to check if the pad is zero. Thus, the pad bytes might be usable in the future. Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_ctx.c | 3 +++ drivers/accel/amdxdna/aie2_message.c | 3 +++ drivers/accel/amdxdna/amdxdna_ctx.c | 6 ++ drivers

[PATCH V3 1/5] accel/amdxdna: Add RyzenAI-npu6 support

2024-12-13 Thread Lizhi Hou
Add NPU6 registers and other private configurations. Co-developed-by: Xiaoming Ren Signed-off-by: Xiaoming Ren Reviewed-by: Mario Limonciello Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/Makefile | 3 +- drivers/accel/amdxdna/amdxdna_pci_drv.c | 1 + drivers/accel/amdxdna

[PATCH V3 0/5] AMD NPU driver improvements

2024-12-13 Thread Lizhi Hou
from this set - Add MBZ check for pad member of input ioctl structure - Fix for code review comments Changes since v1: - Add one patch to fix possible compiling failure - Minor fixes for code review comments Lizhi Hou (5): accel/amdxdna: Add RyzenAI-npu6 support accel/amdxdna: Replace idr api

Re: [PATCH 1/2] accel/amdxdna: use modern PM helpers

2024-12-13 Thread Lizhi Hou
On 12/13/24 09:49, Jeffrey Hugo wrote: On 12/13/2024 10:41 AM, Lizhi Hou wrote: On 12/13/24 09:07, Jeffrey Hugo wrote: On 12/13/2024 2:02 AM, Arnd Bergmann wrote: From: Arnd Bergmann The old SET_SYSTEM_SLEEP_PM_OPS and SET_RUNTIME_PM_OPS macros cause a build warning when CONFIG_PM is

Re: [PATCH 1/2] accel/amdxdna: use modern PM helpers

2024-12-13 Thread Lizhi Hou
On 12/13/24 09:07, Jeffrey Hugo wrote: On 12/13/2024 2:02 AM, Arnd Bergmann wrote: From: Arnd Bergmann The old SET_SYSTEM_SLEEP_PM_OPS and SET_RUNTIME_PM_OPS macros cause a build warning when CONFIG_PM is disabled: drivers/accel/amdxdna/amdxdna_pci_drv.c:343:12: error: 'amdxdna_pmops_res

Re: [PATCH V2 6/8] accel/amdxdna: Enhance power management settings

2024-12-13 Thread Lizhi Hou
On 12/13/24 08:55, Jeffrey Hugo wrote: On 12/6/2024 2:59 PM, Lizhi Hou wrote: +/** + * struct amdxdna_drm_get_power_mode - Get the configured power mode + * @power_mode: The mode type from enum amdxdna_power_mode_type + * @pad: MBZ. I don't see a check for zero in the implementati

Re: [PATCH V2 7/8] accel/amdxdna: Read firmware interface version from registers

2024-12-13 Thread Lizhi Hou
On 12/13/24 08:58, Jeffrey Hugo wrote: On 12/6/2024 3:00 PM, Lizhi Hou wrote: The latest released firmware supports reading firmware interface version from registers directly. The driver's probe routine reads the major and minor version numbers. If the firmware interface does not compa

Re: [PATCH V2 4/8] accel/amdxdna: Replace idr api with xarray

2024-12-13 Thread Lizhi Hou
On 12/13/24 08:42, Jeffrey Hugo wrote: On 12/6/2024 2:59 PM, Lizhi Hou wrote: Switch mailbox message id and hardware context id management over from the idr api to the xarray api. Signed-off-by: Lizhi Hou Implementation looks sane, however you appear to be missing several instances of

Re: [PATCH V2 3/8] accel/amdxdna: Add RyzenAI-npu6 support

2024-12-13 Thread Lizhi Hou
On 12/13/24 08:37, Jeffrey Hugo wrote: On 12/6/2024 2:59 PM, Lizhi Hou wrote: Add NPU6 registers and other private configurations. Co-developed-by: Xiaoming Ren Signed-off-by: Xiaoming Ren Signed-off-by: Lizhi Hou ---   drivers/accel/amdxdna/Makefile    |   3 +-   drivers/accel/amdxdna

Re: [PATCH V2 8/8] accel/amdxdna: Add include interrupt.h to amdxdna_mailbox.c

2024-12-13 Thread Lizhi Hou
On 12/13/24 08:20, Jeffrey Hugo wrote: On 12/6/2024 3:00 PM, Lizhi Hou wrote: For amdxdna_mailbox.c, linux/interrupt.h is indirectly included by trace/events/amdxdna.h. So if TRACING is disabled, driver compiling will fail. Fixes: b87f920b9344 ("accel/amdxdna: Support hardware ma

[PATCH] accel/amdxdna: Add include interrupt.h to amdxdna_mailbox.c

2024-12-13 Thread Lizhi Hou
el.org/dri-devel/CAHbf0-E+Z2O7rW-x+-EKNQ-nLbf=_ohanzxxe7wd2cj9kfj...@mail.gmail.com/ Signed-off-by: Mike Lothian Reviewed-by: Mario Limonciello Reviewed-by: Jeffrey Hugo Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/amdxdna_mailbox.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dri

Re: [PATCH V2 7/8] accel/amdxdna: Read firmware interface version from registers

2024-12-10 Thread Lizhi Hou
On 12/10/24 16:20, Mario Limonciello wrote: On 12/6/2024 16:00, Lizhi Hou wrote: The latest released firmware supports reading firmware interface version from registers directly. The driver's probe routine reads the major and minor version numbers. If the firmware interface doe

Re: [PATCH V2 6/8] accel/amdxdna: Enhance power management settings

2024-12-10 Thread Lizhi Hou
On 12/10/24 16:28, Mario Limonciello wrote: On 12/6/2024 15:59, Lizhi Hou wrote: Add SET_STATE ioctl to configure device power mode for aie2 device. Three modes are supported initially. POWER_MODE_DEFAULT: Enable clock gating and set DPM (Dynamic Power Management) level to value which has

Re: [PATCH V7 03/10] accel/amdxdna: Support hardware mailbox

2024-12-10 Thread Lizhi Hou
On 12/6/24 14:55, Jeffrey Hugo wrote: On 12/6/2024 11:47 AM, Lizhi Hou wrote: On 12/6/24 09:01, Mike Lothian wrote: On Fri, 6 Dec 2024 at 16:41, Mike Lothian wrote: On Fri, 6 Dec 2024 at 16:26, Jeffrey Hugo wrote: On 12/5/2024 8:44 AM, Mike Lothian wrote: Hi I needed to add the

[PATCH V2 1/8] accel/amdxdna: Add device status for aie2 devices

2024-12-06 Thread Lizhi Hou
Add device status to track if aie2_hw_start() or aie2_hw_stop() is re-entered. In aie2_hw_stop(), call drmm_kfree to free mbox. Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_pci.c| 17 + drivers/accel/amdxdna/aie2_pci.h| 7 +++ drivers/accel

[PATCH V2 8/8] accel/amdxdna: Add include interrupt.h to amdxdna_mailbox.c

2024-12-06 Thread Lizhi Hou
E+Z2O7rW-x+-EKNQ-nLbf=_ohanzxxe7wd2cj9kfj...@mail.gmail.com/ Signed-off-by: Mike Lothian Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/amdxdna_mailbox.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/accel/amdxdna/amdxdna_mailbox.c b/drivers/accel/amdxdna/amdxdna_mailb

[PATCH V2 7/8] accel/amdxdna: Read firmware interface version from registers

2024-12-06 Thread Lizhi Hou
ed-by: Min Ma Signed-off-by: Min Ma Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_message.c | 26 -- drivers/accel/amdxdna/aie2_pci.c | 74 ++-- drivers/accel/amdxdna/aie2_pci.h | 6 +-- drivers/accel/amdxdna/npu1_regs.c| 2 +- drivers/acc

[PATCH V2 4/8] accel/amdxdna: Replace idr api with xarray

2024-12-06 Thread Lizhi Hou
Switch mailbox message id and hardware context id management over from the idr api to the xarray api. Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/TODO | 1 - drivers/accel/amdxdna/aie2_ctx.c| 4 +- drivers/accel/amdxdna/aie2_message.c| 4 +- drivers/accel

[PATCH V2 6/8] accel/amdxdna: Enhance power management settings

2024-12-06 Thread Lizhi Hou
DPM level been set. Initially, the driver set the power mode to default mode. Co-developed-by: Narendra Gutta Signed-off-by: Narendra Gutta Co-developed-by: George Yang Signed-off-by: George Yang Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/Makefile | 1 + drivers/accel

[PATCH V2 2/8] accel/amdxdna: Replace mmput with mmput_async to avoid dead lock

2024-12-06 Thread Lizhi Hou
accel/amdxdna: Add command execution") Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_ctx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/accel/amdxdna/aie2_ctx.c b/drivers/accel/amdxdna/aie2_ctx.c index 90e8d87666a9..b5282555bbf2 100644 --- a/drivers/acc

[PATCH V2 5/8] accel/amdxdna: Add query firmware version

2024-12-06 Thread Lizhi Hou
Enhance GET_INFO ioctl to support retrieving firmware version. Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_pci.c | 20 include/uapi/drm/amdxdna_accel.h | 16 +++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/drivers/accel/amdxdna

[PATCH V2 0/8] AMD NPU driver improvements

2024-12-06 Thread Lizhi Hou
possible compiling failure - Minor fixes for code review comments Lizhi Hou (8): accel/amdxdna: Add device status for aie2 devices accel/amdxdna: Replace mmput with mmput_async to avoid dead lock accel/amdxdna: Add RyzenAI-npu6 support accel/amdxdna: Replace idr api with xarray accel

[PATCH V2 3/8] accel/amdxdna: Add RyzenAI-npu6 support

2024-12-06 Thread Lizhi Hou
Add NPU6 registers and other private configurations. Co-developed-by: Xiaoming Ren Signed-off-by: Xiaoming Ren Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/Makefile| 3 +- drivers/accel/amdxdna/npu6_regs.c | 121 ++ 2 files changed, 123 insertions(+), 1

Re: [PATCH V7 03/10] accel/amdxdna: Support hardware mailbox

2024-12-06 Thread Lizhi Hou
On 12/6/24 09:01, Mike Lothian wrote: On Fri, 6 Dec 2024 at 16:41, Mike Lothian wrote: On Fri, 6 Dec 2024 at 16:26, Jeffrey Hugo wrote: On 12/5/2024 8:44 AM, Mike Lothian wrote: Hi I needed to add the following to get things compiling for me diff --git a/drivers/accel/amdxdna/amdxdna_ma

Re: [PATCH V7 03/10] accel/amdxdna: Support hardware mailbox

2024-12-06 Thread Lizhi Hou
On 12/6/24 09:52, Mike Lothian wrote: On Fri, 6 Dec 2024 at 17:10, Lizhi Hou wrote: Hi Mike, How did you install npu.sbin.1.5.2.380? There should be a symlink npu.sbin which points to npu.sbin.1.5.2.380. https://gitlab.com/kernel-firmware/linux-firmware/-/blob/main/WHENCE?ref_type=heads

Re: [PATCH V7 03/10] accel/amdxdna: Support hardware mailbox

2024-12-06 Thread Lizhi Hou
Hi Mike, How did you install npu.sbin.1.5.2.380?  There should be a symlink npu.sbin which points to npu.sbin.1.5.2.380. https://gitlab.com/kernel-firmware/linux-firmware/-/blob/main/WHENCE?ref_type=heads#L2719 Thanks, Lizhi On 12/5/24 07:44, Mike Lothian wrote: Hi I needed to add the f

Re: [PATCH V1 6/7] accel/amdxdna: Enhance power management settings

2024-12-05 Thread Lizhi Hou
On 12/4/24 19:52, Mario Limonciello wrote: On 12/4/2024 15:37, Lizhi Hou wrote: Add SET_STATE ioctl to configure device power mode for aie2 device. Three modes are supported initially. POWER_MODE_DEFAULT: Enable clock gating and set DPM (Dynamic Power Management) level to value which has

Re: [PATCH V1 1/7] accel/amdxdna: Add device status for aie2 devices

2024-12-04 Thread Lizhi Hou
On 12/4/24 14:26, Mario Limonciello wrote: On 12/4/2024 15:37, Lizhi Hou wrote: Add device status to track if aie2_hw_start() or aie2_hw_stop() is re-entered. In aie2_hw_stop(), call drmm_kfree to free mbox. Signed-off-by: Lizhi Hou ---   drivers/accel/amdxdna/aie2_pci.c    | 17

Re: [PATCH V1 5/7] accel/amdxdna: Add query firmware version

2024-12-04 Thread Lizhi Hou
On 12/4/24 14:24, Mario Limonciello wrote: On 12/4/2024 15:37, Lizhi Hou wrote: Enhance GET_INFO ioctl to support retrieving firmware version. Signed-off-by: Lizhi Hou ---   drivers/accel/amdxdna/aie2_pci.c | 20   include/uapi/drm/amdxdna_accel.h | 19

[PATCH V1 5/7] accel/amdxdna: Add query firmware version

2024-12-04 Thread Lizhi Hou
Enhance GET_INFO ioctl to support retrieving firmware version. Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_pci.c | 20 include/uapi/drm/amdxdna_accel.h | 19 +++ 2 files changed, 39 insertions(+) diff --git a/drivers/accel/amdxdna/aie2_pci.c b

[PATCH V1 7/7] accel/amdxdna: Read firmware interface version from registers

2024-12-04 Thread Lizhi Hou
ed-by: Min Ma Signed-off-by: Min Ma Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_message.c | 26 -- drivers/accel/amdxdna/aie2_pci.c | 74 ++-- drivers/accel/amdxdna/aie2_pci.h | 6 +-- drivers/accel/amdxdna/npu1_regs.c| 2 +- drivers/acc

[PATCH V1 6/7] accel/amdxdna: Enhance power management settings

2024-12-04 Thread Lizhi Hou
DPM level been set. Initially, the driver set the power mode to default mode. Co-developed-by: Narendra Gutta Signed-off-by: Narendra Gutta Co-developed-by: George Yang Signed-off-by: George Yang Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/Makefile | 1 + drivers/accel

[PATCH V1 1/7] accel/amdxdna: Add device status for aie2 devices

2024-12-04 Thread Lizhi Hou
Add device status to track if aie2_hw_start() or aie2_hw_stop() is re-entered. In aie2_hw_stop(), call drmm_kfree to free mbox. Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_pci.c| 17 + drivers/accel/amdxdna/aie2_pci.h| 7 +++ drivers/accel

[PATCH V1 3/7] accel/amdxdna: Add RyzenAI-npu6 support

2024-12-04 Thread Lizhi Hou
Add NPU6 registers and other private configurations. Co-developed-by: Xiaoming Ren Signed-off-by: Xiaoming Ren Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/Makefile| 3 +- drivers/accel/amdxdna/npu6_regs.c | 121 ++ 2 files changed, 123 insertions(+), 1

[PATCH V1 4/7] accel/amdxdna: Replace idr api with xarray

2024-12-04 Thread Lizhi Hou
Switch mailbox message id and hardware context id management over from the idr api to the xarray api. Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/TODO | 1 - drivers/accel/amdxdna/aie2_ctx.c| 4 +- drivers/accel/amdxdna/aie2_message.c| 4 +- drivers/accel

[PATCH V1 0/7] AMD NPU driver improvements

2024-12-04 Thread Lizhi Hou
Add recent improvements and bug fixes for amdxdna driver (depends on [1]) 1. Support recent hardware and firmware. 2. Replace idr APIs with xarray. 3. Fix the bugs been found. [1]: https://lore.kernel.org/all/20241118172942.2014541-1-lizhi@amd.com/ Lizhi Hou (7): accel/amdxdna: Add device

[PATCH V1 2/7] accel/amdxdna: Replace mmput with mmput_async to avoid dead lock

2024-12-04 Thread Lizhi Hou
Hardware mailbox message receiving handler calls mmput to release the process mm. If the process has already exited, the mmput here may call mmu notifier handler, amdxdna_hmm_invalidate, which will cause a dead lock. Using mmput_async instead prevents this dead lock. Signed-off-by: Lizhi Hou

Re: [PATCH V11 00/10] AMD XDNA driver

2024-11-22 Thread Lizhi Hou
Cool! You made my day. :) Appreciate all your help. Lizhi On 11/22/24 10:52, Jeffrey Hugo wrote: On 11/18/2024 10:29 AM, Lizhi Hou wrote: This patchset introduces a new Linux Kernel Driver, amdxdna for AMD NPUs. The driver is based on Linux accel subsystem. Merged to drm-misc-next -Jeff

[PATCH V11 00/10] AMD XDNA driver

2024-11-18 Thread Lizhi Hou
code review comments Changes since v2: - Add document amdnpu.rst - Change AIE2_DEVM_SIZE to 64M due to firmware change - Changes based on code review comments Changes since v1: - Remove some inline defines - Minor changes based on code review comments Lizhi Hou (10): accel/amdxdna: Add document

[PATCH V11 04/10] accel/amdxdna: Add hardware resource solver

2024-11-18 Thread Lizhi Hou
The AI Engine consists of 2D array of tiles arranged as columns. Provides the basic column allocation and release functions for the tile columns. Co-developed-by: Min Ma Signed-off-by: Min Ma Reviewed-by: Jeffrey Hugo Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/Makefile | 1

[PATCH V11 09/10] accel/amdxdna: Add error handling

2024-11-18 Thread Lizhi Hou
using the column where error occurred. Then the driver resets that column. Co-developed-by: Min Ma Signed-off-by: Min Ma Reviewed-by: Jeffrey Hugo Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/Makefile | 1 + drivers/accel/amdxdna/aie2_error.c | 360

[PATCH V11 03/10] accel/amdxdna: Support hardware mailbox

2024-11-18 Thread Lizhi Hou
Ma Reviewed-by: Jeffrey Hugo Signed-off-by: Lizhi Hou --- MAINTAINERS | 1 + drivers/accel/amdxdna/Makefile| 3 + drivers/accel/amdxdna/aie2_message.c | 194 ++ drivers/accel/amdxdna/aie2_msg_priv.h | 370

  1   2   3   >