[PATCH 06/10] accel/habanalabs: add missing offset handling for dma-buf

2023-09-18 Thread Oded Gabbay
dma-buf and the SG table it prepared. Add the missing offset handling. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/habanalabs.h | 3 + drivers/accel/habanalabs/common/memory.c | 75 +++- 2 files changed

[PATCH 08/10] accel/habanalabs: add fw status SHUTDOWN_PREP

2023-09-18 Thread Oded Gabbay
From: Dafna Hirschfeld update hl_boot_if.h from specs to include CPU_BOOT_STATUS_FW_SHUTDOWN_PREP Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- include/linux/habanalabs/hl_boot_if.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux

[PATCH 05/10] accel/habanalabs: set hl_dmabuf_priv.device_address only when needed

2023-09-18 Thread Oded Gabbay
it can't be a device virtual address. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/habanalabs.h | 8 drivers/accel/habanalabs/common/memory.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) d

[PATCH 09/10] accel/habanalabs: extend preboot timeout when preboot might take longer

2023-09-18 Thread Oded Gabbay
: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/firmware_if.c | 26 --- drivers/accel/habanalabs/common/habanalabs.h | 3 +++ drivers/accel/habanalabs/gaudi2/gaudi2.c | 2 ++ drivers/accel/habanalabs/gaudi2/gaudi2P.h

[PATCH 10/10] accel/habanalabs: update boot status print

2023-09-18 Thread Oded Gabbay
From: Ariel Suller FW shutdown preparation status was added to spec. Signed-off-by: Ariel Suller Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/firmware_if.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/accel/habanalabs/common

[PATCH 04/10] accel/habanalabs: fix SG table creation for dma-buf mapping

2023-09-18 Thread Oded Gabbay
composed of several pages. In these cases, redundant entries will be added to the SG table. Modify the method that the number of entries is calculated, and the way they are prepared. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common

[PATCH 07/10] accel/habanalabs: add debug prints to dump content of SG table for dma-buf

2023-09-18 Thread Oded Gabbay
From: Tomer Tayar Add debug prints to dump the content of the SG table which is prepared when the dma-buf map op is called. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/memory.c | 7 +++ 1 file changed, 7 insertions

[PATCH 1/3] accel/habanalabs: remove unused asic functions

2023-09-19 Thread Oded Gabbay
asic_dma_{un}map_single() asic-specific functions are no longer called from the common code, so delete these functions. In addition, delete the gaudi2 implementation as they are also not called. Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/habanalabs.h | 8 drivers

[PATCH 2/3] accel/habanalabs: add traces for dma mappings

2023-09-19 Thread Oded Gabbay
From: Ohad Sharabi In order to get a full picture of DMA mappings (e.g. to track DMAR errors), DMA mappings APIs should be covered. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- include/trace/events/habanalabs.h | 43 +++ 1

[PATCH 3/3] accel/habanalabs: trace dma map sgtable

2023-09-19 Thread Oded Gabbay
From: Ohad Sharabi Traces the DMA [un]map_sgtable using the new traces we added. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/device.c | 46 +++- drivers/accel/habanalabs/common/habanalabs.h | 25

[PATCH 1/9] accel/habanalabs: minor cosmetics update to cpucp_if.h

2023-09-26 Thread Oded Gabbay
- Update copyright years - Align comments Signed-off-by: Oded Gabbay --- include/linux/habanalabs/cpucp_if.h | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/include/linux/habanalabs/cpucp_if.h b/include/linux/habanalabs/cpucp_if.h index 84d74c4ee4d3

[PATCH 2/9] accel/habanalabs: minor cosmetics update to trace file

2023-09-26 Thread Oded Gabbay
- Update copyright years - Add missing newline at end of file Signed-off-by: Oded Gabbay --- include/trace/events/habanalabs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/trace/events/habanalabs.h b/include/trace/events/habanalabs.h index 0d3667399d01

[PATCH 3/9] accel/habanalabs: change Greco to Gaudi2

2023-09-26 Thread Oded Gabbay
Greco was not upstreamed so no point of mentioning it here. Signed-off-by: Oded Gabbay --- include/uapi/drm/habanalabs_accel.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/uapi/drm/habanalabs_accel.h b/include/uapi/drm/habanalabs_accel.h index

[PATCH 8/9] accel/habanalabs/gaudi: remove define used for simulator

2023-09-26 Thread Oded Gabbay
We don't support simulator in upstream. Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/habanalabs.h | 2 -- drivers/accel/habanalabs/gaudi/gaudi.c | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/accel/habanalabs/common/habanalabs.h b/dr

[PATCH 6/9] accel/habanalabs: print device name when it is removed

2023-09-26 Thread Oded Gabbay
Notifies the user which device was removed. It is important in a server with multiple devices. Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel

[PATCH 9/9] accel/habanalabs: minor cosmetic update to habanalabs.h

2023-09-26 Thread Oded Gabbay
- Update copyright years - Align fields in struct hl_userptr - Fix comments Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/habanalabs.h | 31 ++-- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/drivers/accel/habanalabs/common/habanalabs.h b

[PATCH 7/9] accel/habanalabs: remove leftover code

2023-09-26 Thread Oded Gabbay
This code was added as part of a bigger feature which was never upstreamed, so remove this code. Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/command_submission.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/accel/habanalabs/common

[PATCH 4/9] accel/habanalabs/gaudi: remove unused structure definition

2023-09-26 Thread Oded Gabbay
struct gaudi_nic_status is not used anywhere in the code. Signed-off-by: Oded Gabbay --- .../habanalabs/include/gaudi/gaudi_fw_if.h| 32 --- 1 file changed, 32 deletions(-) diff --git a/drivers/accel/habanalabs/include/gaudi/gaudi_fw_if.h b/drivers/accel/habanalabs/include

[PATCH 5/9] accel/habanalabs: remove unused field

2023-09-26 Thread Oded Gabbay
flags in struct wait_interrupt_data is not used anywhere so remove it. Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/command_submission.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/accel/habanalabs/common/command_submission.c b/drivers/accel/habanalabs/common

Re: [PATCH] accel/habanalabs: add missing debugfs function stubs

2023-09-28 Thread Oded Gabbay
/habanalabs/common/habanalabs.h > @@ -4041,6 +4041,15 @@ void hl_debugfs_set_state_dump(struct hl_device *hdev, > char *data, > > #else > > +static inline int hl_debugfs_device_init(struct hl_device *hdev) > +{ > + return 0; > +} > + > +static inline void hl_debugfs_device_fini(struct hl_device *hdev) > +{ > +} > + > static inline void hl_debugfs_add_device(struct hl_device *hdev) > { > } > -- > 2.39.2 > Reviewed-by: Oded Gabbay Applied to -next Thanks, Oded

[PATCH 2/3] accel/habanalabs: fix bug in decoder wait for cs completion

2023-09-28 Thread Oded Gabbay
-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../accel/habanalabs/common/command_submission.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/accel/habanalabs/common/command_submission.c b/drivers/accel/habanalabs/common/command_submission.c index

[PATCH 3/3] accel/habanalabs/gaudi2: perform hard-reset upon PCIe AXI drain event

2023-09-28 Thread Oded Gabbay
-reset upon PCIe AXI drain events. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../habanalabs/include/gaudi2/gaudi2_async_ids_map_extended.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/accel/habanalabs/include/gaudi2

[PATCH 1/3] accel/habanalabs: remove wrong doc for init_phys_pg_pack_from_userptr

2023-09-28 Thread Oded Gabbay
From: Dafna Hirschfeld The function does not pin the pages so remove that from the inline doc. Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/memory.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/accel

[PATCH] accel/habanalabs/gaudi2: fix spmu mask creation

2023-09-28 Thread Oded Gabbay
event_types_num received from the user can be 0. In that case, the event_mask should be 0. In addition, to create a correct mask we need to match the number of event types to the bit location such that bit 0 represents a single event type, bit 1 represents 2 types and so on. Signed-off-by: Oded

Re: [PATCH] accel/habanalabs: make hl_class constant

2023-10-09 Thread Oded Gabbay
he hl_class related code no longer exists, as we moved completely to the new accel char device class. So, I'm dropping this patch. Oded > > Cc: Dafna Hirschfeld > Cc: Dani Liberman > Cc: Koby Elbaz > Cc: Oded Gabbay > Cc: Ofir Bitton > Cc: Ohad Sharabi > Cc: Stanisl

[git pull] habanalabs for drm-next-6.7

2023-10-10 Thread Oded Gabbay
t is updated accel/habanalabs: rename fd_list to hpriv_list Moti Haimovski (1): accel/habanalabs/gaudi2: print power-mode changes Oded Gabbay (14): accel/habanalabs: remove pdev check on idle check accel/habanalabs: reset device if scrubbing failed accel/habanalabs/

[PATCH 01/13] accel/habanalabs/gaudi2: use single function to compare FW versions

2024-02-20 Thread Oded Gabbay
addition, this generic function now considers also the sub-minor FW version and also remove dead code resulting in deprecated FW versions compatibility. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/firmware_if.c | 25

[PATCH 03/13] accel/habanalabs: modify print for skip loading linux FW to debug log

2024-02-20 Thread Oded Gabbay
cases, so replace the used dev_info() with dev_dbg(). Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/firmware_if.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/accel/habanalabs/common/firmware_if

[PATCH 06/13] accel/habanalabs: fix debugfs files permissions

2024-02-20 Thread Oded Gabbay
From: Avri Kehat debugfs files are created with permissions that don't align with the access requirements. Signed-off-by: Avri Kehat Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/debugfs.c | 14 +++--- 1 file changed, 7 insertions(

[PATCH 08/13] accel/habanalabs: fix error print

2024-02-20 Thread Oded Gabbay
From: Dani Liberman The unmasking is for event and it can be other event than RAZWI. Signed-off-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/firmware_if.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a

[PATCH 04/13] accel/habanalabs/gaudi2: check extended errors according to PCIe addr_dec interrupt info

2024-02-20 Thread Oded Gabbay
From: Tomer Tayar The FW interrupt info for a PCIe addr_dec event is set correctly, so check for either global errors or razwi according to the indications there. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/gaudi2/gaudi2.c | 18

[PATCH 13/13] accel/habanalabs: modify pci health check

2024-02-20 Thread Oded Gabbay
. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/device.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel/habanalabs/common/device.c index

[PATCH 02/13] accel/habanalabs: remove hop size from asic properties

2024-02-20 Thread Oded Gabbay
From: Farah Kassabri The hop size related properties is a MMU properties and not asic properties. As for PMMU and HMMU we could have different sizes. Signed-off-by: Farah Kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/habanalabs.h | 4

[PATCH 11/13] accel/habanalabs: handle reserved memory request when working with full FW

2024-02-20 Thread Oded Gabbay
From: Tomer Tayar Currently the reserved memory request from FW is handled when running with preboot only, but this request is relevant also when running with full FW. Modify to always handle this reservation request. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded

[PATCH 07/13] accel/habanalabs: initialize maybe-uninitialized variables

2024-02-20 Thread Oded Gabbay
From: Tal Risin Prevent static analysis warning. Signed-off-by: Tal Risin Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/debugfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/accel/habanalabs/common/debugfs.c b

[PATCH 05/13] accel/habanalabs: fix glbl error cause handling

2024-02-20 Thread Oded Gabbay
From: Tomer Tayar The glbl error cause handling has a wrong assumption that all error bits are consecutive. Fix the handling to check all relevant error bits per ASIC. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common

[PATCH 09/13] accel/habanalabs/gaudi2: drain event lacks rd/wr indication

2024-02-20 Thread Oded Gabbay
From: Ofir Bitton Due to a H/W issue, AXI drain event does not include a read/write indication, hence we remove this print. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/gaudi2/gaudi2.c | 14 +++--- 1 file changed, 3

[PATCH 10/13] accel/habanalabs/hwmon: rate limit errors user can generate

2024-02-20 Thread Oded Gabbay
From: Ofir Bitton Fetching sensor data can fail due to various reasons. In order not to pollute the kernel log, those error prints must be rate limited. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/hwmon.c | 29

[PATCH 12/13] accel/habanalabs: keep explicit size of reserved memory for FW

2024-02-20 Thread Oded Gabbay
used. Modify the property to hold the size in bytes. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/firmware_if.c | 2 +- drivers/accel/habanalabs/common/habanalabs.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --

[PATCH 1/3] accel/habanalabs/gaudi2: initialize field in correct function

2024-02-25 Thread Oded Gabbay
From: Ohad Sharabi supports_advanced_cpucp_rc is an asic property which should be initialized in the gaudi2_set_fixed_properties(), where all of the asic properties are initialized. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs

[PATCH 3/3] accel/habanalabs/gaudi2: use single function to compare FW versions

2024-02-25 Thread Oded Gabbay
Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/firmware_if.c | 25 +++ drivers/accel/habanalabs/common/habanalabs.h | 20 +-- drivers/accel/habanalabs/gaudi2/gaudi2.c | 6 ++--- 3 files changed, 29 insertions

[PATCH 2/3] accel/habanalabs/gaudi2: drop support for never released firmware

2024-02-25 Thread Oded Gabbay
From: Ohad Sharabi Firmware files below 1.11 were never released to customers so no need to support them externally. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/gaudi2/gaudi2.c | 47 ++-- 1 file changed, 3

Re: [PATCH] accel: constify the struct device_type usage

2024-02-26 Thread Oded Gabbay
On Mon, Feb 19, 2024 at 04:48:28PM -0300, Ricardo B. Marliere wrote: > Since commit aed65af1cc2f ("drivers: make device_type const"), the driver > core can properly handle constant struct device_type. Move the > accel_sysfs_device_minor variable to be a constant structure as well, > placing it into

[git pull] habanalabs for drm-next-6.9

2024-02-26 Thread Oded Gabbay
Hi Dave, Sima. Habanalabs pull request for 6.9. No uapi changes this time. Just minor features, improvements, code cleanups and bug fixes. Also one small change in accel subsystem file. Full details are in the signed tag. Thanks, Oded The following changes since commit 40d47c5fb4f2a7c1ef168598

Re: [PATCH] accel: make accel_class a static const structure

2023-07-03 Thread Oded Gabbay
time > > placing it into read-only memory, instead of having to be dynamically > > allocated at boot time. > > > > Cc: Oded Gabbay > > Cc: dri-devel@lists.freedesktop.org > > Suggested-by: Greg Kroah-Hartman > > Signed-off-by: Ivan Orlov > > Signed-o

Re: [PATCH] habanalabs/gaudi: Add MODULE_FIRMWARE macros

2023-07-03 Thread Oded Gabbay
+ > #define GAUDI_DMA_POOL_BLK_SIZE0x100 /* 256 bytes */ > > #define GAUDI_RESET_TIMEOUT_MSEC 2000/* 2000ms */ > -- > 2.37.2 > Reviewed-by: Oded Gabbay Applied to -next. Thanks, Oded

[PATCH 01/12] accel/habanalabs/gaudi2: un-secure register for engine cores interrupt

2023-07-11 Thread Oded Gabbay
From: Tomer Tayar The F/W dynamically allocates one of the PSOC scratchpad registers for the engine cores, so they can raise events towards the F/W. To allow the engine cores to access this register, this register must be non-secured. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed

[PATCH 02/12] accel/habanalabs/gaudi2: unsecure tpc count registers

2023-07-11 Thread Oded Gabbay
From: Ofir Bitton As TPC kernels now must use those registers we unsecure them. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/gaudi2/gaudi2_security.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/accel/habanalabs

[PATCH 05/12] accel/habanalabs: handle f/w reserved dram space request

2023-07-11 Thread Oded Gabbay
From: Dani Liberman It is possible for FW to request reserved space in dram. If the device supports this option, it will retrieve the size from the f/w and will reserve it. Currently we add the common code infrastructure to support it. Signed-off-by: Dani Liberman Reviewed-by: Oded Gabbay

[PATCH 03/12] accel/habanalabs/gaudi2: prepare to remove soft_rst_irq

2023-07-11 Thread Oded Gabbay
backward compatibility. Signed-off-by: Igor Grinberg Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/gaudi2/gaudi2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/accel/habanalabs/gaudi2/gaudi2.c b/drivers/accel/habanalabs/gaudi2

[PATCH 06/12] accel/habanalabs: set default device release watchdog T/O as 30 sec

2023-07-11 Thread Oded Gabbay
collect debug data. Increase the default value to 30 sec. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/accel/habanalabs/common/device.c b

[PATCH 09/12] accel/habanalabs: update sysfs-driver-habanalabs with the accel path

2023-07-11 Thread Oded Gabbay
From: Tomer Tayar Replace "/sys/class/habanalabs/hl/..." with "/sys/class/accel/accel/device/...". Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../ABI/testing/sysfs-driver-habanalabs | 64 +-- 1 file changed,

[PATCH 08/12] accel/habanalabs: register compute device as an accel device

2023-07-11 Thread Oded Gabbay
will be handled in subsequent patches. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/debugfs.c | 22 +-- drivers/accel/habanalabs/common/device.c | 163 +++--- drivers/accel/habanalabs/common/habanalabs.h

[PATCH 07/12] accel/habanalabs: add info ioctl for engine error reports

2023-07-11 Thread Oded Gabbay
From: Ofir Bitton User gets notification for every engine error report, but he still lacks the exact engine information. Hence, we allow user to query for the exact engine reported an error. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel

[PATCH 10/12] accel/habanalabs: update debugfs-driver-habanalabs with the accel path

2023-07-11 Thread Oded Gabbay
From: Tomer Tayar Replace "/sys/kernel/debug/habanalabs/hl/..." with "/sys/kernel/debug/accel//...". Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../ABI/testing/debugfs-driver-habanalabs | 84 +-- 1 file ch

[PATCH 04/12] accel/habanalabs/gaudi2: fix missing check of kernel ctx

2023-07-11 Thread Oded Gabbay
If we are initializing the kernel context when we have a Gaudi2 device, we don't need to do any late initializing of that context with specific Gaudi2 code. Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/gaudi2/gaudi2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dr

[PATCH 11/12] accel/habanalabs: Move ioctls to the device specific ioctls range

2023-07-11 Thread Oded Gabbay
From: Tomer Tayar To use drm_ioctl(), move the ioctls to the device specific ioctls range at [DRM_COMMAND_BASE, DRM_COMMAND_END). Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../accel/habanalabs/common/command_buffer.c | 5 +- .../habanalabs/common

[PATCH 12/12] accel/habanalabs: release user interfaces earlier in device fini

2023-07-11 Thread Oded Gabbay
accesses to these interfaces, this check is not hermetic and it is better to just reverse the order of the code in hl_device_fini(). Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/device.c | 12 ++-- 1 file changed, 6

Re: [PATCH 1/2] eventfd: simplify eventfd_signal()

2023-07-13 Thread Oded Gabbay
spin_unlock(&memcg_oom_lock); > return 0; > @@ -4499,7 +4499,7 @@ static int mem_cgroup_oom_register_event(struct > mem_cgroup *memcg, > > /* already in OOM ? */ > if (memcg->under_oom) > - eventfd_signal(eventfd, 1); > + eventfd_signal(eventfd); > spin_unlock(&memcg_oom_lock); > > return 0; > @@ -4791,7 +4791,7 @@ static void memcg_event_remove(struct work_struct *work) > event->unregister_event(memcg, event->eventfd); > > /* Notify userspace the event is going away. */ > - eventfd_signal(event->eventfd, 1); > + eventfd_signal(event->eventfd); > > eventfd_ctx_put(event->eventfd); > kfree(event); > diff --git a/mm/vmpressure.c b/mm/vmpressure.c > index b52644771cc4..ba4cdef37e42 100644 > --- a/mm/vmpressure.c > +++ b/mm/vmpressure.c > @@ -169,7 +169,7 @@ static bool vmpressure_event(struct vmpressure *vmpr, > continue; > if (level < ev->level) > continue; > - eventfd_signal(ev->efd, 1); > + eventfd_signal(ev->efd); > ret = true; > } > mutex_unlock(&vmpr->events_lock); > diff --git a/samples/vfio-mdev/mtty.c b/samples/vfio-mdev/mtty.c > index a60801fb8660..5edcf8d738de 100644 > --- a/samples/vfio-mdev/mtty.c > +++ b/samples/vfio-mdev/mtty.c > @@ -1028,9 +1028,9 @@ static int mtty_trigger_interrupt(struct mdev_state > *mdev_state) > } > > if (mdev_state->irq_index == VFIO_PCI_MSI_IRQ_INDEX) > - ret = eventfd_signal(mdev_state->msi_evtfd, 1); > + ret = eventfd_signal(mdev_state->msi_evtfd); > else > - ret = eventfd_signal(mdev_state->intx_evtfd, 1); > + ret = eventfd_signal(mdev_state->intx_evtfd); > > #if defined(DEBUG_INTR) > pr_info("Intx triggered\n"); > diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c > index 89912a17f5d5..c0e230f4c3e9 100644 > --- a/virt/kvm/eventfd.c > +++ b/virt/kvm/eventfd.c > @@ -61,7 +61,7 @@ static void irqfd_resampler_notify(struct > kvm_kernel_irqfd_resampler *resampler) > > list_for_each_entry_srcu(irqfd, &resampler->list, resampler_link, > > srcu_read_lock_held(&resampler->kvm->irq_srcu)) > - eventfd_signal(irqfd->resamplefd, 1); > + eventfd_signal(irqfd->resamplefd); > } > > /* > @@ -786,7 +786,7 @@ ioeventfd_write(struct kvm_vcpu *vcpu, struct > kvm_io_device *this, gpa_t addr, > if (!ioeventfd_in_range(p, addr, len, val)) > return -EOPNOTSUPP; > > - eventfd_signal(p->eventfd, 1); > + eventfd_signal(p->eventfd); > return 0; > } > > > -- > 2.34.1 > For habanalabs (device.c): Reviewed-by: Oded Gabbay

Re: [RFC 0/5] Proposal to use netlink for RAS and Telemetry across drm subsystem

2023-07-17 Thread Oded Gabbay
r-gt1-soc-fatal-mdfi-east 0x1023 > > error-gt1-soc-fatal-mdfi-south 0x1024 > > error-gt1-soc-fatal-hbm-ss0-0 0x1025 > > error-gt1-soc-fatal-hbm-ss0-1 0

Re: [PATCH] accel/habanalabs: add more debugfs stub helpers

2023-07-20 Thread Oded Gabbay
On Thu, Jul 20, 2023 at 1:29 PM Daniel Vetter wrote: > > On Sun, Jun 11, 2023 at 12:50:31PM +0300, Oded Gabbay wrote: > > On Fri, Jun 9, 2023 at 4:37 PM Tomer Tayar wrote: > > > > > > On 09/06/2023 15:06, Arnd Bergmann wrote: > > > > From: Arnd Bergman

[PATCH] accel/habanalabs/gaudi2: prepare to remove cpu_rst_status

2023-07-20 Thread Oded Gabbay
compatibility. Signed-off-by: Igor Grinberg Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/gaudi2/gaudi2.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/accel/habanalabs/gaudi2/gaudi2.c b/drivers/accel/habanalabs/gaudi2

[PATCH 01/10] accel/habanalabs/gaudi2: assume hard-reset by FW upon PCIe AXI drain

2023-11-15 Thread Oded Gabbay
the driver. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/habanalabs.h | 8 drivers/accel/habanalabs/gaudi2/gaudi2.c | 2 ++ 2 files changed, 10 insertions(+) diff --git a/drivers/accel/habanalabs/common

[PATCH 02/10] accel/habanalabs: add log when eq event is not received

2023-11-15 Thread Oded Gabbay
reason. Signed-off-by: Farah Kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/device.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel/habanalabs/common/device.c

[PATCH 03/10] accel/habanalabs: add support for Gaudi2C device

2023-11-15 Thread Oded Gabbay
Gaudi2 with PCI revision ID with the value of '3' represents Gaudi2C device and should be detected and initialized as Gaudi2. Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/device.c | 3 +++ drivers/accel/habanalabs/common/habanalabs.h | 2 +

[PATCH 04/10] accel/habanalabs: fix EQ heartbeat mechanism

2023-11-15 Thread Oded Gabbay
From: Farah Kassabri Stop rescheduling another heartbeat check when EQ heartbeat check fails as it generates confusing logs in dmesg that the heartbeat fails. Signed-off-by: Farah Kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/device.c | 14

[PATCH 06/10] accel/habanalabs: remove 'get temperature' debug print

2023-11-15 Thread Oded Gabbay
From: Ofir Bitton The print was added long back for a specific debug and can now be removed. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/hwmon.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/accel

[PATCH 05/10] accel/habanalabs/gaudi2: fix undef opcode reporting

2023-11-15 Thread Oded Gabbay
From: Dafna Hirschfeld currently the undefined opcode event bit in set only for lower cp and only if 'write_enable' is true. It should be set anyway and for all streams in order to report that event to userspace. Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-of

[PATCH 08/10] accel/habanalabs/gaudi2: get the correct QM CQ info upon an error

2023-11-15 Thread Oded Gabbay
Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/gaudi2/gaudi2.c | 44 +-- .../include/gaudi2/asic_reg/gaudi2_regs.h | 1 + 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/drivers/accel/habanalabs/gaudi2/gaudi2.c b/drivers

[PATCH 10/10] accel/habanalabs: expose module id through sysfs

2023-11-15 Thread Oded Gabbay
are already accessing sysfs for topology information and it is easier for them to continue getting that information from sysfs instead of opening a file descriptor. Signed-off-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- Documentation/ABI/testing/sysfs-driver

[PATCH 07/10] accel/habanalabs: set hard reset flag if graceful reset is skipped

2023-11-15 Thread Oded Gabbay
to an immediate reset. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel/habanalabs/common/dev

[PATCH 09/10] accel/habanalabs: print error code when mapping fails

2023-11-15 Thread Oded Gabbay
From: Dani Liberman Failure to map is considered a non-trivial error and we need to notify the user about it. Signed-off-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/memory.c | 7 --- 1 file changed, 4 insertions(+), 3

[PATCH 1/2] accel/habanalabs/gaudi2: use correct registers to dump QM CQ info

2023-11-30 Thread Oded Gabbay
-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/gaudi2/gaudi2.c | 12 ++-- .../habanalabs/include/gaudi2/asic_reg/gaudi2_regs.h | 12 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/accel

[PATCH 2/2] accel/habanalabs/gaudi2: add signed dev info uAPI

2023-11-30 Thread Oded Gabbay
From: Moti Haimovski User will provide a nonce via the INFO ioctl, and will retrieve the signed device info generated using given nonce. Signed-off-by: Moti Haimovski Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/firmware_if.c | 8 drivers

[PATCH 1/5] accel/habanalabs: report 3 instances of Infineon second stage

2023-12-07 Thread Oded Gabbay
From: Ariel Suller Infineon controller second stage has 3 instances that their version need to be reported by driver. Signed-off-by: Ariel Suller Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/sysfs.c | 20 ++-- 1 file changed, 18

[PATCH 2/5] accel/habanalabs/gaudi2: add zero padding when printing QM CP instruction

2023-12-07 Thread Oded Gabbay
Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/gaudi2/gaudi2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/accel/habanalabs/gaudi2/gaudi2.c b/drivers/accel/habanalabs/gaudi2/gaudi2.c index bf537c2082cd..f81b57649b00 100644 --- a/drivers/accel

[PATCH 5/5] accel/habanalabs/gaudi2: avoid overriding existing undefined opcode data

2023-12-07 Thread Oded Gabbay
resting, avoid saving the partial info for the upper QMAN. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/gaudi2/gaudi2.c | 40 +++- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/drivers/accel/haba

[PATCH 4/5] accel/habanalabs: add parent_device sysfs attribute

2023-12-07 Thread Oded Gabbay
efore accessing debugfs. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- Documentation/ABI/testing/sysfs-driver-habanalabs | 6 ++ drivers/accel/habanalabs/common/habanalabs.h | 3 +++ drivers/accel/habanalabs/common/sysfs.c | 9 +

[PATCH 3/5] accel/habanalabs: update debugfs-driver-habanalabs with the device-name directory

2023-12-07 Thread Oded Gabbay
From: Tomer Tayar The device debugfs directory was modified to be named as the parent device name. Update the paths accordingly. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../ABI/testing/debugfs-driver-habanalabs | 72 +-- 1 file

Re: [PULL] drm-xe-next

2023-12-18 Thread Oded Gabbay
rigo. Hi Rodrigo, You and the team did a great job on bringing the driver to this stage. Congrats! I reviewed a large part of the driver, mainly focusing on init/fini, ioctls, memory management, dma-buf. There were multiple issues raised and all of them were fixed/answered to my s

Re: [PULL] drm-xe-next

2023-12-18 Thread Oded Gabbay
buf. There were multiple issues raised and all of them were fixed/answered to my satisfaction. For the PR: Acked-by: Oded Gabbay Thanks, Oded > > The following changes since commit a60501d7c2d3e70b3545b9b96576628e369d8e85: > > Merge tag 'drm-misc-next-2023-12-07' of

Re: [PULL] drm-xe-next

2023-12-18 Thread Oded Gabbay
ks, > Rodrigo. Hi Rodrigo, You and the team did a great job on bringing the driver to this stage. Congrats! I reviewed a large part of the driver, mainly focusing on init/fini, ioctls, memory management, dma-buf. There were multiple issues raised and all of them were fixed/answered to my satis

Re: [PATCH v2] habanalabs: fix information leak in sec_attest_info()

2023-12-19 Thread Oded Gabbay
c(sizeof(*info), GFP_KERNEL); > if (!info) { > rc = -ENOMEM; > goto free_sec_attest_info; > -- > 2.34.1 > Reviewed-by: Oded Gabbay Applied to -next. Thanks, Oded

[git pull] habanalabs for drm-next-6.8

2023-12-19 Thread Oded Gabbay
d log when eq event is not received accel/habanalabs: fix EQ heartbeat mechanism Moti Haimovski (1): accel/habanalabs/gaudi2: add signed dev info uAPI Oded Gabbay (1): accel/habanalabs: add support for Gaudi2C device Ofir Bitton (1): accel/habanalabs: remove 'get

Re: [PATCH 0/5] accel/ivpu: Add debugfs support

2023-05-24 Thread Oded Gabbay
On Wed, May 24, 2023 at 10:49 AM Stanislaw Gruszka wrote: > > Add debugfs support for ivpu driver, most importantly firmware loging > and tracing. Hi, Without looking at the code I have 2 comments/questions: 1. Please add an ABI documentation in Documentation/ABI/testing/ or Documentation/ABI/sta

Re: [PATCH 0/5] accel/ivpu: Add debugfs support

2023-05-24 Thread Oded Gabbay
On Wed, May 24, 2023 at 11:29 AM Stanislaw Gruszka wrote: > > Hi > > On Wed, May 24, 2023 at 10:55:08AM +0300, Oded Gabbay wrote: > > On Wed, May 24, 2023 at 10:49 AM Stanislaw Gruszka > > wrote: > > > > > > Add debugfs support for ivpu driver, most imp

Re: [PATCH 0/7] Add a DRM driver to support AI Processing Unit (APU)

2023-05-24 Thread Oded Gabbay
On Wed, May 24, 2023 at 2:34 AM Kevin Hilman wrote: > > Jeffrey Hugo writes: > > > On 5/17/2023 8:52 AM, Alexandre Bailon wrote: > >> This adds a DRM driver that implements communication between the CPU and an > >> APU. The driver target embedded device that usually run inference using > >> some

[PATCH 1/3] accel/habanalabs: unsecure TSB_CFG_MTRR regs

2023-05-28 Thread Oded Gabbay
From: Ofir Bitton In order to utilize Engine Barrier padding, user must have access to this register set. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/gaudi2/gaudi2_security.c | 4 1 file changed, 4 insertions(+) diff

[PATCH 3/3] accel/habanalabs: refactor error info reset

2023-05-28 Thread Oded Gabbay
From: Dani Liberman Moved error info reset code to single function for future use from other places in the driver. Signed-off-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/device.c | 8 drivers/accel/habanalabs

[PATCH 2/3] accel/habanalabs: add event queue extra validation

2023-05-28 Thread Oded Gabbay
From: Ofir Bitton In order to increase reliability of the event queue interface, we apply to Gaudi2 the same mechanism we have in Gaudi1. The extra validation is basically checking that the received event index matches the expected index. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay

Re: DRM debugfs cleanup take 4

2023-06-01 Thread Oded Gabbay
On Wed, Apr 12, 2023 at 5:52 PM Christian König wrote: > > Hi guys, > > took me some tries to get the Intel CI happy with this patch set. > > This is the version rebased on drm-misc-next, for a CI run you actually > need to rebase the last patch to drm-tip. So I'm planning to merge 1-4 > for this

[git pull] habanalabs for drm-next-6.5

2023-06-08 Thread Oded Gabbay
update state when loading boot fit Moti Haimovski (3): accel/habanalabs: fix bug in free scratchpad memory accel/habanalabs: call to HW/FW err returns 0 when no events exist accel/habanalabs: fix mem leak in capture user mappings Oded Gabbay (5): accel/habanalabs: set

[PATCH 01/12] accel/habanalabs: prevent immediate hard reset due to 2 adjacent H/W events

2023-06-08 Thread Oded Gabbay
immediate reset, modify the driver to perform it if the user is not registered to events AND we don't already have a pending reset for a previous H/W event. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/device.c

[PATCH 02/12] accel/habanalabs: update pending reset flags with new reset requests

2023-06-08 Thread Oded Gabbay
itable for the device status. To prevent such cases, update the pending reset flags with the new requests flags before the requests are dropped. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/device.c | 4 +++- 1 file changed, 3

[PATCH 04/12] accel/habanalabs: print task name and request code upon ioctl failure

2023-06-08 Thread Oded Gabbay
From: Tomer Tayar When an ioctl fails, it is useful to know what is the task command name and the full ioctl request code, in addition to the task pid and the ioctl number. Add the additional information to the relevant debug error prints. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay

[PATCH 03/12] accel/habanalabs: notify user about undefined opcode event

2023-06-08 Thread Oded Gabbay
From: Ofir Bitton In order for user to be aware of undefined opcode events, we must store all relevant information and notify user about the failure. The user will fetch the stored info via info ioctl. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay

[PATCH 05/12] accel/habanalabs: print task name upon creation of a user context

2023-06-08 Thread Oded Gabbay
From: Tomer Tayar It is useful for debug to know which user process have acquired the device. Add this info to the relevant debug print, in addition to the already printed user context's ASID. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/

[PATCH 08/12] accel/habanalabs: handle arc farm razwi

2023-06-08 Thread Oded Gabbay
From: Dani Liberman Implement razwi handling for arc farm and add it to arc farm sei event handler. Signed-off-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/gaudi2/gaudi2.c | 16 +--- 1 file changed, 13 insertions(+), 3

[PATCH 07/12] accel/habanalabs: stop fetching MME SBTE error cause

2023-06-08 Thread Oded Gabbay
From: Ofir Bitton Because in this case we have only a single possible cause, we can safely stop fetching the cause from firmware. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/gaudi2/gaudi2.c | 31 ++-- 1 file

[PATCH 06/12] accel/habanalabs: set device status 'malfunction' while in rmmod

2023-06-08 Thread Oded Gabbay
low of a driver attempting to kill all processes in a list that can't be ever really empty. Signed-off-by: Koby Elbaz Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/device.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff -

<    1   2   3   4   5   6   7   8   9   10   >