RE: [PATCH 4/4] habanalabs: add notice of device not idle

2020-09-24 Thread Tomer Tayar
On Thu, Sep 24, 2020 at 10:03 AM Oded Gabbay wrote: > The device should be idle after a context is closed. If not, print a > notice. > > Signed-off-by: Oded Gabbay This patch-set is: Reviewed-by: Tomer Tayar

RE: [PATCH] habanalabs: count dropped CS because max CS in-flight

2020-09-07 Thread Tomer Tayar
; Signed-off-by: Oded Gabbay Reviewed-by: Tomer Tayar

RE: [PATCH 6/6] habanalabs: check flag before reset because of f/w event

2020-09-07 Thread Tomer Tayar
On Fri, Sep 4, 2020 at 21:46 Oded Gabbay wrote: > For consistency with GAUDI code, add check of the relevant flag in the > device structure before resetting the GOYA device in case of firmware > event. > > Signed-off-by: Oded Gabbay This patch-set is: Reviewed-by: Tomer Tayar

RE: [PATCH 2/2] habanalabs: update GAUDI hardware specs

2020-08-22 Thread Tomer Tayar
On Sat, Aug 22, 2020 at 19:24 Oded Gabbay wrote: > Add define for the 2 MME slave engines. > > Signed-off-by: Oded Gabbay Reviewed-by: Tomer Tayar

[PATCH] habanalabs: Include linux/bitfield.h only in habanalabs.h

2020-08-18 Thread Tomer Tayar
Include linux/bitfield.h only in habanalabs.h, instead of in each and every file that needs it, as habanalabs.h is already included by all. Signed-off-by: Tomer Tayar --- drivers/misc/habanalabs/common/habanalabs.h | 1 + drivers/misc/habanalabs/common/hw_queue.c | 1

RE: [PATCH 5/9] habanalabs: use FIELD_PREP() instead of <

2020-08-16 Thread Tomer Tayar
On Sat, Aug 15, 2020 at 21:00 Oded Gabbay wrote: > Use the standard FIELD_PREP() macro instead of << operator to perform > bitmask operations. This ensures type check safety and eliminate compiler > warnings. > > Reported-by: kernel test robot > Signed-off-by: Oded Gab

RE: [PATCH 6/9] habanalabs: remove redundant assignment to variable

2020-08-16 Thread Tomer Tayar
On Sat, Aug 15, 2020 at 21:00 Oded Gabbay wrote: > new_dma_pkt->ctl is assigned a value and then is reassigned a new value > without the first value ever being used. > > Reported-by: kernel test robot > Signed-off-by: Oded Gabbay Reviewed-by: Tomer Tayar

RE: [PATCH 7/9] habanalabs: check TPC vector pipe is empty

2020-08-16 Thread Tomer Tayar
return > value. > > Reported-by: kernel test robot > Signed-off-by: Oded Gabbay Reviewed-by: Tomer Tayar

RE: [PATCH 8/9] habanalabs: use 1U when shifting bits

2020-08-16 Thread Tomer Tayar
On Sat, Aug 15, 2020 at 21:00 Oded Gabbay wrote: > Eliminate following warning: > warning: Shifting signed 32-bit value by 31 bits is undefined behavior > > Reported-by: kernel test robot > Signed-off-by: Oded Gabbay Reviewed-by: Tomer Tayar

RE: [PATCH 4/9] habanalabs: use standard BIT() and GENMASK()

2020-08-16 Thread Tomer Tayar
On Sat, Aug 15, 2020 at 21:00 Oded Gabbay wrote: > Use the standard macros to define bitmasks. > > Reported-by: kernel test robot > Signed-off-by: Oded Gabbay Reviewed-by: Tomer Tayar

RE: [PATCH 1/9] habanalabs: change CB's ID to be 64 bits

2020-08-16 Thread Tomer Tayar
ned-off-by: Oded Gabbay Reviewed-by: Tomer Tayar

RE: [PATCH 3/9] habanalabs: eliminate redundant else condition

2020-08-16 Thread Tomer Tayar
On Sat, Aug 15, 2020 at 21:00 Oded Gabbay wrote: > If both parts of if-else are goto statements, we can remove the else and > put the else goto statement after the if statement. > > Reported-by: kernel test robot > Signed-off-by: Oded Gabbay Reviewed-by: Tomer Tayar

RE: [PATCH 2/9] habanalabs: cast int to u32 before printing it with %u

2020-08-16 Thread Tomer Tayar
On Sat, Aug 15, 2020 at 21:00 Oded Gabbay wrote: > %u is used for unsigned so we need to cast the int variable to u32 to avoid > compiler warning. > > Reported-by: kernel test robot > Signed-off-by: Oded Gabbay Reviewed-by: Tomer Tayar

RE: [PATCH] habanalabs: increase length of ASIC name

2020-08-03 Thread Tomer Tayar
On Mon, Aug 3, 2020 at 14:51 Oded Gabbay wrote: > Future ASIC names are longer than 15 chars so increase the variable length > to 32 chars. > > Signed-off-by: Oded Gabbay Reviewed-by: Tomer Tayar

[PATCH] habanalabs: Fix memory leak in error flow of context init

2020-07-22 Thread Tomer Tayar
Add a missing free of the cs_pending array in the error flow of context init. Fixes: 4b49c5b118b9 ("habanalabs: Use pending cs amount per asic") Signed-off-by: Tomer Tayar --- drivers/misc/habanalabs/common/context.c | 18 ++ 1 file changed, 10 insertions(+), 8

[PATCH] habanalabs: use no flags on MMU cache invalidation

2020-07-19 Thread Tomer Tayar
gaudi_mmu_invalidate_cache() doesn't use the flags parameter, and thus it can be set to 0 when the function is called in the gaudi only files. Signed-off-by: Tomer Tayar --- drivers/misc/habanalabs/gaudi/gaudi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers

RE: [PATCH 2/2] habanalabs: enable device before hw_init()

2020-07-16 Thread Tomer Tayar
y Reviewed-by: Tomer Tayar

RE: [PATCH] habanalabs: prevent possible out-of-bounds array access

2020-07-13 Thread Tomer Tayar
On Sun, Jul 12, 2020 at 23:46 Oded Gabbay wrote: > Queue index is received from the user. Therefore, we must validate it before > using it to access the queue props array. > > Signed-off-by: Oded Gabbay Reviewed-by: Tomer Tayar

RE: [PATCH 1/4] habanalabs: halt device CPU only upon certain reset

2020-07-13 Thread Tomer Tayar
driver now needs to send a message to the device F/W to > disable it from sending interrupts to the host machine because during halt > engines function the driver disables the MSI/MSI-X interrupts. > > Signed-off-by: Oded Gabbay Reviewed-by: Tomer Tayar

RE: [PATCH] habanalabs: set 4s timeout for message to device CPU

2020-07-08 Thread Tomer Tayar
to 4 seconds on each message sent to the device CPU. > > Signed-off-by: Oded Gabbay Reviewed-by: Tomer Tayar

RE: [PATCH 7/9] habanalabs: remove soft-reset support from GAUDI

2020-07-05 Thread Tomer Tayar
On Sun, Jul 5, 2020 at 16:13 Oded Gabbay wrote: > Soft-reset isn't supported in GAUDI. Remove the code that performs it and > print error in case the user wants to do it via sysfs. > > Signed-off-by: Oded Gabbay Reviewed-by: Tomer Tayar

RE: [PATCH 2/9] habanalabs: rephrase error messages

2020-07-05 Thread Tomer Tayar
by: Oded Gabbay Reviewed-by: Tomer Tayar

RE: [PATCH] habanalabs: increase GAUDI QMAN ARB WDT timeout

2020-06-12 Thread Tomer Tayar
On Fri, Jun 12, 2020 at 9:28 AM, Oded Gabbay wrote: > The current timeout is too low for some of the workloads and we see false > errors as a result. > > Signed-off-by: Oded Gabbay Reviewed-by: Tomer Tayar

RE: [PATCH] habanalabs: rename mmu_write() to mmu_asid_va_write()

2020-06-07 Thread Tomer Tayar
On Sun, Jun 7, 2020 at 8:31 AM, Oded Gabbay wrote: > The function name conflicts with a static inline function in > arch/m68k/include/asm/mcfmmu.h > > Reported-by: kernel test robot > Signed-off-by: Oded Gabbay Reviewed-by: Tomer Tayar

RE: [PATCH 1/2] habanalabs: block scalar load_and_exe on external queue

2020-06-06 Thread Tomer Tayar
> > Signed-off-by: Oded Gabbay Reviewed-by: Tomer Tayar

[PATCH] habanalabs: Fix static analysis error

2020-05-27 Thread Tomer Tayar
Fix the following smatch error in unmap_device_va(): error: uninitialized symbol 'rc'. Signed-off-by: Tomer Tayar --- drivers/misc/habanalabs/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/habanalabs/memory.c b/drivers/misc/habanalabs/memo

RE: [PATCH 3/4] habanalabs: GAUDI does not support soft-reset

2020-05-21 Thread Tomer Tayar
is > done on multiple GAUDIs. > > Signed-off-by: Oded Gabbay Reviewed-by: Tomer Tayar

RE: [PATCH] habanalabs: add missing MODULE_DEVICE_TABLE

2020-05-03 Thread Tomer Tayar
On Sun, May 3, 2020 at 16:24, Oded Gabbay wrote: > PCI drivers should use this define to declare their PCI ID table. > > Signed-off-by: Oded Gabbay Reviewed-by: Tomer Tayar

RE: [PATCH] habanalabs: add opcode to INFO IOCTL to return clock rate

2019-10-15 Thread Tomer Tayar
On Fri, Oct 11, 2019 at 10:21 AM Oded Gabbay wrote: > Add a new opcode to the INFO IOCTL to allow the user application to > retrieve the ASIC's current and maximum clock rate. The rate is > returned in MHz. > > Signed-off-by: Oded Gabbay Reviewed-by: Tomer Tayar

RE: [PATCH] habanalabs: set TPC Icache to 16 cache lines

2019-10-05 Thread Tomer Tayar
From: Oded Gabbay Sent: Saturday, 5 October 2019 9:58 > Reduce latency to memory during TPC kernel execution. > > Signed-off-by: Oded Gabbay Reviewed-by: Tomer Tayar

[PATCH v2 1/4] habanalabs: Mark queue as expecting to CB handle or address

2019-10-03 Thread Tomer Tayar
on different types of ASIC. This patch adds a new queue property for this target, which is configured per queue type per ASIC type. Signed-off-by: Tomer Tayar --- drivers/misc/habanalabs/command_submission.c | 4 +++- drivers/misc/habanalabs/goya/goya.c | 3 +++ drivers/misc/habanalabs

[PATCH v2 4/4] habanalabs: Add IRQ handler for CS completions

2019-10-03 Thread Tomer Tayar
This patch adds an IRQ handler for CS completions of CS jobs which are sent on H/W queues. The patch adds a CS shadow queue, from which the handler retrieves the CS, and a dedicated workqueue, on which the handler queues a work to free the CS jobs. Signed-off-by: Tomer Tayar --- drivers/misc

[PATCH v2 2/4] habanalabs: Add a new H/W queue type

2019-10-03 Thread Tomer Tayar
host or device SRAM/DRAM, and using the device address to that buffer. The patch includes the handling of the 2 options, as well as the initialization of the H/W queue and its jobs scheduling. Signed-off-by: Tomer Tayar --- Changes in v2: - Fix an uninitialized 'rc' v

[PATCH v2 3/4] habanalabs: Add pre-CS-scheduling ASIC function

2019-10-03 Thread Tomer Tayar
jobs, the monitor generates interrupt towards the host, to inform the driver about the completion of the CS. Signed-off-by: Tomer Tayar --- drivers/misc/habanalabs/command_submission.c | 1 + drivers/misc/habanalabs/goya/goya.c | 8 +++- drivers/misc/habanalabs/goya/goyaP.h | 2

[PATCH 1/4] habanalabs: Mark queue as expecting to CB handle or address

2019-10-03 Thread Tomer Tayar
on different types of ASIC. This patch adds a new queue property for this target, which is configured per queue type per ASIC type. Signed-off-by: Tomer Tayar --- drivers/misc/habanalabs/command_submission.c | 4 +++- drivers/misc/habanalabs/goya/goya.c | 3 +++ drivers/misc/habanalabs

[PATCH 4/4] habanalabs: Add IRQ handler for CS completions

2019-10-03 Thread Tomer Tayar
This patch adds an IRQ handler for CS completions of CS jobs which are sent on H/W queues. The patch adds a CS shadow queue, from which the handler retrieves the CS, and a dedicated workqueue, on which the handler queues a work to free the CS jobs. Signed-off-by: Tomer Tayar --- drivers/misc

[PATCH 2/4] habanalabs: Add a new H/W queue type

2019-10-03 Thread Tomer Tayar
host or device SRAM/DRAM, and using the device address to that buffer. The patch includes the handling of the 2 options, as well as the initialization of the H/W queue and its jobs scheduling. Signed-off-by: Tomer Tayar --- drivers/misc/habanalabs/command_submission.c | 120 ++--- drivers

[PATCH 3/4] habanalabs: Add pre-CS-scheduling ASIC function

2019-10-03 Thread Tomer Tayar
jobs, the monitor generates interrupt towards the host, to inform the driver about the completion of the CS. Signed-off-by: Tomer Tayar --- drivers/misc/habanalabs/command_submission.c | 1 + drivers/misc/habanalabs/goya/goya.c | 8 +++- drivers/misc/habanalabs/goya/goyaP.h | 2

[PATCH] habanalabs: Fix typos

2019-10-02 Thread Tomer Tayar
s/paerser/parser/ s/requeusted/requested/ s/an JOB/a JOB/ Signed-off-by: Tomer Tayar --- drivers/misc/habanalabs/habanalabs.h | 2 +- drivers/misc/habanalabs/hw_queue.c | 4 ++-- include/uapi/misc/habanalabs.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a

RE: [PATCH] habanalabs: handle F/W failure for sensor initialization

2019-09-16 Thread Tomer Tayar
From: Oded Gabbay Sent: Monday, 16 September 2019 11:56 > In case the F/W fails to initialize the thermal sensors, print an > appropriate error message to kernel log and fail the device > initialization. > > Signed-off-by: Oded Gabbay Reviewed-by: Tomer Tayar

RE: [PATCH] habanalabs: correctly cast variable to __le32

2019-09-03 Thread Tomer Tayar
From: Oded Gabbay Sent: Tuesday, 3 September 2019 12:03 > When using the macro le32_to_cpu(x), we need to correctly convert x to be > __le32 in case it is defined as u32 variable. > > Signed-off-by: Oded Gabbay Reviewed-by: Tomer Tayar

[PATCH] habanalabs: Make the Coresight timestamp perpetual

2019-08-27 Thread Tomer Tayar
. The HL_DEBUG_OP_TIMESTAMP opcode turns to be deprecated and shouldn't be used. Signed-off-by: Tomer Tayar --- drivers/misc/habanalabs/goya/goya.c | 23 +++ drivers/misc/habanalabs/goya/goya_coresight.c | 17 ++ include/uapi/misc/habanal

[PATCH] habanalabs: Handle HW_IP_INFO if device disabled or in reset

2019-08-08 Thread Tomer Tayar
The HW IP information is relevant even if the device is disabled or in reset, so always handle the corresponding INFO IOCTL opcode. Signed-off-by: Tomer Tayar --- drivers/misc/habanalabs/habanalabs_ioctl.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a

[PATCH] habanalabs: Expose devices after initialization is done

2019-08-08 Thread Tomer Tayar
*(). Signed-off-by: Tomer Tayar --- drivers/misc/habanalabs/device.c | 163 ++- drivers/misc/habanalabs/habanalabs.h | 2 + 2 files changed, 111 insertions(+), 54 deletions(-) diff --git a/drivers/misc/habanalabs/device.c b/drivers/misc/habanalabs/device.c index

[PATCH] habanalabs: Update DRAM consumption on context tear down

2019-08-04 Thread Tomer Tayar
The patch adds a missing update of the DRAM memory consumption, when a context is being torn down without an organized release of the allocated memory. Signed-off-by: Tomer Tayar --- drivers/misc/habanalabs/memory.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/misc/habanalabs

[PATCH 1/2] habanalabs: Add descriptive names to PSOC scratch-pad registers

2019-08-01 Thread Tomer Tayar
driver and the device CPU. Signed-off-by: Tomer Tayar --- drivers/misc/habanalabs/goya/goya.c | 33 +-- .../habanalabs/include/goya/goya_reg_map.h| 32 ++ 2 files changed, 48 insertions(+), 17 deletions(-) create mode 100644 drivers/misc/habanalabs

[PATCH 2/2] habanalabs: Add descriptive name to PSOC app status register

2019-08-01 Thread Tomer Tayar
Add a meaningful name to the general PSOC application status register which better describes its usage in keeping the HW state. Signed-off-by: Tomer Tayar --- drivers/misc/habanalabs/goya/goya.c | 4 ++-- drivers/misc/habanalabs/include/goya/goya_reg_map.h | 2 ++ 2 files

[PATCH] habanalabs: Avoid double free in error flow

2019-08-01 Thread Tomer Tayar
and remove it from the error flow. Signed-off-by: Tomer Tayar --- drivers/misc/habanalabs/device.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/misc/habanalabs/device.c b/drivers/misc/habanalabs/device.c index 0c4894dd9c02..7a8f9d0b71b5 100644 --- a/drivers

RE: [PATCH] habanalabs: use correct variable to show fd open counter

2019-07-08 Thread Tomer Tayar
le processes. Instead, the driver can use the atomic counter of > the open file descriptors which the driver already maintains. > > Signed-off-by: Oded Gabbay Reviewed-by: Tomer Tayar

[PATCH v2 3/3] habanalabs: Add busy engines bitmask to HW idle IOCTL

2019-07-01 Thread Tomer Tayar
The information which is currently provided as a response to the "HL_INFO_HW_IDLE" IOCTL is merely a general boolean value. This patch extends it and provides also a bitmask that indicates which of the device engines are busy. Signed-off-by: Tomer Tayar --- drivers/misc/habanalabs

[PATCH v2 1/3] habanalabs: Update the device idle check

2019-07-01 Thread Tomer Tayar
. Signed-off-by: Tomer Tayar --- drivers/misc/habanalabs/goya/goya.c | 10 +- .../include/goya/asic_reg/dma_ch_0_masks.h| 418 ++ .../include/goya/asic_reg/goya_regs.h | 1 + 3 files changed, 425 insertions(+), 4 deletions(-) create mode 100644 drivers/misc

[PATCH v2 2/3] habanalabs: Add debugfs node for engines status

2019-07-01 Thread Tomer Tayar
f the more elaborated info of the new debugfs node. Signed-off-by: Tomer Tayar --- Changes in v2: - Move the idle check updates into a separate patch. - Update Documentation/.../debugfs-driver-habanalabs with the new debugfs node. .../ABI/testing/debugfs-driver-habanalabs | 7 + drivers

[PATCH 1/2] habanalabs: Add debugfs node for engines status

2019-07-01 Thread Tomer Tayar
tatus register includes the status of all MME shadows. Signed-off-by: Tomer Tayar --- drivers/misc/habanalabs/debugfs.c | 12 + drivers/misc/habanalabs/goya/goya.c | 127 -- drivers/misc/habanalabs/habanalabs.h | 8 +- drivers/misc/habanalabs/habanalabs_ioctl.c

[PATCH 2/2] habanalabs: Add busy engines bitmask to HW idle IOCTL

2019-07-01 Thread Tomer Tayar
The information which is currently provided as a response to the "HL_INFO_HW_IDLE" IOCTL is merely a general boolean value. This patch extends it and provides also a bitmask that indicates which of the device engines are busy. Signed-off-by: Tomer Tayar --- drivers/misc/habanalabs

[PATCH] habanalabs: Allow accessing host mapped addresses via debugfs

2019-06-16 Thread Tomer Tayar
this missing info is being overcome by simply using phys_to_virt(). However, this is not useful when the IOMMU is enabled, and thus the enforced limitation. Signed-off-by: Tomer Tayar --- .../ABI/testing/debugfs-driver-habanalabs | 11 -- drivers/misc/habanalabs/debugfs.c

[PATCH] habanalabs: Read upper bits of trace buffer from RWPHI

2019-06-04 Thread Tomer Tayar
The trace buffer address is 40 bits wide. The end of the buffer is set in the RWP register (lower 32 bits), and in the RWPHI register (upper 8 bits). Currently only the lower 32 bits are read, and this patch fixes it and concatenates the upper 8 bits to the output address. Signed-off-by: Tomer

[PATCH] habanalabs: Fix virtual address access via debugfs for 2MB pages

2019-06-03 Thread Tomer Tayar
: Tomer Tayar --- drivers/misc/habanalabs/debugfs.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/misc/habanalabs/debugfs.c b/drivers/misc/habanalabs/debugfs.c index 0ce5621c1324..ba418aaa404c 100644 --- a/drivers/misc/habanalabs/debugfs.c +++ b/drivers/misc