Re: [PATCH 12/15] habanalabs/gaudi: add debugfs entries for the NIC

2020-09-10 Thread Oded Gabbay
On Thu, Sep 10, 2020 at 11:16 PM Jakub Kicinski wrote: > > On Thu, 10 Sep 2020 23:10:47 +0300 Oded Gabbay wrote: > > On Thu, Sep 10, 2020 at 11:01 PM Jakub Kicinski wrote: > > > > > > On Thu, 10 Sep 2020 19:11:23 +0300 Oded Gabbay wrote: > > > > From: Om

Re: [PATCH 05/15] habanalabs/gaudi: add NIC Ethernet support

2020-09-10 Thread Oded Gabbay
On Thu, Sep 10, 2020 at 11:03 PM Jakub Kicinski wrote: > > On Thu, 10 Sep 2020 19:11:16 +0300 Oded Gabbay wrote: > > +module_param(nic_rx_poll, int, 0444); > > +MODULE_PARM_DESC(nic_rx_poll, > > + "Enable NIC Rx polling mode (0 = no, 1 = yes, default no)");

Re: [PATCH 13/15] habanalabs/gaudi: Add ethtool support using coresight

2020-09-10 Thread Oded Gabbay
On Thu, Sep 10, 2020 at 11:19 PM Andrew Lunn wrote: > > > +static int gaudi_nic_get_link_ksettings(struct net_device *netdev, > > + struct ethtool_link_ksettings *cmd) > > +{ > > + struct gaudi_nic_device **ptr = netdev_priv(netdev); > > + struct

Re: [PATCH 12/15] habanalabs/gaudi: add debugfs entries for the NIC

2020-09-10 Thread Oded Gabbay
On Thu, Sep 10, 2020 at 11:31 PM Jakub Kicinski wrote: > > On Thu, 10 Sep 2020 23:17:59 +0300 Oded Gabbay wrote: > > > Doesn't seem like this one shows any more information than can be > > > queried with ethtool, right? > > correct, it just displays it in a for

Re: [PATCH 00/15] Adding GAUDI NIC code to habanalabs driver

2020-09-10 Thread Oded Gabbay
On Thu, Sep 10, 2020 at 11:28 PM Jakub Kicinski wrote: > > On Thu, 10 Sep 2020 23:16:22 +0300 Oded Gabbay wrote: > > On Thu, Sep 10, 2020 at 11:01 PM Jakub Kicinski wrote: > > > On Thu, 10 Sep 2020 19:11:11 +0300 Oded Gabbay wrote: > > > > create mode 100

Re: [PATCH 00/15] Adding GAUDI NIC code to habanalabs driver

2020-09-10 Thread Oded Gabbay
On Thu, Sep 10, 2020 at 11:25 PM Andrew Lunn wrote: > > > Can you please elaborate on how to do this with a single driver that > > is already in misc ? > > As I mentioned in the cover letter, we are not developing a > > stand-alone NIC. We have a deep-learning accelerator with a NIC > >

Re: [PATCH 00/15] Adding GAUDI NIC code to habanalabs driver

2020-09-10 Thread Oded Gabbay
On Thu, Sep 10, 2020 at 11:38 PM Andrew Lunn wrote: > > On Thu, Sep 10, 2020 at 11:30:33PM +0300, Oded Gabbay wrote: > > On Thu, Sep 10, 2020 at 11:25 PM Andrew Lunn wrote: > > > > > > > Can you please elaborate on how to do this with a single drive

Re: [PATCH 00/15] Adding GAUDI NIC code to habanalabs driver

2020-09-10 Thread Oded Gabbay
On Fri, Sep 11, 2020 at 12:05 AM Florian Fainelli wrote: > > > > On 9/10/2020 1:32 PM, Oded Gabbay wrote: > > On Thu, Sep 10, 2020 at 11:28 PM Jakub Kicinski wrote: > >> > >> On Thu, 10 Sep 2020 23:16:22 +0300 Oded Gabbay wrote: > >>> On Thu

[PATCH v3 06/14] habanalabs/gaudi: add NIC PHY code

2020-09-15 Thread Oded Gabbay
quality improvement) and not for setting the transmission parameters. As a result, the Auto-negotiation is currently supported only between Gaudi cards. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/gaudi/Makefile|2

[PATCH v3 12/14] habanalabs/gaudi: Add ethtool support using coresight

2020-09-15 Thread Oded Gabbay
strings. - get_sset_count: get counters number. - get_ethtool_stats: get counters values. - get_module_info: get EEPROM type and length. - get_module_eeprom: get EEPROM (supported in raw mode only). Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- Changes

[PATCH v3 11/14] habanalabs/gaudi: add QP error handling

2020-09-15 Thread Oded Gabbay
). Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/gaudi/gaudi.c | 13 drivers/misc/habanalabs/gaudi/gaudiP.h| 1 + drivers/misc/habanalabs/gaudi/gaudi_nic.c | 95 +++ 3 files changed, 109

[PATCH v3 14/14] habanalabs/gaudi: add NIC init/fini calls from common code

2020-09-15 Thread Oded Gabbay
From: Omer Shpigelman Finally, enable the NIC engines. Initialize the NIC ports mask variable with full mask so all ports will be initialized. Call the NIC init/fini from the common code. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc

[PATCH v3 13/14] habanalabs/gaudi: support DCB protocol

2020-09-15 Thread Oded Gabbay
Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/gaudi/Makefile| 2 +- drivers/misc/habanalabs/gaudi/gaudi_nic.c | 3 + .../misc/habanalabs/gaudi/gaudi_nic_dcbnl.c | 108 ++ 3 files changed, 112 insertions(+), 1 deletion(-) create mode

[PATCH v3 05/14] habanalabs/gaudi: add NIC Ethernet support

2020-09-15 Thread Oded Gabbay
at the beginning of the reset flow. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/context.c |1 + drivers/misc/habanalabs/common/firmware_if.c | 44 + drivers/misc/habanalabs/common/habanalabs.h | 13 +- .../misc

[PATCH v3 04/14] habanalabs/gaudi: add support for NIC QMANs

2020-09-15 Thread Oded Gabbay
on QMAN errors from the firmware. However, the nic_ports_mask is still initialized to 0. That means this code won't initialize the QMANs just yet. That will be in a later patch. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs

[PATCH v3 02/14] habanalabs/gaudi: add NIC firmware-related definitions

2020-09-15 Thread Oded Gabbay
From: Omer Shpigelman Add new structures and messages that the driver use to interact with the firmware to receive information and events (errors) about GAUDI's NIC. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../misc/habanalabs/include/common

[PATCH v3 08/14] habanalabs/gaudi: add a new IOCTL for NIC control operations

2020-09-15 Thread Oded Gabbay
ed opcodes are: - Create a QP - Set requester context - Set responder context - Destroy a QP Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/habanalabs.h | 3 + .../misc/habanalabs/common/habanalabs_ioctl.c | 98

[PATCH v3 10/14] habanalabs/gaudi: add WQ control operations

2020-09-15 Thread Oded Gabbay
in the HW. The user should provide the device virtual address of the WQ. - Unset WQ: reset the WQ configuration in the HW. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../misc/habanalabs/common/habanalabs_ioctl.c | 10 +- drivers/misc/habanalabs

[PATCH v3 09/14] habanalabs/gaudi: add CQ control operations

2020-09-15 Thread Oded Gabbay
Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/device.c | 6 +- drivers/misc/habanalabs/common/habanalabs.h | 3 + .../misc/habanalabs/common/habanalabs_ioctl.c | 20 +- drivers/misc/habanalabs/gaudi/gaudi.c | 1 + drivers/misc/habanalabs/gaudi/gaudiP.h

[PATCH v3 07/14] habanalabs/gaudi: allow user to get MAC addresses in INFO IOCTL

2020-09-15 Thread Oded Gabbay
From: Omer Shpigelman The user needs this information when working in a distributed environment with master/slave configuration. All the slaves get their MAC addresses from the driver and send them to the master. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded

[PATCH v3 00/14] Adding GAUDI NIC code to habanalabs driver

2020-09-15 Thread Oded Gabbay
Hello, This is the second version of the patch-set to upstream the GAUDI NIC code into the habanalabs driver. The only modification from v2 is in the ethtool patch (patch 12). Details are in that patch's commit message. Link to v2 cover letter: https://lkml.org/lkml/2020/9/12/201 Thanks, Oded

Re: [PATCH v3 00/14] Adding GAUDI NIC code to habanalabs driver

2020-09-15 Thread Oded Gabbay
On Tue, Sep 15, 2020 at 11:35 PM Jakub Kicinski wrote: > > On Tue, 15 Sep 2020 20:10:08 +0300 Oded Gabbay wrote: > > Hello, > > > > This is the second version of the patch-set to upstream the GAUDI NIC code > > into the habanalabs driver. > > > > The o

Re: [PATCH v3 00/14] Adding GAUDI NIC code to habanalabs driver

2020-09-15 Thread Oded Gabbay
On Tue, Sep 15, 2020 at 11:42 PM David Miller wrote: > > From: Oded Gabbay > Date: Tue, 15 Sep 2020 20:10:08 +0300 > > > This is the second version of the patch-set to upstream the GAUDI NIC code > > into the habanalabs driver. > > > > The only modification fr

Re: [PATCH v3 00/14] Adding GAUDI NIC code to habanalabs driver

2020-09-15 Thread Oded Gabbay
On Wed, Sep 16, 2020 at 12:04 AM Jakub Kicinski wrote: > > On Tue, 15 Sep 2020 23:46:58 +0300 Oded Gabbay wrote: > > On Tue, Sep 15, 2020 at 11:35 PM Jakub Kicinski wrote: > > > On Tue, 15 Sep 2020 20:10:08 +0300 Oded Gabbay wrote: > > > > Hello, > >

Re: [PATCH v3 00/14] Adding GAUDI NIC code to habanalabs driver

2020-09-15 Thread Oded Gabbay
On Wed, Sep 16, 2020 at 12:37 AM Andrew Lunn wrote: > > > I completely understand but you didn't answer my question. How come > > there are drivers which create netdev objects, and specifically sgi-xp > > in misc (but I also saw it in usb drivers) that live outside > > drivers/net ? Why doesn't

Re: [PATCH 12/15] habanalabs/gaudi: add debugfs entries for the NIC

2020-09-15 Thread Oded Gabbay
On Mon, Sep 14, 2020 at 7:50 PM Jakub Kicinski wrote: > > On Mon, 14 Sep 2020 13:48:14 + Omer Shpigelman wrote: > > On Thu, Sep 10, 2020 at 11:31 PM Jakub Kicinski wrote: > > > On Thu, 10 Sep 2020 23:17:59 +0300 Oded Gabbay wrote: > > > > > Doesn

Re: [PATCH v3 00/14] Adding GAUDI NIC code to habanalabs driver

2020-09-15 Thread Oded Gabbay
On Wed, Sep 16, 2020 at 1:34 AM David Miller wrote: > > From: Oded Gabbay > Date: Wed, 16 Sep 2020 00:20:12 +0300 > > > I completely understand but you didn't answer my question. How come > > there are drivers which create netdev objects, and specifically sgi-xp >

Re: [PATCH v3 00/14] Adding GAUDI NIC code to habanalabs driver

2020-09-16 Thread Oded Gabbay
On Wed, Sep 16, 2020 at 9:25 AM Greg Kroah-Hartman wrote: > > On Tue, Sep 15, 2020 at 11:49:12PM +0300, Oded Gabbay wrote: > > On Tue, Sep 15, 2020 at 11:42 PM David Miller wrote: > > > > > > From: Oded Gabbay > > > Date: Tue, 15 Sep 2020 20:10:08 +0300 &

Re: [PATCH v3 00/14] Adding GAUDI NIC code to habanalabs driver

2020-09-16 Thread Oded Gabbay
On Wed, Sep 16, 2020 at 10:41 AM Greg Kroah-Hartman wrote: > > On Wed, Sep 16, 2020 at 09:36:23AM +0300, Oded Gabbay wrote: > > On Wed, Sep 16, 2020 at 9:25 AM Greg Kroah-Hartman > > wrote: > > > > > > On Tue, Sep 15, 2020 at 11:49:12PM +0300, Oded Gabbay

Re: [PATCH v3 00/14] Adding GAUDI NIC code to habanalabs driver

2020-09-16 Thread Oded Gabbay
On Wed, Sep 16, 2020 at 11:21 AM Greg Kroah-Hartman wrote: > > On Wed, Sep 16, 2020 at 11:02:39AM +0300, Oded Gabbay wrote: > > On Wed, Sep 16, 2020 at 10:41 AM Greg Kroah-Hartman > > wrote: > > > > > > On Wed, Sep 16, 2020 at 09:36:23AM +0300, Oded Gabbay

Re: [PATCH] habanalabs: fix kernel pointer type

2020-10-27 Thread Oded Gabbay
On Tue, Oct 27, 2020 at 9:56 AM Christoph Hellwig wrote: > > Looks sensible. Btw, I've wondered for a while if we need a gen_pool > variant that works on kernel pointers. > > Acked-by: Christoph Hellwig Looks good. I'll give it a spin in our C/I just to make sure. Assuming nothing bad happens,

[PATCH] habanalabs/gaudi: retry loading TPC f/w on -EINTR

2020-12-10 Thread Oded Gabbay
If loading the firmware file for the TPC f/w was interrupted, try to do it again, up to 5 times. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/gaudi/gaudi.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers

[PATCH] habanalabs: adjust pci controller init to new firmware

2020-12-10 Thread Oded Gabbay
was never actually needed. Moreover, PCIE_DBI registers are blocked to access from host when firmware security is enabled. Use a different register to flush the writes. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/pci.c | 28 +++ drivers/misc/habanalabs

[PATCH] habanalabs: add validation cs counter, fix misplaced counters

2020-12-10 Thread Oded Gabbay
to be updated as well. Signed-off-by: Alon Mizrahi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../habanalabs/common/command_submission.c| 75 ++- drivers/misc/habanalabs/common/habanalabs.h | 2 + .../misc/habanalabs/common/habanalabs_ioctl.c | 5 ++ include/uapi

Re: [PATCH v7 04/17] misc/habana: Use FOLL_LONGTERM for userptr

2020-12-22 Thread Oded Gabbay
On Fri, Nov 27, 2020 at 6:42 PM Daniel Vetter wrote: > > These are persistent, not just for the duration of a dma operation. > > Reviewed-by: Oded Gabbay > Signed-off-by: Daniel Vetter > Cc: Jason Gunthorpe > Cc: Andrew Morton > Cc: John Hubbard > Cc: Jérôme Glisse

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] habanalabs: register to pci shutdown callback

2020-12-14 Thread Oded Gabbay
We need to make sure our device is idle when rebooting a virtual machine. This is done in the driver level. The firmware will later handle FLR but we want to be extra safe and stop the devices until the FLR is handled. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common

[PATCH] habanalabs: fix order of status check

2020-12-29 Thread Oded Gabbay
When the device is in reset or needs to be reset, the disabled property is don't-care. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/device.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/misc/habanalabs/common/device.c b/drivers/misc

[PATCH] habanalabs: register to pci shutdown callback

2020-12-29 Thread Oded Gabbay
We need to make sure our device is idle when rebooting a virtual machine. This is done in the driver level. The firmware will later handle FLR but we want to be extra safe and stop the devices until the FLR is handled. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common

[PATCH] habanalabs/gaudi: retry loading TPC f/w on -EINTR

2020-12-29 Thread Oded Gabbay
If loading the firmware file for the TPC f/w was interrupted, try to do it again, up to 5 times. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/gaudi/gaudi.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers

Re: [PATCH] habanalabs: Fix memleak in hl_device_reset

2020-12-29 Thread Oded Gabbay
_ctx); > hdev->kernel_ctx = NULL; > + hl_mmu_fini(hdev); > goto out_err; > } > } > -- > 2.17.1 > Thanks! This patch is: Reviewed-by: Oded Gabbay Applied to -fixes Oded

[PATCH 1/8] habanalabs: replace WARN/WARN_ON with dev_crit in driver

2020-12-29 Thread Oded Gabbay
From: Alon Mizrahi Often WARN is defined in data-centers as BUG and we would like to avoid hanging the entire server on some internal error of the driver (important as it might be). Therefore, use dev_crit instead. Signed-off-by: Alon Mizrahi Reviewed-by: Oded Gabbay Signed-off-by: Oded

[PATCH 5/8] habanalabs: add ASIC property of functional HBMs

2020-12-29 Thread Oded Gabbay
The number of functional HBMs in the same ASIC can be different due to malfunctioning HBM banks. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/habanalabs.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/misc/habanalabs/common/habanalabs.h b/drivers/misc

[PATCH 3/8] habanalabs: modify memory functions signatures

2020-12-29 Thread Oded Gabbay
From: Omer Shpigelman For consistency, modify all memory ioctl functions to get the ioctl arguments structure rather than the arguments themselves. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/memory.c | 22

[PATCH 8/8] habanalabs/gaudi: set uninitialized symbol

2020-12-29 Thread Oded Gabbay
From: Ofir Bitton Initialize local variable that is returned by the function, in case it is never assigned. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/gaudi/gaudi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH 6/8] habanalabs: update to latest hl_boot_if.h

2020-12-29 Thread Oded Gabbay
Update the latest version of this file that the F/W exports Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/include/common/hl_boot_if.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/misc/habanalabs/include/common/hl_boot_if.h b/drivers/misc

[PATCH 7/8] habanalabs: return dram virtual address in info ioctl

2020-12-29 Thread Oded Gabbay
-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/habanalabs_ioctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/misc/habanalabs/common/habanalabs_ioctl.c b/drivers/misc/habanalabs/common/habanalabs_ioctl.c index ed325de04e35

[PATCH 4/8] habanalabs/gaudi: add debug prints for security status

2020-12-29 Thread Oded Gabbay
From: Ofir Bitton In order to have more information while debugging boot issues, we should print the firmware security status at every boot stage. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/firmware_if.c | 11

[PATCH 2/8] habanalabs: kernel doc format in memory functions

2020-12-29 Thread Oded Gabbay
From: Omer Shpigelman Change all memory functions documentation according to kernel doc format. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/memory.c | 377 +++- 1 file changed, 180 insertions

[PATCH 1/2] habanalabs: remove access to kernel memory using debugfs

2020-12-30 Thread Oded Gabbay
From: Ofir Bitton Accessing kernel allocated memory through debugfs should not be allowed as it introduces a security vulnerability. We remove the option to read/write kernel memory for all asics. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers

[PATCH 2/2] habanalabs: support non power-of-2 DRAM phys page sizes

2020-12-30 Thread Oded Gabbay
-power-of-2 pages. To support this feature we also need to add infrastructure of address scarmbling. Signed-off-by: Moti Haimovski Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/debugfs.c| 6 +- drivers/misc/habanalabs/common/habanalabs.h | 8

[git pull] habanalabs fixes for 5.11-rc2

2020-12-30 Thread Oded Gabbay
habanalabs: add validation cs counter, fix misplaced counters Dinghao Liu (1): habanalabs: Fix memleak in hl_device_reset Oded Gabbay (7): habanalabs/gaudi: disable CGM at HW initialization habanalabs/gaudi: enhance reset message habanalabs: update comment

[git pull] habanalabs fixes for 5.11-rc2

2020-12-30 Thread Oded Gabbay
habanalabs: add validation cs counter, fix misplaced counters Dinghao Liu (1): habanalabs: Fix memleak in hl_device_reset Oded Gabbay (7): habanalabs/gaudi: disable CGM at HW initialization habanalabs/gaudi: enhance reset message habanalabs: update comment

[PATCH 1/2] habanalabs: report correct dram size in info ioctl

2021-01-01 Thread Oded Gabbay
to be rounded-down. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/habanalabs_ioctl.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/misc/habanalabs/common/habanalabs_ioctl.c b/drivers/misc/habanalabs

[PATCH 2/2] habanalabs: read device boot errors after cpucp is up

2021-01-01 Thread Oded Gabbay
From: Ofir Bitton Boot cpu can report errors in various boot stages. Current implementaion does not take into consideration errors reported in late stages, hence we will check for errors at the most late stage when fetching cpucp information. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay

[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

[PATCH 4/4] habanalabs/gaudi: remove PCI access to SM block

2021-01-03 Thread Oded Gabbay
a pending command buffer list which will be sent upon user submissions. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/gaudi/gaudi.c | 246 -- drivers/misc/habanalabs/gaudi/gaudiP.h| 2 + .../habanalabs

[PATCH 1/4] habanalabs: separate common code to dedicated folders

2021-01-03 Thread Oded Gabbay
From: Ofir Bitton We separate some of the common code source files to different folders for a better maintainability and testability. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/Makefile | 10 -- drivers

[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] habanalabs/gaudi: fetch HBM ecc info from FW

2020-11-11 Thread Oded Gabbay
From: Ofir Bitton Once FW security is enabled there is no access to HBM ecc registers, need to read values from FW using a dedicated interface. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/gaudi/gaudi.c | 47

[PATCH] habanalabs: print message with correct device

2020-11-11 Thread Oded Gabbay
During hard-reset, the driver rejects further IOCTL calls and prints an error message. That error message should be printed with the correct device instead of using only the control device. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/habanalabs_ioctl.c | 2 +- 1 file changed

[PATCH] habanalabs: fetch hard reset capability from FW

2020-11-11 Thread Oded Gabbay
From: Ofir Bitton Driver must fetch FW hard reset capability during boot time, in order to skip the hard reset flow if necessary. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/firmware_if.c | 10 ++- drivers/misc

[PATCH] habanalabs: support reserving aligned va block

2020-11-14 Thread Oded Gabbay
From: Ofir Bitton Add support for reserving va block with alignment different than page size. This is a pre-requisite for allocations needed in future ASICs Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/habanalabs.h | 4

[PATCH] habanalabs: fix MMU debugfs operations

2020-11-14 Thread Oded Gabbay
Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/debugfs.c| 282 ++-- drivers/misc/habanalabs/common/habanalabs.h | 35 +++ drivers/misc/habanalabs/common/mmu.c| 50 drivers/misc/habanalabs/common/mmu_v1.c | 102 +++ 4 files changed, 206

[PATCH] habanalabs: add boot errors prints

2020-11-14 Thread Oded Gabbay
From: Guy Nisan Add log prints for security and eFuse boot error bits Signed-off-by: Guy Nisan Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/firmware_if.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/misc/habanalabs/common

[PATCH] habanalabs: share a single ctx-mutex between all MMUs

2020-11-14 Thread Oded Gabbay
-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/mmu.c| 4 drivers/misc/habanalabs/common/mmu_v1.c | 4 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/misc/habanalabs/common/mmu.c b/drivers/misc/habanalabs/common/mmu.c index

[PATCH] habanalabs: firmware returns 64bit argument

2020-11-14 Thread Oded Gabbay
From: Alon Mizrahi F/W message returns 64bit value but up until now we casted it to a 32bit variable, instead of receiving 64bit in the first place. Signed-off-by: Alon Mizrahi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/debugfs.c | 5

[PATCH] habanalabs/gaudi: align to new FW reset scheme

2020-11-15 Thread Oded Gabbay
From: Ofir Bitton As part of the security effort in which FW will be handling sensitive HW registers, hard reset flow will be done by FW and will be triggered by driver. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/gaudi/gaudi.c

[PATCH] habanalabs: update firmware files

2020-11-20 Thread Oded Gabbay
Update various firmware header files with new defines. Signed-off-by: Oded Gabbay --- .../misc/habanalabs/include/common/hl_boot_if.h | 17 + .../misc/habanalabs/include/gaudi/gaudi_fw_if.h | 3 ++- .../misc/habanalabs/include/goya/goya_fw_if.h | 3 ++- 3 files changed, 21

Re: [PATCH v6 04/17] misc/habana: Use FOLL_LONGTERM for userptr

2020-11-21 Thread Oded Gabbay
Cc: Dan Williams > Cc: linux...@kvack.org > Cc: linux-arm-ker...@lists.infradead.org > Cc: linux-samsung-...@vger.kernel.org > Cc: linux-me...@vger.kernel.org > Cc: Oded Gabbay > Cc: Omer Shpigelman > Cc: Ofir Bitton > Cc: Tomer Tayar > Cc: Moti Haimovski > Cc: Da

Re: [PATCH 060/141] habanalabs: Fix fall-through warnings for Clang

2020-11-21 Thread Oded Gabbay
On Fri, Nov 20, 2020 at 8:33 PM Gustavo A. R. Silva wrote: > > In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning > by explicitly adding a fallthrough pseudo-keyword instead of letting the > code fall through to the next case. > > Link:

[PATCH] habanalabs/gaudi: fix missing code in ECC handling

2020-11-21 Thread Oded Gabbay
There is missing statement and missing "break;" in the ECC handling code in gaudi.c This will cause a wrong behavior upon certain ECC interrupts. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/gaudi/gaudi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/misc/

Re: [PATCH v6 03/17] misc/habana: Stop using frame_vector helpers

2020-11-21 Thread Oded Gabbay
aniel Vetter > Cc: Christoph Hellwig > Cc: Jason Gunthorpe > Cc: Andrew Morton > Cc: John Hubbard > Cc: Jérôme Glisse > Cc: Jan Kara > Cc: Dan Williams > Cc: linux...@kvack.org > Cc: linux-arm-ker...@lists.infradead.org > Cc: linux-samsung-...@vger.kernel.org &

[PATCH] habanalabs: fetch pll frequency from firmware

2020-11-18 Thread Oded Gabbay
From: Alon Mizrahi Once firmware security is enabled, driver must fetch pll frequencies through the firmware message interface instead of reading the registers directly. Signed-off-by: Alon Mizrahi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common

[PATCH] habanalabs: mmu map wrapper for sizes larger than a page

2020-11-18 Thread Oded Gabbay
and will be used for mappings that are done to the driver ASID. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../misc/habanalabs/common/command_buffer.c | 10 +- drivers/misc/habanalabs/common/habanalabs.h | 7 +- drivers/misc/habanalabs/common/memory.c

[PATCH] habanalabs: print CS type when it is stuck

2020-11-18 Thread Oded Gabbay
We have several types of command submissions and the user wants to know which type of command submission has not finished in time when that event occurs. This is very helpful for debug. Signed-off-by: Oded Gabbay --- .../habanalabs/common/command_submission.c| 28 +-- 1 file

Re: [PATCH v3 01/10] Add auxiliary bus support

2020-11-09 Thread Oded Gabbay
On Fri, Nov 06, 2020 at 07:35:37PM +, Mark Brown wrote: > On Thu, Nov 05, 2020 at 08:37:14PM +, Parav Pandit wrote: > > > > > This example describes the mlx5 PCI subfunction use case. > > > > I didn't follow your question about 'explicit example'. > > > > What part is missing to identify

[PATCH] habanalabs: put devices before driver removal

2020-11-30 Thread Oded Gabbay
From: Ofir Bitton Driver never puts its device and control_device objects, hence a memory leak is introduced every driver removal. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/device.c | 16 1 file changed

[git pull] habanalabs fixes for 5.10-rc7

2020-11-30 Thread Oded Gabbay
Hello Greg, This pull request contains two memory leak bug fixes for 5.10-rc7. Details are in the tag. Thanks, Oded The following changes since commit f0992098cadb4c9c6a00703b66cafe604e178fea: speakup: Reject setting the speakup line discipline outside of speakup (2020-11-30 09:20:32 +0100)

[git pull] habanalabs pull request for kernel 5.11-rc1

2020-11-30 Thread Oded Gabbay
MMU print message habanalabs: refactor MMU to support dual residency MMU habanalabs: share a single ctx-mutex between all MMUs habanalabs: fix MMU debugfs operations Oded Gabbay (25): MAINTAINERS: update email, git repo of habanalabs driver habanalabs: change aggregate

[git pull] habanalabs fixes for 5.10-rc6

2020-11-23 Thread Oded Gabbay
will be erroneous. Oded Gabbay (1): habanalabs/gaudi: fix missing code in ECC handling drivers/misc/habanalabs/gaudi/gaudi.c | 2 ++ 1 file changed, 2 insertions(+)

[PATCH] habanalabs/gaudi: print ECC type field

2020-11-23 Thread Oded Gabbay
We have the ECC type field from the firmware but the driver didn't print it, so we need to add that field to the ECC print message. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/gaudi/gaudi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc

[PATCH] habanalabs: Revise comment to align with mirror list name

2020-12-05 Thread Oded Gabbay
From: Tomer Tayar hw_queues_mirror was renamed to cs_mirror, so revise accordingly a comment that refers to this list. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/command_submission.c | 2 +- 1 file changed, 1 insertion

[PATCH] habanalabs/gaudi: do not set EB in collective slave queues

2020-12-05 Thread Oded Gabbay
From: Alon Mizrahi We don't need to set EB on signal packets from collective slave queues as it degrades performance. Because the slaves are the network queues, the engine barrier doesn't actually guarantee that the packet has been sent. Signed-off-by: Alon Mizrahi Reviewed-by: Oded Gabbay

[PATCH] habanalabs/gaudi: remove duplicated gaudi packets masks

2020-12-06 Thread Oded Gabbay
From: Ofir Bitton As all packets use the same CTL register masks, we remove duplicated masks and use common masks instead. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/gaudi/gaudi.c | 32

[PATCH] habanalabs: Init the VM module for kernel context

2020-12-06 Thread Oded Gabbay
From: Ofir Bitton In order for reserving VA ranges for kernel memory, we need to allow the VM module to be initiated with kernel context. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/context.c | 16

[PATCH 1/2] habanalabs/gaudi: support CS with no completion

2020-12-06 Thread Oded Gabbay
From: Ofir Bitton As part of the staged submission feature, we need Gaudi to support command submissions that will never get a completion. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/command_submission.c | 1 + drivers

[PATCH] habanalabs: update firmware boot interface

2020-12-06 Thread Oded Gabbay
Update to latest firmware hl_boot_if.h file. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/include/common/hl_boot_if.h | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/misc/habanalabs/include/common/hl_boot_if.h b/drivers/misc/habanalabs/include/common/hl_boot_if.h

[PATCH] habanalabs: refactor MMU locks code

2020-12-06 Thread Oded Gabbay
From: Ohad Sharabi remove mmu_cache_lock as it protects a section which is already protected by mmu_lock. in addition, wrap mmu cache invalidate calls in hl_vm_ctx_fini with mmu_lock. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc

[PATCH 2/2] habanalabs: allow user to pass a staged submission seq

2020-12-06 Thread Oded Gabbay
From: Ofir Bitton In order to support the staged submission feature, user must be allowed to use the same CS sequence for all submissions in the same staged submission. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../habanalabs/common

[PATCH] habanalabs: Fix a missing-braces warning

2020-12-02 Thread Oded Gabbay
From: Tomer Tayar Fix a compilation "missing braces around initializer" warning. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/habanalabs_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] habanalabs: preboot hard reset support

2020-12-03 Thread Oded Gabbay
to send in order to initiate a hard reset. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/firmware_if.c | 25 ++- drivers/misc/habanalabs/gaudi/gaudi.c | 17 +++-- drivers/misc/habanalabs/goya

[PATCH 1/3] habanalabs: add comment for pll frequency ioctl opcode

2020-12-03 Thread Oded Gabbay
From: Alon Mizrahi Forgot to add the comment for the opcode when it was added. Signed-off-by: Alon Mizrahi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- include/uapi/misc/habanalabs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/misc/habanalabs.h b/include/uapi

[PATCH 2/3] habanalabs: fetch PSOC PLL frequency from F/W in goya

2020-12-03 Thread Oded Gabbay
From: Alon Mizrahi When the F/W security is enabled, goya needs to fetch the PSOC pll frequency through a dedicated interface Signed-off-by: Alon Mizrahi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/goya/goya.c | 61 ++--- 1 file

[PATCH 3/3] habanalabs: remove generic gaudi get_pll_freq function

2020-12-03 Thread Oded Gabbay
From: Alon Mizrahi As we only fetch the CPU_PLL frequency in gaudi, we don't need a generic get_pll_frequency function which takes a pll index as input Signed-off-by: Alon Mizrahi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../misc/habanalabs/common/habanalabs_ioctl.c | 2

[PATCH] habanalabs/gaudi: handle reset when f/w is in preboot

2020-11-27 Thread Oded Gabbay
. In that situation, don't reset the card. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/gaudi/gaudi.c | 60 ++- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers/misc/habanalabs/gaudi/gaudi.c index cd18456fa523

[PATCH] habanalabs: free host huge va_range if not used

2020-11-28 Thread Oded Gabbay
From: Ofir Bitton If huge range is not valid, driver uses the host range also for huge page allocations, but driver never frees its allocation. This introduces a memory leak every time a user closes its context. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay

[PATCH] habanalabs: Add CB IOCTL opcode to retrieve CB information

2020-11-28 Thread Oded Gabbay
From: Tomer Tayar Add a new CB IOCTL opcode that enables a user to query about a CB and get its usage count. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../misc/habanalabs/common/command_buffer.c | 38 +++ include/uapi/misc

[PATCH] habanalabs: Modify the cs_cnt of a CB to be atomic

2020-11-28 Thread Oded Gabbay
From: Tomer Tayar Modify the CS counter of a CB to be atomic, so no locking is required when it is being modified or read. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- .../habanalabs/common/command_submission.c| 29 +-- drivers/misc

[PATCH] habanalabs: change messages to debug level

2020-11-28 Thread Oded Gabbay
Some messages should be changed to debug mode as we want to keep minimal prints during normal operation of the device. Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/firmware_if.c | 4 ++-- drivers/misc/habanalabs/gaudi/gaudi.c| 2 +- 2 files changed, 3 insertions(+), 3

<    3   4   5   6   7   8   9   10   11   12   >