Re: [PATCH v2] accel/ivpu: Split FW runtime and global memory buffers

2025-09-25 Thread Lizhi Hou
Reviewed-by: Lizhi Hou On 9/25/25 00:42, Karol Wachowski wrote: Split firmware boot parameters (4KB) and FW version (4KB) into dedicated buffer objects, separating them from the FW runtime memory buffer. This creates three distinct buffers with independent allocation control. This enables

Re: [PATCH V3] accel/amdxdna: Enhance runtime power management

2025-09-24 Thread Lizhi Hou
Applied to drm-misc-next On 9/23/25 08:29, Karol Wachowski wrote: Reviewed-by: Karol Wachowski On 9/23/2025 5:22 PM, Lizhi Hou wrote: Currently, pm_runtime_resume_and_get() is invoked in the driver's open callback, and pm_runtime_put_autosuspend() is called in the close callback. As a r

Re: [PATCH v1] accel/ivpu: Split FW runtime and global memory buffers

2025-09-24 Thread Lizhi Hou
On 9/23/25 04:18, Karol Wachowski wrote: Split firmware boot parameters (4KB) and FW version (4KB) into dedicated buffer objects, separating them from the FW runtime memory buffer. This creates three distinct buffers with independent allocation control. This enables future modifications, parti

[PATCH V3] accel/amdxdna: Enhance runtime power management

2025-09-23 Thread Lizhi Hou
Move the runtime PM calls to the AIE2 callbacks that actually interact with the hardware. The device will automatically suspend after 5 seconds of inactivity (no hardware accesses and no pending commands), and it will be resumed on the next hardware access. Signed-off-by: Lizhi Hou --- drivers/

Re: [PATCH V2] accel/amdxdna: Enhance runtime power management

2025-09-22 Thread Lizhi Hou
On 9/22/25 01:40, Karol Wachowski wrote: On 9/18/2025 9:51 PM, Lizhi Hou wrote: Currently, pm_runtime_resume_and_get() is invoked in the driver's open callback, and pm_runtime_put_autosuspend() is called in the close callback. As a result, the device remains active whenever an applic

[PATCH V2] accel/amdxdna: Enhance runtime power management

2025-09-18 Thread Lizhi Hou
Move the runtime PM calls to the AIE2 callbacks that actually interact with the hardware. The device will automatically suspend after 5 seconds of inactivity (no hardware accesses and no pending commands), and it will be resumed on the next hardware access. Signed-off-by: Lizhi Hou --- drivers/

Re: [PATCH V1] accel/amdxdna: Enhance runtime power management

2025-09-18 Thread Lizhi Hou
On 9/18/25 11:23, Mario Limonciello wrote: On 9/18/2025 1:05 PM, Lizhi Hou wrote: On 9/18/25 10:43, Mario Limonciello wrote: On 9/18/2025 12:41 PM, Lizhi Hou wrote: On 9/18/25 10:31, Mario Limonciello wrote: On 9/18/2025 12:24 PM, Lizhi Hou wrote: Currently

Re: [PATCH V1] accel/amdxdna: Enhance runtime power management

2025-09-18 Thread Lizhi Hou
On 9/18/25 10:43, Mario Limonciello wrote: On 9/18/2025 12:41 PM, Lizhi Hou wrote: On 9/18/25 10:31, Mario Limonciello wrote: On 9/18/2025 12:24 PM, Lizhi Hou wrote: Currently, pm_runtime_resume_and_get() is invoked in the driver's open callback, and pm_runtime_put_autosuspend

Re: [PATCH V1] accel/amdxdna: Enhance runtime power management

2025-09-18 Thread Lizhi Hou
On 9/18/25 10:31, Mario Limonciello wrote: On 9/18/2025 12:24 PM, Lizhi Hou wrote: Currently, pm_runtime_resume_and_get() is invoked in the driver's open callback, and pm_runtime_put_autosuspend() is called in the close callback. As a result, the device remains active whenev

[PATCH V1] accel/amdxdna: Fix an integer overflow in aie2_query_ctx_status_array()

2025-09-18 Thread Lizhi Hou
6a42c ("accel/amdxdna: Add ioctl DRM_IOCTL_AMDXDNA_GET_ARRAY") Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_pci.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/accel/amdxdna/aie2_pci.c b/drivers/accel/amdxdna/aie2_pci.c index 87c425e3d2b9..6e39c769bb6d 100

[PATCH V1] accel/amdxdna: Enhance runtime power management

2025-09-18 Thread Lizhi Hou
Move the runtime PM calls to the AIE2 callbacks that actually interact with the hardware. The device will automatically suspend after 5 seconds of inactivity (no hardware accesses and no pending commands), and it will be resumed on the next hardware access. Signed-off-by: Lizhi Hou --- drivers/

Re: [RESEND PATCH V1] accel/amdxdna: Call dma_buf_vmap_unlocked() for imported object

2025-09-17 Thread Lizhi Hou
On 9/16/25 08:55, Falkowski, Maciej wrote: On 9/15/2025 6:10 PM, Lizhi Hou wrote: In amdxdna_gem_obj_vmap(), calling dma_buf_vmap() triggers a kernel warning if LOCKDEP is enabled. So for imported object, use dma_buf_vmap_unlocked(). Then, use drm_gem_vmap() for other objects. The similar

Re: [PATCH V2] accel/amdxdna: Call dma_buf_vmap_unlocked() for imported object

2025-09-17 Thread Lizhi Hou
Applied to drm-misc-next On 9/17/25 07:15, Falkowski, Maciej wrote: Reviewed-by: Maciej Falkowski On 9/16/2025 7:48 PM, Lizhi Hou wrote: In amdxdna_gem_obj_vmap(), calling dma_buf_vmap() triggers a kernel warning if LOCKDEP is enabled. So for imported object, use dma_buf_vmap_unlocked

Re: [PATCH] accel/ivpu: Add support for user-managed preemption buffer

2025-09-17 Thread Lizhi Hou
On 9/17/25 00:24, Karol Wachowski wrote: On 9/16/2025 5:29 PM, Lizhi Hou wrote: On 9/16/25 01:25, Karol Wachowski wrote: On 9/15/2025 10:33 PM, Lizhi Hou wrote: On 9/15/25 03:34, Karol Wachowski wrote: From: Andrzej Kacprowski Allow user mode drivers to manage preemption buffers

[PATCH V2] accel/amdxdna: Call dma_buf_vmap_unlocked() for imported object

2025-09-16 Thread Lizhi Hou
space allocated buffer") Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/amdxdna_gem.c | 47 - 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/drivers/accel/amdxdna/amdxdna_gem.c b/drivers/accel/amdxdna/amdxdna_gem.c index d407a36eb412..7f91863c3

Re: [PATCH] accel/ivpu: Add support for user-managed preemption buffer

2025-09-16 Thread Lizhi Hou
On 9/16/25 01:25, Karol Wachowski wrote: On 9/15/2025 10:33 PM, Lizhi Hou wrote: On 9/15/25 03:34, Karol Wachowski wrote: From: Andrzej Kacprowski Allow user mode drivers to manage preemption buffers, enabling memory savings by sharing a single buffer across multiple command queues within

Re: [PATCH v1] accel/ivpu: Update JSM firmware API to latest 3.32.5 version

2025-09-16 Thread Lizhi Hou
Reviewed-by: Lizhi Hou On 9/16/25 01:41, Karol Wachowski wrote: Synchronize the JSM API header file with the latest 3.32.5 version to reflect all changes introduced in the new firmware API Signed-off-by: Karol Wachowski --- v0 -> v1: Corrected commit message wording to better reflect

Re: [PATCH v1] accel/ivpu: Ensure rpm_runtime_put in case of engine reset/resume fail

2025-09-16 Thread Lizhi Hou
Reviewed-by: Lizhi Hou On 9/16/25 01:48, Karol Wachowski wrote: Previously, aborting work could return early after engine reset or resume failure, skipping the necessary runtime_put cleanup leaving the device with incorrect reference count breaking runtime power management state. Replace

Re: [PATCH] accel/ivpu: Sync JSM API header file with FW original

2025-09-15 Thread Lizhi Hou
On 9/15/25 03:35, Karol Wachowski wrote: Update firmware JSM API header to version 3.32.5 The changes seem more than updating header version? Lizhi Signed-off-by: Karol Wachowski --- drivers/accel/ivpu/vpu_jsm_api.h | 513 --- 1 file changed, 326 insertion

Re: [PATCH] accel/ivpu: Refactor priority_bands_show for readability

2025-09-15 Thread Lizhi Hou
Reviewed-by: Lizhi Hou On 9/15/25 03:34, Karol Wachowski wrote: From: Jacek Lawrynowicz Reduce code duplication and improve the overall readability of the debugfs output for job scheduling priority bands. Additionally fix clang-tidy warning about missing default case in the switch statement

Re: [PATCH] accel/ivpu: Reset cmdq->db_id on register failure

2025-09-15 Thread Lizhi Hou
Reviewed-by: Lizhi Hou On 9/15/25 03:34, Karol Wachowski wrote: Ensure that cmdq->db_id is reset to 0 if ivpu_jsm_register_db fails, preventing potential reuse of invalid command queue with unregistered doorbell. Signed-off-by: Karol Wachowski --- drivers/accel/ivpu/ivpu_job.c

Re: [PATCH] accel/ivpu: Add support for user-managed preemption buffer

2025-09-15 Thread Lizhi Hou
On 9/15/25 03:34, Karol Wachowski wrote: From: Andrzej Kacprowski Allow user mode drivers to manage preemption buffers, enabling memory savings by sharing a single buffer across multiple command queues within the same memory context. Introduce DRM_IVPU_PARAM_PREEMPT_BUFFER_SIZE to report the

Re: [PATCH] accel/ivpu: Ensure rpm_runtime_put in case of engine reset/resume fail

2025-09-15 Thread Lizhi Hou
This looks a bug fix. Is adding 'Fixes:' tag better? On 9/15/25 03:35, Karol Wachowski wrote: Previously, aborting work could return early after engine reset or resume failure, skipping the necessary runtime_put cleanup leaving the device with incorrect reference count breaking runtime power man

Re: [PATCH] accel/ivpu: Remove unused firmware boot parameters

2025-09-15 Thread Lizhi Hou
Reviewed-by: Lizhi Hou On 9/15/25 03:35, Karol Wachowski wrote: From: Andrzej Kacprowski Remove references to firmware boot parameters that were never used by any production version of device firmware. Signed-off-by: Andrzej Kacprowski Signed-off-by: Karol Wachowski --- drivers/accel

[RESEND PATCH V1] accel/amdxdna: Call dma_buf_vmap_unlocked() for imported object

2025-09-15 Thread Lizhi Hou
space allocated buffer") Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/amdxdna_gem.c | 38 +++-- 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/drivers/accel/amdxdna/amdxdna_gem.c b/drivers/accel/amdxdna/amdxdna_gem.c index d407a36eb412..50950be18

Re: [PATCH V1] accel/amdxdna: Fix an integer overflow in aie2_query_ctx_status_array()

2025-09-11 Thread Lizhi Hou
Applied to drm-misc-next On 9/11/25 07:56, Falkowski, Maciej wrote: Reviewed-by: Maciej Falkowski On 9/9/2025 5:45 PM, Lizhi Hou wrote: The unpublished smatch static checker reported a warning. drivers/accel/amdxdna/aie2_pci.c:904 aie2_query_ctx_status_array() warn: potential user

Re: [bug report] accel/amdxdna: Add ioctl DRM_IOCTL_AMDXDNA_GET_ARRAY

2025-09-08 Thread Lizhi Hou
On 9/8/25 13:13, Dan Carpenter wrote: On Mon, Sep 08, 2025 at 11:19:33AM -0700, Lizhi Hou wrote: On 9/7/25 23:40, Dan Carpenter wrote: Hello Lizhi Hou, Commit 2f509fe6a42c ("accel/amdxdna: Add ioctl DRM_IOCTL_AMDXDNA_GET_ARRAY") from Sep 2, 2025 (linux-next), leads to the

Re: [bug report] accel/amdxdna: Add ioctl DRM_IOCTL_AMDXDNA_GET_ARRAY

2025-09-08 Thread Lizhi Hou
On 9/7/25 23:40, Dan Carpenter wrote: Hello Lizhi Hou, Commit 2f509fe6a42c ("accel/amdxdna: Add ioctl DRM_IOCTL_AMDXDNA_GET_ARRAY") from Sep 2, 2025 (linux-next), leads to the following (UNPUBLISHED) Smatch static checker warning: drivers/accel/amdxdna/aie2

[PATCH V1] accel/amdxdna: Call dma_buf_vmap_unlocked() for imported object

2025-09-05 Thread Lizhi Hou
space allocated buffer") Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/amdxdna_gem.c | 38 +++-- 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/drivers/accel/amdxdna/amdxdna_gem.c b/drivers/accel/amdxdna/amdxdna_gem.c index d407a36eb412..50950be18

Re: [PATCH v3] MAINTAINERS: Update Min Ma's email for AMD XDNA driver

2025-09-04 Thread Lizhi Hou
Thanks. Applied to drm-misc-next On 9/4/25 10:50, Lucas De Marchi wrote: On Thu, Sep 04, 2025 at 10:15:42AM -0700, Lizhi Hou wrote: Hi Lucas I got a dim error when applying this patch. Could you take a look? Maybe there is not a maintainer for MAINTAINERS? :) Yes. A little bit worse than

Re: [PATCH v3] MAINTAINERS: Update Min Ma's email for AMD XDNA driver

2025-09-04 Thread Lizhi Hou
i On 9/2/25 12:47, Lizhi Hou wrote: Reviewed-by: Lizhi Hou On 8/30/25 17:12, Min Ma wrote: I recently left AMD and would like to continue participating in the review and maintenance of the XDNA driver using my personal email address. Signed-off-by: Min Ma ---   MAINTAINERS | 2 +-   1

Re: [PATCH V4] accel/amdxdna: Add ioctl DRM_IOCTL_AMDXDNA_GET_ARRAY

2025-09-04 Thread Lizhi Hou
Applied to drm-misc-next On 9/2/25 23:54, Falkowski, Maciej wrote: Reviewed-by: Maciej Falkowski On 9/3/2025 7:34 AM, Lizhi Hou wrote: Add interface for applications to get information array. The application provides a buffer pointer along with information type, maximum number of entries and

Re: [PATCH V3] accel/amdxdna: Add ioctl DRM_IOCTL_AMDXDNA_GET_ARRAY

2025-09-03 Thread Lizhi Hou
On 9/2/25 12:48, Alex Deucher wrote: On Tue, Sep 2, 2025 at 2:09 PM Lizhi Hou wrote: Add interface for applications to get information array. The application provides a buffer pointer along with information type, maximum number of entries and maximum size of each entry. The buffer may also

[PATCH V4] accel/amdxdna: Add ioctl DRM_IOCTL_AMDXDNA_GET_ARRAY

2025-09-02 Thread Lizhi Hou
actual number of entries and entry size are returned. (see [1], used by driver runtime library) [1] https://github.com/amd/xdna-driver/blob/main/src/shim/host/platform_host.cpp#L337 Reviewed-by: Mario Limonciello (AMD) Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_pci.c| 116

Re: [PATCH v3] MAINTAINERS: Update Min Ma's email for AMD XDNA driver

2025-09-02 Thread Lizhi Hou
Reviewed-by: Lizhi Hou On 8/30/25 17:12, Min Ma wrote: I recently left AMD and would like to continue participating in the review and maintenance of the XDNA driver using my personal email address. Signed-off-by: Min Ma --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion

Re: [PATCH V3] accel/amdxdna: Add ioctl DRM_IOCTL_AMDXDNA_GET_ARRAY

2025-09-02 Thread Lizhi Hou
On 9/2/25 13:15, Alex Deucher wrote: On Tue, Sep 2, 2025 at 3:58 PM Lizhi Hou wrote: On 9/2/25 12:48, Alex Deucher wrote: On Tue, Sep 2, 2025 at 2:09 PM Lizhi Hou wrote: Add interface for applications to get information array. The application provides a buffer pointer along with

[PATCH V3] accel/amdxdna: Add ioctl DRM_IOCTL_AMDXDNA_GET_ARRAY

2025-09-02 Thread Lizhi Hou
actual number of entries and entry size are returned. Signed-off-by: Lizhi Hou Link: https://lore.kernel.org/r/20250827203031.1512508-1-lizhi@amd.com --- drivers/accel/amdxdna/aie2_pci.c| 116 ++-- drivers/accel/amdxdna/amdxdna_pci_drv.c | 30 ++ drivers/accel

Re: [PATCH V2] accel/amdxdna: Add ioctl DRM_IOCTL_AMDXDNA_GET_ARRAY

2025-09-02 Thread Lizhi Hou
On 9/2/25 10:02, Falkowski, Maciej wrote: On 8/27/2025 10:30 PM, Lizhi Hou wrote: Add interface for applications to get information array. The application provides a buffer pointer along with information type, maximum number of entries and maximum size of each entry. The buffer may also

Re: [PATCH v2] accel/amdxdna: Use int instead of u32 to store error codes

2025-08-29 Thread Lizhi Hou
Applied to drm-misc-next. On 8/28/25 13:23, Lizhi Hou wrote: Reviewed-by: Lizhi Hou On 8/27/25 20:39, Qianfeng Rong wrote: Change the 'ret' variable from u32 to int to store -EINVAL.  Storing the negative error codes in unsigned type, doesn't cause an issue at runtime but it&

Re: [PATCH v2] MAINTAINERS: Update Min Ma's email for AMD XDNA driver

2025-08-29 Thread Lizhi Hou
(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 10850512c118..6eefa494000c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1231,7 +1231,7 @@ F:drivers/spi/spi-amd.c F:drivers/spi/spi-amd.h AMD XDNA DRIVER -M: Min Ma +M: Min Ma M:Lizhi Hou L:dri

Re: [PATCH v2] accel/amdxdna: Use int instead of u32 to store error codes

2025-08-28 Thread Lizhi Hou
Reviewed-by: Lizhi Hou On 8/27/25 20:39, Qianfeng Rong wrote: Change the 'ret' variable from u32 to int to store -EINVAL. Storing the negative error codes in unsigned type, doesn't cause an issue at runtime but it's ugly as pants. Additionally, assigning -EINVAL to u3

[PATCH V2] accel/amdxdna: Add ioctl DRM_IOCTL_AMDXDNA_GET_ARRAY

2025-08-27 Thread Lizhi Hou
actual number of entries and entry size are returned. Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_pci.c| 116 ++-- drivers/accel/amdxdna/amdxdna_pci_drv.c | 30 ++ drivers/accel/amdxdna/amdxdna_pci_drv.h | 1 + include/uapi/drm/amdxdna_accel.h

Re: [PATCH V1] accel/amdxdna: Add ioctl DRM_IOCTL_AMDXDNA_GET_ARRAY

2025-08-27 Thread Lizhi Hou
On 8/27/25 11:09, Mario Limonciello wrote: On 8/27/2025 11:41 AM, Lizhi Hou wrote: On 8/26/25 17:31, Mario Limonciello wrote: On 8/26/2025 1:10 PM, Lizhi Hou wrote: On 8/26/25 10:58, Mario Limonciello wrote: On 8/26/2025 12:55 PM, Lizhi Hou wrote: On 8/26/25 10:18, Mario Limonciello

Re: [PATCH] accel/amdxdna: Use int instead of u32 to store error codes

2025-08-27 Thread Lizhi Hou
On 8/26/25 19:15, Qianfeng Rong wrote: 在 2025/8/27 0:31, Lizhi Hou 写道: On 8/26/25 00:29, Qianfeng Rong wrote: Change the 'ret' variable from u32 to int to store -EINVAL, reducing potential risks such as incorrect results when comparing 'ret' with error codes. Sounds t

Re: [PATCH V1] accel/amdxdna: Add ioctl DRM_IOCTL_AMDXDNA_GET_ARRAY

2025-08-27 Thread Lizhi Hou
On 8/26/25 17:31, Mario Limonciello wrote: On 8/26/2025 1:10 PM, Lizhi Hou wrote: On 8/26/25 10:58, Mario Limonciello wrote: On 8/26/2025 12:55 PM, Lizhi Hou wrote: On 8/26/25 10:18, Mario Limonciello wrote: On 8/25/2025 11:48 PM, Lizhi Hou wrote: On 8/25/25 14:28, Mario Limonciello

Re: [PATCH V1] accel/amdxdna: Add ioctl DRM_IOCTL_AMDXDNA_GET_ARRAY

2025-08-26 Thread Lizhi Hou
On 8/26/25 10:58, Mario Limonciello wrote: On 8/26/2025 12:55 PM, Lizhi Hou wrote: On 8/26/25 10:18, Mario Limonciello wrote: On 8/25/2025 11:48 PM, Lizhi Hou wrote: On 8/25/25 14:28, Mario Limonciello wrote: On 8/22/2025 12:23 PM, Lizhi Hou wrote: Add interface for applications to get

Re: [PATCH V1] accel/amdxdna: Add ioctl DRM_IOCTL_AMDXDNA_GET_ARRAY

2025-08-26 Thread Lizhi Hou
On 8/26/25 10:18, Mario Limonciello wrote: On 8/25/2025 11:48 PM, Lizhi Hou wrote: On 8/25/25 14:28, Mario Limonciello wrote: On 8/22/2025 12:23 PM, Lizhi Hou wrote: Add interface for applications to get information array. The application provides a buffer pointer along with information

[PATCH V2] accel/amdxdna: Fix incorrect type used for a local variable

2025-08-26 Thread Lizhi Hou
5.0b9effl6-...@intel.com/ Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/accel/amdxdna/aie2_pci.c b/drivers/accel/amdxdna/aie2_pci.c index 16ac0cab4f44..7a3449541107 100644 --- a/drivers/accel/amdxdna/aie2_p

Re: [PATCH] accel/amdxdna: Fix incorrect type used for a local variable

2025-08-26 Thread Lizhi Hou
On 8/26/25 09:50, Mario Limonciello wrote: On 8/26/2025 11:03 AM, Lizhi Hou wrote: drivers/accel/amdxdna/aie2_pci.c:794:13: sparse: sparse: incorrect type in assignment (different address spaces) Fixes: c8cea4371e5e ("accel/amdxdna: Add a function to walk hardware contexts") R

Re: [PATCH] accel/amdxdna: Use int instead of u32 to store error codes

2025-08-26 Thread Lizhi Hou
On 8/26/25 00:29, Qianfeng Rong wrote: Change the 'ret' variable from u32 to int to store -EINVAL, reducing potential risks such as incorrect results when comparing 'ret' with error codes. Sounds this fixes code issue. Could you add "Fixes" tag? Thanks, Lizhi Signed-off-by: Qianfeng Rong

[PATCH] accel/amdxdna: Fix incorrect type used for a local variable

2025-08-26 Thread Lizhi Hou
5.0b9effl6-...@intel.com/ Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/accel/amdxdna/aie2_pci.c b/drivers/accel/amdxdna/aie2_pci.c index 16ac0cab4f44..2885a3c17e89 100644 --- a/drivers/accel/amdxdna/aie2_p

Re: [PATCH V1] accel/amdxdna: Add ioctl DRM_IOCTL_AMDXDNA_GET_ARRAY

2025-08-25 Thread Lizhi Hou
On 8/25/25 14:28, Mario Limonciello wrote: On 8/22/2025 12:23 PM, Lizhi Hou wrote: Add interface for applications to get information array. The application provides a buffer pointer along with information type, maximum number of entries and maximum size of each entry. The buffer may also

[PATCH V1] accel/amdxdna: Add ioctl DRM_IOCTL_AMDXDNA_GET_ARRAY

2025-08-22 Thread Lizhi Hou
actual number of entries and entry size are returned. Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_pci.c| 114 ++-- drivers/accel/amdxdna/amdxdna_pci_drv.c | 21 + drivers/accel/amdxdna/amdxdna_pci_drv.h | 1 + include/uapi/drm/amdxdna_accel.h| 109

Re: [PATCH] MAINTAINERS: Update Min Ma's email for AMD XDNA driver

2025-08-22 Thread Lizhi Hou
INERS index 10850512c118..6eefa494000c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1231,7 +1231,7 @@ F:        drivers/spi/spi-amd.c  F:     drivers/spi/spi-amd.h  AMD XDNA DRIVER -M:     Min Ma +M:     Min Ma  M:     Lizhi Hou  L: dri-devel@lists.freedesktop.org  S:     Supported -- 2.43.0

Re: [PATCH] Documentation: accel: amdxdna: Update compiler information

2025-08-21 Thread Lizhi Hou
Applied to drm-misc-next. Lizhi On 8/21/25 05:52, Alex Deucher wrote: On Wed, Aug 20, 2025 at 8:03 PM Lizhi Hou wrote: The compiler information is outdated. Update it to the latest. Signed-off-by: Lizhi Hou Reviewed-by: Alex Deucher --- Documentation/accel/amdxdna/amdnpu.rst | 10

[PATCH] Documentation: accel: amdxdna: Update compiler information

2025-08-20 Thread Lizhi Hou
The compiler information is outdated. Update it to the latest. Signed-off-by: Lizhi Hou --- Documentation/accel/amdxdna/amdnpu.rst | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Documentation/accel/amdxdna/amdnpu.rst b/Documentation/accel/amdxdna/amdnpu.rst

Re: [PATCH V2] accel/amdxdna: Add a function to walk hardware contexts

2025-08-18 Thread Lizhi Hou
Applied to drm-misc-next Thanks, Lizhi On 8/15/25 13:43, Limonciello, Mario wrote: On 8/15/25 12:16 PM, Lizhi Hou wrote: Walking hardware contexts created by a process is duplicated in multiple spots. Add a function, amdxdna_hwctx_walk(), and replace all spots. hwctx_srcu and dev_lock are

[PATCH V2] accel/amdxdna: Add a function to walk hardware contexts

2025-08-15 Thread Lizhi Hou
Walking hardware contexts created by a process is duplicated in multiple spots. Add a function, amdxdna_hwctx_walk(), and replace all spots. hwctx_srcu and dev_lock are good enough to protect hardware context list. Remove hwctx_lock. Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna

Re: [PATCH V1] accel/amdxdna: Add a function to walk hardware contexts

2025-08-14 Thread Lizhi Hou
On 8/14/25 13:43, Limonciello, Mario wrote: On 8/14/25 3:29 PM, Lizhi Hou wrote: Walking hardware contexts created by a process is duplicated in multiple spots. Add a function, amdxdna_hwctx_walk(), and replace all spots. hwctx_srcu and dev_lock are good enough to protect hardware context

[PATCH V1] accel/amdxdna: Add a function to walk hardware contexts

2025-08-14 Thread Lizhi Hou
Walking hardware contexts created by a process is duplicated in multiple spots. Add a function, amdxdna_hwctx_walk(), and replace all spots. hwctx_srcu and dev_lock are good enough to protect hardware context list. Remove hwctx_lock. Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna

Re: [PATCH] accel/ivpu: Make function parameter names consistent

2025-08-08 Thread Lizhi Hou
ivpu_hw_btrs_dct_set_status(struct ivpu_device *vdev, bool enable, u32 dct_percent); +void ivpu_hw_btrs_dct_set_status(struct ivpu_device *vdev, bool enable, u32 active_percent); Reviewed-by: Lizhi Hou u32 ivpu_hw_btrs_telemetry_offset_get(struct ivpu_device *vdev); u32 ivpu_hw_btrs_telemetry_size_get(struct

Re: [PATCH] accel/ivpu: Remove unused PLL_CONFIG_DEFAULT

2025-08-08 Thread Lizhi Hou
= 0; } else { wp->target = hw->pll.pn_ratio; - wp->cfg = enable ? PLL_CONFIG_DEFAULT : 0; + wp->cfg = 0; Reviewed-by: Lizhi Hou wp->cdyn = enable ? PLL_CDYN_DEFAULT : 0; wp->epp = enable ? PLL_EPP_DEFAULT : 0; }

Re: [PATCH] accel/ivpu: Prevent recovery work from being queued during device removal

2025-08-08 Thread Lizhi Hou
; void ivpu_pm_enable(struct ivpu_device *vdev); void ivpu_pm_disable(struct ivpu_device *vdev); -void ivpu_pm_cancel_recovery(struct ivpu_device *vdev); +void ivpu_pm_disable_recovery(struct ivpu_device *vdev); Reviewed-by: Lizhi Hou int ivpu_pm_suspend_cb(struct device *dev); int ivpu_pm_resume_cb(struct device *dev);

Re: [PATCH V2] accel/amdxdna: Unify pm and rpm suspend and resume callbacks

2025-08-06 Thread Lizhi Hou
Applied to drm-misc-next On 8/5/25 11:55, Mario Limonciello wrote: On 8/3/25 2:14 PM, Lizhi Hou wrote: The suspend and resume callbacks for pm and runtime pm should be same. During suspending, it needs to stop all hardware contexts first. And the hardware contexts will be restarted after the

[PATCH V2] accel/amdxdna: Unify pm and rpm suspend and resume callbacks

2025-08-03 Thread Lizhi Hou
The suspend and resume callbacks for pm and runtime pm should be same. During suspending, it needs to stop all hardware contexts first. And the hardware contexts will be restarted after the device is resumed. Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_ctx.c| 59

Re: [PATCH V1] accel/amdxdna: Unify pm and rpm suspend and resume callbacks

2025-08-03 Thread Lizhi Hou
On 8/1/25 05:36, Mario Limonciello wrote: On 7/31/2025 10:05 PM, Lizhi Hou wrote: The suspend and resume callbacks for pm and runtime pm should be same. During suspending, it needs to stop all hardware contexts first. And the hardware contexts will be restarted after the device is resumed

Re: [PATCH V1] accel/amdxdna: Unify pm and rpm suspend and resume callbacks

2025-08-03 Thread Lizhi Hou
On 8/1/25 07:48, Falkowski, Maciej wrote: On 7/31/2025 6:35 PM, Lizhi Hou wrote: The suspend and resume callbacks for pm and runtime pm should be same. During suspending, it needs to stop all hardware contexts first. And the hardware contexts will be restarted after the device is resumed

[PATCH V1] accel/amdxdna: Unify pm and rpm suspend and resume callbacks

2025-07-31 Thread Lizhi Hou
The suspend and resume callbacks for pm and runtime pm should be same. During suspending, it needs to stop all hardware contexts first. And the hardware contexts will be restarted after the device is resumed. Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_ctx.c| 32

Re: [PATCH] accel/amdxdna: Delete pci_free_irq_vectors()

2025-07-22 Thread Lizhi Hou
Pushed to drm-misc-next. Thanks. Lizhi On 7/22/25 00:55, Jacek Lawrynowicz wrote: Reviewed-by: Jacek Lawrynowicz On 7/19/2025 8:33 AM, Salah Triki wrote: The device is managed so pci_free_irq_vectors() is called automatically no need to do it manually. Signed-off-by: Salah Triki --- dri

Re: [PATCH V2] accel/amdxdna: Support user space allocated buffer

2025-07-22 Thread Lizhi Hou
Pushed to drm-misc-next. Thanks. Lizhi On 7/22/25 01:22, Jacek Lawrynowicz wrote: Reviewed-by: Jacek Lawrynowicz On 7/16/2025 6:44 PM, Lizhi Hou wrote: Enhance DRM_IOCTL_AMDXDNA_CREATE_BO to accept user space allocated buffer pointer. The buffer pages will be pinned in memory. Unless the

[PATCH V2] accel/amdxdna: Support user space allocated buffer

2025-07-16 Thread Lizhi Hou
Enhance DRM_IOCTL_AMDXDNA_CREATE_BO to accept user space allocated buffer pointer. The buffer pages will be pinned in memory. Unless the CAP_IPC_LOCK is enabled for the application process, the total pinned memory can not beyond rlimit_memlock. Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna

Re: [PATCH V1] accel/amdxdna: Support user space allocated buffer

2025-07-14 Thread Lizhi Hou
On 7/14/25 03:33, Jacek Lawrynowicz wrote: Hi, This looks very interesting. It's a clever way of adding userptr on top of existing gem code. On 7/7/2025 9:38 PM, Lizhi Hou wrote: Enhance DRM_IOCTL_AMDXDNA_CREATE_BO to accept user space allocated buffer pointer. The buffer pages wi

[PATCH V1] accel/amdxdna: Support user space allocated buffer

2025-07-07 Thread Lizhi Hou
Enhance DRM_IOCTL_AMDXDNA_CREATE_BO to accept user space allocated buffer pointer. The buffer pages will be pinned in memory. Unless the CAP_IPC_LOCK is enabled for the application process, the total pinned memory can not beyond rlimit_memlock. Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna

Re: [PATCH 02/80] accel/amdxdna: Remove redundant pm_runtime_mark_last_busy() calls

2025-07-07 Thread Lizhi Hou
Reviewed-by: Lizhi Hou On 7/4/25 00:53, Sakari Ailus wrote: pm_runtime_put_autosuspend(), pm_runtime_put_sync_autosuspend(), pm_runtime_autosuspend() and pm_request_autosuspend() now include a call to pm_runtime_mark_last_busy(). Remove the now-reduntant explicit call to

Re: Is PCI passthrough of the AMD XDNA device possible?

2025-07-07 Thread Lizhi Hou
On 7/2/25 02:14, Marcello Sylvester Bauer wrote: Greetings, I have some questions about making the AMD XDNA NPU accessible in a virtualized environment. I tried using VFIO on QEMU, but I could not get it to work. Here is a brief rundown of the resulting issues: Simply adding the device to

Re: [PATCH V1] accel/amdxdna: Revise device bo creation and free

2025-06-16 Thread Lizhi Hou
Pushed to drm-misc-next On 6/16/25 04:30, Jacek Lawrynowicz wrote: Hi, On 6/16/2025 11:14 AM, Lizhi Hou wrote: The device bo is allocated from the device heap memory. (a trunk of memory dedicated to device) Rename amdxdna_gem_insert_node_locked to amdxdna_gem_heap_alloc and move related

[PATCH V1] accel/amdxdna: Revise device bo creation and free

2025-06-16 Thread Lizhi Hou
address of device bo by the device heap memory address and offset. Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_ctx.c| 2 +- drivers/accel/amdxdna/amdxdna_gem.c | 193 +++- drivers/accel/amdxdna/amdxdna_gem.h | 3 +- 3 files changed, 106 insertions

Re: [PATCH V1] accel/amdxdna: Fix incorrect PSP firmware size

2025-06-09 Thread Lizhi Hou
Pushed to drm-misc-fixes On 6/9/25 06:35, Alex Deucher wrote: On Wed, Jun 4, 2025 at 8:12 PM Lizhi Hou wrote: On 6/4/25 07:51, Alex Deucher wrote: On Wed, Jun 4, 2025 at 10:42 AM Lizhi Hou wrote: The incorrect PSP firmware size is used for initializing. It may cause error for newer

Re: [PATCH] accel/ivpu: Use dma_resv_lock() instead of a custom mutex

2025-06-05 Thread Lizhi Hou
On 6/2/25 05:58, Jacek Lawrynowicz wrote: Hi, On 5/28/2025 7:50 PM, Lizhi Hou wrote: On 5/28/25 08:43, Jacek Lawrynowicz wrote: This fixes a potential race conditions in:   - ivpu_bo_unbind_locked() where we modified the shmem->sgt without     holding the dma_resv_l

Re: [PATCH] accel/ivpu: Trigger device recovery on engine reset/resume failure

2025-06-05 Thread Lizhi Hou
On 6/2/25 06:05, Jacek Lawrynowicz wrote: Hi, On 5/28/2025 7:53 PM, Lizhi Hou wrote: On 5/28/25 08:42, Jacek Lawrynowicz wrote: From: Karol Wachowski Trigger full device recovery when the driver fails to restore device state via engine reset and resume operations. This is necessary

Re: [PATCH V1] accel/amdxdna: Fix incorrect PSP firmware size

2025-06-04 Thread Lizhi Hou
On 6/4/25 07:51, Alex Deucher wrote: On Wed, Jun 4, 2025 at 10:42 AM Lizhi Hou wrote: The incorrect PSP firmware size is used for initializing. It may cause error for newer version firmware. Fixes: 8c9ff1b181ba ("accel/amdxdna: Add a new driver for AMD AI Engine") Signed-off-by:

[PATCH V1] accel/amdxdna: Fix incorrect PSP firmware size

2025-06-04 Thread Lizhi Hou
The incorrect PSP firmware size is used for initializing. It may cause error for newer version firmware. Fixes: 8c9ff1b181ba ("accel/amdxdna: Add a new driver for AMD AI Engine") Signed-off-by: Lizhi Hou --- drivers/accel/amdxdna/aie2_psp.c | 4 ++-- 1 file changed, 2 insertions(+), 2

Re: [PATCH] accel/ivpu: Trigger device recovery on engine reset/resume failure

2025-05-28 Thread Lizhi Hou
On 5/28/25 08:42, Jacek Lawrynowicz wrote: From: Karol Wachowski Trigger full device recovery when the driver fails to restore device state via engine reset and resume operations. This is necessary because, even if submissions from a faulty context are blocked, the NPU may still process previ

Re: [PATCH] accel/ivpu: Use dma_resv_lock() instead of a custom mutex

2025-05-28 Thread Lizhi Hou
On 5/28/25 08:43, Jacek Lawrynowicz wrote: This fixes a potential race conditions in: - ivpu_bo_unbind_locked() where we modified the shmem->sgt without holding the dma_resv_lock(). - ivpu_bo_print_info() where we read the shmem->pages without holding the dma_resv_lock(). Using dma

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

2025-05-28 Thread Lizhi Hou
m, !dma_resv_test_signaled(obj->resv, DMA_RESV_USAGE_READ)); + drm_WARN_ON(&vdev->drm, !drm_gem_is_imported(&bo->base.base) && + !dma_resv_test_signaled(obj->resv, DMA_RESV_USAGE_READ)); Reviewed-by: Lizhi Hou drm_WARN_ON(&vdev->drm, ivpu_bo_size(bo) == 0); drm_WARN_ON(&vdev->drm, bo->base.vaddr);

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

2025-05-28 Thread Lizhi Hou
On 5/28/25 08:42, Jacek Lawrynowicz wrote: Don't WARN if imported buffers are in use in ivpu_gem_bo_free() as they can be indeed used in the original context/driver. Fixes: 647371a6609d ("accel/ivpu: Add GEM buffer object management") Cc: # v6.3 Signed-off-by: Jacek Lawrynowicz --- drivers

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

  1   2   3   4   >