[PATCH 3/3] habanalabs: ignore f/w status error

2021-04-17 Thread Oded Gabbay
exactly which status error to ignore and which to take into account. The bitmask is according to defines in hl_boot_if.h Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/firmware_if.c| 3 ++- drivers/misc/habanalabs/common/habanalabs.h | 7 +++ drivers/misc/habanalabs/common

[PATCH 2/3] habanalabs: change error level of security not ready

2021-04-17 Thread Oded Gabbay
This error indicates a problem in the security initialization inside the f/w so we need to stop the device loading because it won't be usable. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/firmware_if.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git

[PATCH 1/3] habanalabs: skip reading f/w errors on bad status

2021-04-17 Thread Oded Gabbay
If we read all FF from the boot status register, then something is totally wrong and there is no point of reading specific errors. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/firmware_if.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers

Re: [PATCH 2/3] habanalabs: support legacy and new pll indexes

2021-04-17 Thread Oded Gabbay
Thanks Nathan, I have already a pending patch that fixes this issue: https://lkml.org/lkml/2021/4/17/73 On Thu, Apr 15, 2021 at 5:17 PM Nathan Chancellor wrote: > > On Sun, Mar 21, 2021 at 10:11:29PM +0200, Oded Gabbay wrote: > > From: Ohad Sharabi > > > > In order to u

[PATCH 3/7] habanalabs: update firmware files to latest

2021-04-17 Thread Oded Gabbay
Update the firmware files to the latest from the firmware team. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/include/common/cpucp_if.h | 4 +++- drivers/misc/habanalabs/include/common/hl_boot_if.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/misc

[PATCH 2/7] habanalabs: increase ELBI reset timeout for PLDM

2021-04-17 Thread Oded Gabbay
From: Moti Haimovski On PLDM, in case of NIC hangs, the ELBI reset to take much longer than expected. As a result an increase in the ELBI reset timeout is required. Signed-off-by: Moti Haimovski Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/pci/pci.c

[PATCH 4/7] habanalabs: prepare preboot stage to dynamic f/w load

2021-04-17 Thread Oded Gabbay
From: Ohad Sharabi Start the skeleton for the dynamic F/W load by marking current preboot code path as legacy. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/firmware_if.c | 79 drivers/misc/habanalabs

[PATCH 7/7] habanalabs: use mmu cache range invalidation

2021-04-17 Thread Oded Gabbay
From: Alon Mizrahi Use mmu cache range invalidation instead of entire cache invalidation because it yields better performance. In GOYA and GAUDI, always use entire cache invalidation because these ASICs don't support range invalidation. Signed-off-by: Alon Mizrahi Reviewed-by: Oded Gabbay

[PATCH 5/7] habanalabs: request f/w in separate function

2021-04-17 Thread Oded Gabbay
From: Ohad Sharabi This refactor is needed due to the dynamic FW load in which requesting the FW file (and getting its attributes) is not immediately followed by copying FW file content. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc

[PATCH 6/7] habanalabs: refactor init device cpu code

2021-04-17 Thread Oded Gabbay
will be able to be communicated across various boot stages. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/firmware_if.c | 30 -- drivers/misc/habanalabs/common/habanalabs.h | 32 +--- drivers

[PATCH 1/7] habanalabs: expose ASIC specific PLL index

2021-04-17 Thread Oded Gabbay
From: Bharat Jauhari Currently the user cannot interpret the PLL information based on index as its exposed as an integer. This commit exposes ASIC specific PLL indexes and maps it to a generic FW compatible index. Signed-off-by: Bharat Jauhari Reviewed-by: Oded Gabbay Signed-off-by: Oded

Re: [PATCH][next] habanalabs/gaudi: Fix uninitialized return code rc when read size is zero

2021-04-15 Thread Oded Gabbay
hat the size is not zero. If the size is zero, we never reach this function. Greg, do you mind applying it directly to your -next branch ? I don't have anything pending and I'm too lazy sending a pull request on a single patch ;) Reviewed-by: Oded Gabbay Thanks, Oded

[git pull] habanalabs pull request for kernel 5.13

2021-04-10 Thread Oded Gabbay
DEVICE_UNUSABLE error indication from FW Oded Gabbay (11): habanalabs: reset after device is actually released habanalabs: fail reset if device is not idle habanalabs: reset_upon_device_release is for bring-up habanalabs: print if device is used on FD close habanalabs

[PATCH 7/7] habanalabs: update to latest F/W communication header

2021-04-08 Thread Oded Gabbay
From: Ohad Sharabi update files to latest version from F/W team. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../misc/habanalabs/include/common/cpucp_if.h | 3 +- .../habanalabs/include/common/hl_boot_if.h| 198 ++ 2 files

[PATCH 6/7] habanalabs: print on f/w boot unknown error

2021-04-08 Thread Oded Gabbay
We need to print a message to the kernel log in case we encounter an unknown error in the f/w boot to help the user understand what happened. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/firmware_if.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git

[PATCH 5/7] habanalabs/gaudi: skip iATU if F/W security is enabled

2021-04-08 Thread Oded Gabbay
From: Ofir Bitton As part of the securing GAUDI, the F/W will configure the PCI iATU regions. If the driver identifies a secured PCI ID, it will know to skip iATU configuration in a very early stage. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers

[PATCH 4/7] habanalabs/gaudi: derive security status from pci id

2021-04-08 Thread Oded Gabbay
From: Ofir Bitton As F/ security indication must be available before driver approaches PCI bus, F/W security should be derived from PCI id rather than be fetched during boot handshake with F/W. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc

[PATCH 3/7] habanalabs: move dram scrub to free sequence

2021-04-08 Thread Oded Gabbay
Jauhari Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/memory.c | 87 ++--- 1 file changed, 48 insertions(+), 39 deletions(-) diff --git a/drivers/misc/habanalabs/common/memory.c b/drivers/misc/habanalabs/common/memory.c index 6530fddbbc21

[PATCH 2/7] habanalabs: send dynamic msi-x indexes to f/w

2021-04-08 Thread Oded Gabbay
From: Ohad Sharabi In order to minimize hard coded values between F/W and the driver, we send msi-x indexes dynamically to the F/W. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/firmware_if.c | 67

[PATCH 1/7] habanalabs/gaudi: clear QM errors only if not in stop_on_err mode

2021-04-08 Thread Oded Gabbay
From: Tomer Tayar Clearing QM errors by the driver will prevent these H/W blocks from stopping in case they are configured to stop on errors, so perform this clearing only if this mode is not in use. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers

[PATCH] habanalabs: support DEVICE_UNUSABLE error indication from FW

2021-04-04 Thread Oded Gabbay
From: Koby Elbaz In case of multiple ECC errors, FW will set the DEVICE_UNUSABLE bit. On boot-up, the driver will therefore fail inserting the device. Signed-off-by: Koby Elbaz Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/firmware_if.c| 3

[PATCH] habanalabs: use strscpy instead of sprintf and strlcpy

2021-04-03 Thread Oded Gabbay
Prefer the use of strscpy when copying the ASIC name into a char array, to prevent accidentally exceeding the array's length. In addition, strlcpy is frowned upon so replace it. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/device.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH] habanalabs: remove the store jobs array from CS IOCTL

2021-04-02 Thread Oded Gabbay
-off-by: Oded Gabbay --- include/uapi/misc/habanalabs.h | 35 ++ 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/include/uapi/misc/habanalabs.h b/include/uapi/misc/habanalabs.h index 90798eaac728..d3e017b5f0db 100644 --- a/include/uapi/misc

[PATCH 3/3] habanalabs/gaudi: add debugfs to DMA from the device

2021-04-02 Thread Oded Gabbay
; hbm.txt ; done Signed-off-by: Oded Gabbay --- .../ABI/testing/debugfs-driver-habanalabs | 68 ++-- drivers/misc/habanalabs/common/debugfs.c | 118 - drivers/misc/habanalabs/common/habanalabs.h | 17 +- drivers/misc/habanalabs/gaudi/gaudi.c

[PATCH 2/3] habanalabs/gaudi: sync stream add protection to SOB reset flow

2021-04-02 Thread Oded Gabbay
since the SOB value is invalid. so we protect this area with a mutex, to delay context creation. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/gaudi/gaudi.c | 16 1 file changed, 12 insertions(+), 4 deletions

[PATCH 1/3] habanalabs: add custom timeout flag per cs

2021-04-02 Thread Oded Gabbay
From: Alon Mizrahi There is a need to allow to user to send command submissions with custom timeout as some CS take longer than the max timeout that is used by default. Signed-off-by: Alon Mizrahi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../habanalabs/common

[PATCH 3/3] habanalabs: improve utilization calculation

2021-03-21 Thread Oded Gabbay
Gabbay Signed-off-by: Oded Gabbay --- .../habanalabs/common/command_submission.c| 18 --- drivers/misc/habanalabs/common/device.c | 121 ++ drivers/misc/habanalabs/common/habanalabs.h | 25 +--- .../misc/habanalabs/common/habanalabs_ioctl.c | 11 +- drivers/misc

[PATCH 2/3] habanalabs: support legacy and new pll indexes

2021-03-21 Thread Oded Gabbay
LKD will keep working with old PLL numbering. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/firmware_if.c | 49 ++- drivers/misc/habanalabs/common/habanalabs.h | 14 -- drivers/misc/habanalabs/common

[PATCH 1/3] habanalabs: move relevant datapath work outside cs lock

2021-03-21 Thread Oded Gabbay
From: Ofir Bitton In order to shorten the time cs lock is being held, we move any possible work outside of the cs lock. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../habanalabs/common/command_submission.c| 86 +++ drivers/misc

[PATCH 4/4] habanalabs: support dynamic PLL numbering

2021-03-14 Thread Oded Gabbay
From: Ohad Sharabi As part of the effort remove hard-coded assumptions from the F/W-driver communication, introduce support for dynamic pll numbering. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/firmware_if.c | 22

[PATCH 3/4] habanalabs: avoid soft lockup bug upon mapping error

2021-03-14 Thread Oded Gabbay
From: farah kassabri Add a little sleep between page unmappings in case mapping of large number of host pages failed, in order to avoid soft lockup bug during the rollback. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common

[PATCH 1/4] habanalabs/gaudi: unsecure TPC cfg status registers

2021-03-14 Thread Oded Gabbay
From: Ofir Bitton Unsecure relevant registers as TPC engine need access to TPC status. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/gaudi/gaudi_security.c | 8 1 file changed, 8 deletions(-) diff --git a/drivers/misc

[PATCH 2/4] habanalabs/gaudi: Update async events header

2021-03-14 Thread Oded Gabbay
From: Ofir Bitton Update with latest version from the Firmware team. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/gaudi/gaudi.c | 2 +- .../include/gaudi/gaudi_async_events.h| 2 +- .../gaudi

[PATCH 1/2] habanalabs/gaudi: reset device upon BMC request

2021-03-09 Thread Oded Gabbay
From: Ofir Bitton In case the BMC of the devices' box wants to initiate a reset of a specific device, it must go through driver. Once driver will receive the request it will initiate a hard reset flow. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay

[PATCH 2/2] habanalabs/gaudi: always use single-msi mode

2021-03-09 Thread Oded Gabbay
malicious user from causing this scenario. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/gaudi/gaudi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers/misc/habanalabs/gaudi/gaudi.c index 099c51350be6..0bcee675e1db

[PATCH] habanalabs: debugfs access to user mapped host addresses

2021-03-03 Thread Oded Gabbay
From: Ofir Bitton In order to have a better debuggability we allow debugfs access to user mmu mapped host memory. Non-user host memory access will be rejected. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/debugfs.c| 88

[git pull resend] habanalabs fixes for 5.12-rc2

2021-03-03 Thread Oded Gabbay
. - Remove unused dentry pointer for debugFS files. Greg Kroah-Hartman (1): drivers: habanalabs: remove unused dentry pointer for debugfs files Oded Gabbay (1): habanalabs: mark hl_eq_inc_ptr() as static Tomer Tayar (2

[git pull resend] habanalabs fixes for 5.12-rc2

2021-03-03 Thread Oded Gabbay
. - Remove unused dentry pointer for debugFS files. Greg Kroah-Hartman (1): drivers: habanalabs: remove unused dentry pointer for debugfs files Oded Gabbay (1): habanalabs: mark hl_eq_inc_ptr() as static Tomer Tayar (2

[git pull] habanalabs fixes for 5.12-rc2

2021-03-02 Thread Oded Gabbay
. - Remove unused dentry pointer for debugFS files. - Mark function as static. Greg Kroah-Hartman (1): drivers: habanalabs: remove unused dentry pointer for debugfs files Oded Gabbay (1): habanalabs: mark hl_eq_inc_ptr

[PATCH] habanalabs: fix debugfs address translation

2021-03-02 Thread Oded Gabbay
offset to the actual address, which is to use the dram page size mask to fetch the page offset from the virtual address, instead of the dmmu last hop shift. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/mmu/mmu.c | 38

Re: [PATCH] banalabs: Switch to using the new API kobj_to_dev()

2021-02-28 Thread Oded Gabbay
tainer_of(kobj, struct device, kobj); > + struct device *dev = kobj_to_dev(kobj); > struct hl_device *hdev = dev_get_drvdata(dev); > char *data; > int rc; > -- > 1.8.3.1 > Reviewed-by: Oded Gabbay Applied to -next. Thanks, Oded

[PATCH 2/2] habanalabs: update hl_boot_if.h

2021-02-28 Thread Oded Gabbay
From: Ohad Sharabi Update to the latest version of the file as supplied by the F/W. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/include/common/hl_boot_if.h | 11 +++ 1 file changed, 11 insertions(+) diff --git

[PATCH 1/2] habanalabs: skip DISABLE PCI packet to FW on heartbeat

2021-02-28 Thread Oded Gabbay
From: Ohad Sharabi if reset is due to heartbeat, device CPU is no responsive in which case no point sending PCI disable message to it. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../habanalabs/common/command_submission.c| 4 +- drivers/misc

[PATCH 4/4] habanalabs: replace GFP_ATOMIC with GFP_KERNEL

2021-02-25 Thread Oded Gabbay
a fallback to allocate memory using GFP_KERNEL, once ATOMIC allocation fails. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../misc/habanalabs/common/command_buffer.c | 12 +++--- .../habanalabs/common/command_submission.c| 22

[PATCH 3/4] habanalabs/gaudi: update extended async event header

2021-02-25 Thread Oded Gabbay
From: Ofir Bitton Update to the latest definition of the firmware Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../include/gaudi/gaudi_async_ids_map_extended.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers

[PATCH 2/4] habanalabs: return current power via INFO IOCTL

2021-02-25 Thread Oded Gabbay
From: Sagiv Ozeri Add driver implementation for reading the current power from the device CPU F/W. Signed-off-by: Sagiv Ozeri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/firmware_if.c | 23 +++ drivers/misc/habanalabs/common

[PATCH 1/4] habanalabs: support HW blocks vm show

2021-02-25 Thread Oded Gabbay
From: Sagiv Ozeri Improve "vm" debugfs node to print also the virtual addresses which are currently mapped to HW blocks in the device. Signed-off-by: Sagiv Ozeri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../ABI/testing/debugfs-driver-habanalabs | 2 +- dr

[PATCH] habanalabs: use a single FW loading bringup flag

2021-02-24 Thread Oded Gabbay
From: Ofir Bitton For simplicity, use a single bringup flag indicating which FW binaries should loaded to device. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/firmware_if.c| 10 +++--- drivers/misc/habanalabs

[PATCH 2/3] habanalabs: wait for interrupt support

2021-02-22 Thread Oded Gabbay
-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../habanalabs/common/command_submission.c| 213 +- drivers/misc/habanalabs/common/device.c | 44 ++-- drivers/misc/habanalabs/common/habanalabs.h | 28 ++- .../misc/habanalabs/common

[PATCH 3/3] habanalabs: use correct define for 32-bit max value

2021-02-22 Thread Oded Gabbay
Timeout in wait for interrupt is in 32-bit variable so we need to use the correct maximum value to compare. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/command_submission.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/habanalabs/common

[PATCH 1/3] habanalabs: enable all IRQs for user interrupt support

2021-02-22 Thread Oded Gabbay
From: Ofir Bitton In order to support user interrupts, driver must enable all MSI-X interrupts for any case user will trigger them. We differentiate between a valid user interrupt and a non valid one. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers

[PATCH 1/2] habanalabs: change default CS timeout to 30 seconds

2021-02-22 Thread Oded Gabbay
Because our graph contains network operations, we need to account for delay in the network. 5 seconds timeout per CS is not enough to account for that. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/habanalabs_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH 2/2] habanalabs: reset device in case of sync error

2021-02-22 Thread Oded Gabbay
From: Ohad Sharabi As the F/wW is the first to detect out of sync event, a new event is added to notify the driver on such event. In which case the driver performs hard reset. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/gaudi

[PATCH 5/5] habanalabs: print if device is used on FD close

2021-02-22 Thread Oded Gabbay
Notify to the user that although he closed the FD, the device is still in use because there are live CS and/or memory mappings (mmaps). Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/device.c | 8 +--- drivers/misc/habanalabs/common/habanalabs.h | 2 +- 2 files changed, 6

[PATCH 3/5] habanalabs: fail reset if device is not idle

2021-02-22 Thread Oded Gabbay
After any reset (soft or hard) the device (the engines/QMANs) should be idle. If they are not idle, fail the reset. If it is soft-reset, the driver will try to do hard-reset automatically. If it is hard-reset, the driver will make the device non-operational. Signed-off-by: Oded Gabbay

[PATCH 4/5] habanalabs: reset_upon_device_release is for bring-up

2021-02-22 Thread Oded Gabbay
Move the field to correct location in structure and remove comment. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/habanalabs.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/misc/habanalabs/common/habanalabs.h b/drivers/misc/habanalabs/common

[PATCH 2/5] habanalabs: reset after device is actually released

2021-02-22 Thread Oded Gabbay
block that is now currently being reset, and the process writes/reads to that block during the reset, the device can get stuck. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/device.c | 32 - 1 file changed, 16 insertions(+), 16 deletions(-) diff --git

[PATCH 1/5] habanalabs: add reset support when user closes FD

2021-02-22 Thread Oded Gabbay
Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/device.c | 21 +++-- drivers/misc/habanalabs/common/habanalabs.h | 2 ++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/misc/habanalabs/common/device.c b/drivers/misc/habanalabs/common

[PATCH 2/2] habanalabs: Disable file operations after device is removed

2021-02-22 Thread Oded Gabbay
a best effort, as memory leak will occur. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/device.c | 40 --- .../misc/habanalabs/common/habanalabs_ioctl.c | 12 ++ 2 files changed, 46 insertions(+), 6

[PATCH 1/2] habanalabs: Call put_pid() when releasing control device

2021-02-22 Thread Oded Gabbay
Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/misc/habanalabs/common/device.c b/drivers/misc/habanalabs/common/device.c index 15fcb5c31c4b..9ecd805f0e88 100644 --- a/drivers/misc/habanal

[PATCH] habanalabs: set max asid to 2

2021-02-16 Thread Oded Gabbay
From: farah kassabri currently we support only 2 asids in all asics. asid 0 for driver, and asic 1 for user. no need to setup 1024 asids configurations at init phase. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/include/gaudi

[PATCH] habanalabs: mark hl_eq_inc_ptr() as static

2021-02-16 Thread Oded Gabbay
hl_eq_inc_ptr() is not called from anywhere outside irq.c so mark it as static Reported-by: kernel test robot Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/habanalabs/common/irq.c b/drivers

Re: [PATCH] drivers: habanalabs: remove unused dentry pointer for debugfs files

2021-02-16 Thread Oded Gabbay
emove the saved pointer as well, saving a tiny bit of memory and logic. > > Cc: Oded Gabbay > Cc: Arnd Bergmann > Cc: Tomer Tayar > Cc: Moti Haimovski > Cc: Omer Shpigelman > Cc: Ofir Bitton > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Greg Kroah-Hartman > --

[git pull] habanalabs second pull request for kernel 5.12

2021-02-08 Thread Oded Gabbay
. Oded Gabbay (4): habanalabs: fix integer handling issue habanalabs: enable F/W events after init done habanalabs: return block size + block ID habanalabs/gaudi: don't enable clock gating on DMA5 Ofir Bitton (2

[PATCH 3/3] habanalabs/gaudi: don't enable clock gating on DMA5

2021-02-06 Thread Oded Gabbay
Graph Compiler uses DMA5 in a non-standard way and it requires the driver to disable clock gating on that DMA. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/gaudi/gaudi.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers/misc

[PATCH 1/3] habanalabs: update security map after init CPU Qs

2021-02-06 Thread Oded Gabbay
d-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/firmware_if.c | 7 ++- drivers/misc/habanalabs/common/habanalabs.h | 3 --- drivers/misc/habanalabs/gaudi/gaudi.c| 6 +- drivers/misc/habanalabs/goya/goya.c | 6 +- 4 files changed, 12

[PATCH 2/3] habanalabs: return block size + block ID

2021-02-06 Thread Oded Gabbay
When user gives us a block address to get its ID to mmap it, he also needs to get from us the block size to pass to the driver in the mmap function. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/habanalabs.h | 4 ++- drivers/misc/habanalabs/common/memory.c | 19

[PATCH 1/4] habanalabs: improve communication protocol with cpucp

2021-02-02 Thread Oded Gabbay
-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/firmware_if.c| 17 +++-- drivers/misc/habanalabs/common/habanalabs.h | 3 +++ drivers/misc/habanalabs/gaudi/gaudi.c | 6 +- drivers/misc/habanalabs/goya/goya.c | 6

[PATCH 2/4] habanalabs: support fetching first available user CQ

2021-02-02 Thread Oded Gabbay
From: Ofir Bitton User must be aware of the available CQs when it needs to use them. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/habanalabs.h | 2 ++ drivers/misc/habanalabs/common/habanalabs_ioctl.c | 3

[PATCH 4/4] habanalabs: enable F/W events after init done

2021-02-02 Thread Oded Gabbay
it shouldn't be. Same logic should be applied after hard-reset. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/device.c | 23 + drivers/misc/habanalabs/common/habanalabs.h | 9 ++-- drivers/misc/habanalabs/gaudi/gaudi.c | 10 ++--- drivers/misc

[PATCH 3/4] habanalabs/gaudi: use HBM_ECC_EN bit for ECC ERR

2021-02-02 Thread Oded Gabbay
From: Ohad Sharabi driver should use ECC info from FW only if HBM ECC CAP is set. otherwise, try to fetch the data from MC regs only if security is disabled. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/gaudi/gaudi.c | 18

[git pull] habanalabs pull request for kernel 5.12

2021-01-27 Thread Oded Gabbay
habanalabs: report dram_page_size in hw_ip_info ioctl habanalabs: support non power-of-2 DRAM phys page sizes Oded Gabbay (8): habanalabs: update firmware boot interface habanalabs: add ASIC property of functional HBMs habanalabs: update to latest hl_boot_if.h habanala

[PATCH 2/3] habanalabs/gaudi: unmask HBM interrupts after handling

2021-01-26 Thread Oded Gabbay
As the driver does with all interrupts, we need to tell F/W to unmask the HBM interrupts after the driver handled them. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/gaudi/gaudi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers/misc

[PATCH 1/3] habanalabs: update SyncManager interrupt handling

2021-01-26 Thread Oded Gabbay
The firmware provides more information about SyncManager events. Adjust the code to the latest firmware interface file. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/gaudi/gaudi.c | 14 +++--- drivers/misc/habanalabs/include/common/cpucp_if.h | 11 +-- 2

[PATCH 3/3] habanalabs: update to latest hl_boot_if.h spec from F/W

2021-01-26 Thread Oded Gabbay
It adds the definition for indication that the F/W handles HBM ECC events. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/include/common/hl_boot_if.h | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/misc/habanalabs/include/common/hl_boot_if.h b/drivers

[PATCH 3/3] habanalabs: fix ETR security issue

2021-01-26 Thread Oded Gabbay
From: Ohad Sharabi ETR should always be non-secured as it is used by the users to record profiling/trace data. This patch fixes the configuration to match those requirements. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../misc/habanalabs/gaudi

[PATCH 2/3] habanalabs: staged submission support

2021-01-26 Thread Oded Gabbay
Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../habanalabs/common/command_submission.c| 214 -- drivers/misc/habanalabs/common/habanalabs.h | 9 + drivers/misc/habanalabs/common/hw_queue.c | 27 +++ drivers/misc/habanalabs/gaudi/gaudi.c | 1 + 4

[PATCH 1/3] habanalabs: modify device_idle interface

2021-01-26 Thread Oded Gabbay
From: Ohad Sharabi Currently this API uses single 64 bits mask for engines idle indication. Recently, it was observed that more bits are needed for some ASICs. This patch modifies the use of the idle mask and the idle_extensions mask. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay

[PATCH] habanalabs: add CS completion and timeout properties

2021-01-26 Thread Oded Gabbay
From: Ofir Bitton In order to support staged submission feature, we need to distinguish on which command submission we want to receive timeout and for which we want to receive completion. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../habanalabs

[PATCH] habanalabs: add new mem ioctl op for mapping hw blocks

2021-01-24 Thread Oded Gabbay
From: Ofir Bitton For future ASIC support the driver allows user to map certain regions in the device's configuration space for direct access from userspace. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/device.c | 3

[git pull] habanalabs fixes for 5.11-rc5

2021-01-21 Thread Oded Gabbay
. If that happens, the server might crash. Oded Gabbay (2): habanalabs: fix backward compatibility of idle check habanalabs: disable FW events on device removal Ofir Bitton (1): habanalabs: zero pci counters packet

[PATCH 3/3] habanalabs: fix MMU debugfs related nodes

2021-01-18 Thread Oded Gabbay
From: farah kassabri In mmu debugfs node show un-scrambled physical addresses. before read/write through data nodes, need to unscramble the physical address before using it for pci transaction. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers

[PATCH 1/3] habanalabs: always try to use the hint address

2021-01-18 Thread Oded Gabbay
From: farah kassabri Currently hint address is ignored in case va block page size is not power of 2. We need to support th user hint address also in this case, but only if the hint address is aligned to page size. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded

[PATCH 2/3] habanalabs: add user available interrupt to hw_ip

2021-01-18 Thread Oded Gabbay
From: Ofir Bitton In order to support completions that arrive directly to the user, the driver needs to supply the user with the first available msix interrupt available. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common

[PATCH 1/3] habanalabs: zero pci counters packet before submit to FW

2021-01-18 Thread Oded Gabbay
From: Ofir Bitton Driver does not zero some pci counters packets before sending to FW. This causes an out of sync PI/CI between driver and FW. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/firmware_if.c | 5 + 1 file

[PATCH 3/3] habanalabs: disable FW events on device removal

2021-01-18 Thread Oded Gabbay
When device is removed, we need to make sure the F/W won't send us any more events because during the remove process we disable the interrupts. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/device.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/misc

[PATCH 2/3] habanalabs: fix backward compatibility of idle check

2021-01-18 Thread Oded Gabbay
Need to take the lower 32 bits of the driver's 64-bit idle mask and put it in the legacy 32-bit variable that the userspace reads to know the idle mask. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/habanalabs_ioctl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers

[git pull] habanalabs fixes for 5.11-rc4

2021-01-12 Thread Oded Gabbay
unmappings to prevent that. Oded Gabbay (3): habanalabs: fix dma_addr passed to dma_mmap_coherent habanalabs: fix reset process in case of failures habanalabs: prevent soft lockup during unmap drivers/misc/habanalabs

[PATCH 2/2] CREDITS: update email address and home address

2021-01-12 Thread Oded Gabbay
Update my email address to kernel.org account and my home address to my new house. Signed-off-by: Oded Gabbay --- CREDITS | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CREDITS b/CREDITS index 090ed4b004a5..ebd00ca9515b 100644 --- a/CREDITS +++ b/CREDITS @@ -1240,10

[PATCH 1/2] habanalabs: update email address in sysfs/debugfs docs

2021-01-12 Thread Oded Gabbay
Use my kernel.org address for contact point instead of my private email address. Signed-off-by: Oded Gabbay --- .../ABI/testing/debugfs-driver-habanalabs | 44 +++--- .../ABI/testing/sysfs-driver-habanalabs | 58 +-- 2 files changed, 51 insertions(+), 51

[PATCH 3/4] habanalabs: ignore F/W BMC errors in case no BMC present

2021-01-12 Thread Oded Gabbay
From: Ofir Bitton In order to support operation mode in which BMC is not active, driver must not take BMC errors into consideration. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/firmware_if.c | 12 +--- 1 file

[PATCH 2/4] habanalabs/gaudi: print sync manager SEI interrupt info

2021-01-12 Thread Oded Gabbay
From: Ofir Bitton Driver must print sync manager SEI information upon receiving interrupt from FW. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/gaudi/gaudi.c | 41 +++ .../misc/habanalabs/include/common

[PATCH 4/4] habanalabs: add security violations dump to debugfs

2021-01-12 Thread Oded Gabbay
From: Ofir Bitton In order to improve driver security debuggability, we add security violations dump to debugfs. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../ABI/testing/debugfs-driver-habanalabs | 8 +++ drivers/misc/habanalabs/common

[PATCH 1/4] habanalabs: Use 'dma_set_mask_and_coherent()'

2021-01-12 Thread Oded Gabbay
-by: Christophe JAILLET Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/pci/pci.c | 43 1 file changed, 7 insertions(+), 36 deletions(-) diff --git a/drivers/misc/habanalabs/common/pci/pci.c b/drivers/misc/habanalabs/common/pci/pci.c index

[PATCH 3/3] habanalabs: prevent soft lockup during unmap

2021-01-12 Thread Oded Gabbay
need to free the core to do other things during the unmapping process. For now, we chose to do it every 32K unmappings (each unmap is a single 4K page). Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/habanalabs.h | 1 + drivers/misc/habanalabs/common/memory.c | 10

[PATCH 2/3] habanalabs: fix reset process in case of failures

2021-01-12 Thread Oded Gabbay
. The protections that are added in this patch make sure that if the fini functions are called multiple times, without calling init functions between them, there won't be double release of already released resources. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/device.c | 2 +- drivers

[PATCH 1/3] habanalabs: fix dma_addr passed to dma_mmap_coherent

2021-01-12 Thread Oded Gabbay
to the user via dma_mmap_coherent(), we need to pass the original dma address, without this offset. Otherwise, we will get erronouos mapping. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/gaudi/gaudi.c | 3 ++- drivers/misc/habanalabs/goya/goya.c | 3 ++- 2 files changed, 4 insertions(+), 2

Re: [PATCH] habanalabs: Use 'dma_set_mask_and_coherent()' instead of hand-writing it

2021-01-05 Thread Oded Gabbay
oto unmap_pci_bars; > } > > - rc = hl_pci_set_dma_mask(hdev); > - if (rc) > + rc = dma_set_mask_and_coherent(>dev, > DMA_BIT_MASK(hdev->dma_mask)); > + if (rc) { > + dev_err(hdev->dev, > + "Failed to set dma mask to %d bits, error %d\n", > + hdev->dma_mask, rc); > goto unmap_pci_bars; > + } > > return 0; > > -- > 2.27.0 > Reviewed-by: Oded Gabbay Applied to -next Oded

[PATCH 2/4] habanalabs: increment ctx ref from within a cs allocation

2021-01-03 Thread Oded Gabbay
the CS allocate function. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../misc/habanalabs/common/command_submission.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/misc/habanalabs/common/command_submission.c b

[PATCH 3/4] habanalabs: add driver support for internal cb scheduling

2021-01-03 Thread Oded Gabbay
Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../habanalabs/common/command_submission.c| 141 ++ drivers/misc/habanalabs/common/context.c | 3 + drivers/misc/habanalabs/common/device.c | 2 + drivers/misc/habanalabs/common/habanalabs.h | 26

  1   2   3   4   5   6   7   8   9   10   >