summaryrefslogtreecommitdiffstats
path: root/drivers/accel (follow)
Commit message (Collapse)AuthorAgeFilesLines
* accel/ivpu: Fix NOC firewall interrupt handlingAndrzej Kacprowski2024-10-304-1/+15
| | | | | | | | | | | | | | | | | The NOC firewall interrupt means that the HW prevented unauthorized access to a protected resource, so there is no need to trigger device reset in such case. To facilitate security testing add firewall_irq_counter debugfs file that tracks firewall interrupts. Fixes: 8a27ad81f7d3 ("accel/ivpu: Split IP and buttress code") Cc: stable@vger.kernel.org # v6.11+ Signed-off-by: Andrzej Kacprowski <Andrzej.Kacprowski@intel.com> Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com> Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241017144958.79327-1-jacek.lawrynowicz@linux.intel.com
* accel/qaic: Fix the for loop used to walk SG tablePranjal Ramajor Asha Kanojiya2024-10-122-4/+4
| | | | | | | | | | | | | | | Only for_each_sgtable_dma_sg() should be used to walk through a SG table to grab correct bus address and length pair after calling DMA MAP API on a SG table as DMA MAP APIs updates the SG table and for_each_sgtable_sg() walks through the original SG table. Fixes: ff13be830333 ("accel/qaic: Add datapath") Fixes: 129776ac2e38 ("accel/qaic: Add control path") Signed-off-by: Pranjal Ramajor Asha Kanojiya <quic_pkanojiy@quicinc.com> Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com> Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com> Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241004193252.3888544-1-quic_jhugo@quicinc.com
* Merge tag 'dma-mapping-6.12-2024-09-19' of ↵Linus Torvalds2024-09-191-3/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.infradead.org/users/hch/dma-mapping Pull dma-mapping updates from Christoph Hellwig: - support DMA zones for arm64 systems where memory starts at > 4GB (Baruch Siach, Catalin Marinas) - support direct calls into dma-iommu and thus obsolete dma_map_ops for many common configurations (Leon Romanovsky) - add DMA-API tracing (Sean Anderson) - remove the not very useful return value from various dma_set_* APIs (Christoph Hellwig) - misc cleanups and minor optimizations (Chen Y, Yosry Ahmed, Christoph Hellwig) * tag 'dma-mapping-6.12-2024-09-19' of git://git.infradead.org/users/hch/dma-mapping: dma-mapping: reflow dma_supported dma-mapping: reliably inform about DMA support for IOMMU dma-mapping: add tracing for dma-mapping API calls dma-mapping: use IOMMU DMA calls for common alloc/free page calls dma-direct: optimize page freeing when it is not addressable dma-mapping: clearly mark DMA ops as an architecture feature vdpa_sim: don't select DMA_OPS arm64: mm: keep low RAM dma zone dma-mapping: don't return errors from dma_set_max_seg_size dma-mapping: don't return errors from dma_set_seg_boundary dma-mapping: don't return errors from dma_set_min_align_mask scsi: check that busses support the DMA API before setting dma parameters arm64: mm: fix DMA zone when dma-ranges is missing dma-mapping: direct calls for dma-iommu dma-mapping: call ->unmap_page and ->unmap_sg unconditionally arm64: support DMA zone above 4GB dma-mapping: replace zone_dma_bits by zone_dma_limit dma-mapping: use bit masking to check VM_DMA_COHERENT
| * dma-mapping: don't return errors from dma_set_max_seg_sizeChristoph Hellwig2024-08-291-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | A NULL dev->dma_parms indicates either a bus that is not DMA capable or grave bug in the implementation of the bus code. There isn't much the driver can do in terms of error handling for either case, so just warn and continue as DMA operations will fail anyway. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Robin Murphy <robin.murphy@arm.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Acked-by: Ulf Hansson <ulf.hansson@linaro.org> # For MMC
* | accel: Use XArray instead of IDR for minorsMichał Winiarski2024-08-261-103/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Accel minor management is based on DRM (and is also using struct drm_minor internally), since DRM is using XArray for minors, it makes sense to also convert accel. As the two implementations are identical (only difference being the underlying xarray), move the accel_minor_* functionality to DRM. Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Acked-by: James Zhu <James.Zhu@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240823163048.2676257-3-michal.winiarski@intel.com Signed-off-by: Christian König <christian.koenig@amd.com>
* | Merge drm/drm-next into drm-misc-nextThomas Zimmermann2024-07-2922-472/+677
|\| | | | | | | | | | | Backmerging to get a late RC of v6.10 before moving into v6.11. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
| * Merge tag 'drm-habanalabs-next-2024-06-23' of ↵Dave Airlie2024-06-2822-472/+677
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/HabanaAI/drivers.accel.habanalabs.kernel into drm-next This tag contains habanalabs driver changes for v6.11. The notable changes are: - uAPI changes: - Use device-name directory in debugfs-driver-habanalabs. - Expose server type in debugfs. - New features and improvements: - Gradual sleep in polling memory macro. - Reduce Gaudi2 MSI-X interrupt count to 128. - Add Gaudi2-D revision support. - Firmware related changes: - Add timestamp to CPLD info. - Gaudi2: Assume hard-reset by firmware upon MC SEI severe error. - Align Gaudi2 interrupt names. - Check for errors after preboot is ready. - Bug fixes and code cleanups: - Move heartbeat work initialization to early init. - Fix a race when receiving events during reset. - Change the heartbeat scheduling point. - Maintainers: - Change habanalabs maintainer and git repo path. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Ofir Bitton <obitton@habana.ai> Link: https://patchwork.freedesktop.org/patch/msgid/ZnfIjTH5AYQvPe7n@obitton-vm-u22.habana-labs.com
| | * accel/habanalabs: gradual sleep in polling memory macroDidi Freiman2024-06-231-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It’s better to avoid long sleeps right from the beginning of the polling since the data may be available much sooner than the sleep period. Because polling host memory is inexpensive, this change gradually increases the sleep time up to the user-requested period. Signed-off-by: Didi Freiman <dfreiman@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs: move heartbeat work initialization to early initTomer Tayar2024-06-231-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The device heartbeat work is currently initialized at device_heartbeat_schedule() which is called at the end of hl_device_init(). However hl_device_init() can fail at a previous step, and in such a case, a subsequent call to hl_device_fini() will lead to calling cleanup_resources() and accessing this work uninitialized. As there is no real need to re-initialize this work every time it is rescheduled, move this initialization to device_early_init() to be done once and early enough. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs: print timestamp of last PQ heartbeat on EQ heartbeat failureTomer Tayar2024-06-233-12/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test packet which is sent to FW for the PQ heartbeat is used also as the trigger in FW to send the EQ heartbeat event. Add the time of the last sent packet to the debug info which is printed upon a EQ heartbeat failure. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs: dump the EQ entries headers on EQ heartbeat failureTomer Tayar2024-06-233-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | Add a dump of the EQ entries headers upon a EQ heartbeat failure. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs: revise print on EQ heartbeat failureTomer Tayar2024-06-231-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't print the "previous EQ index" value in case of a EQ heartbeat failure, because it is incremented along with the EQ CI and therefore redundant. In addition, as the CPU-CP PI is zeroed when it reaches a value that is twice the queue size, add a value of the CI with a similar wrap around, to make it easier to compare the values. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs: add more info upon cpu pkt timeoutFarah Kassabri2024-06-231-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | In order to have better debuggability upon encountering FW issues, We are adding additional info once CPU packet timeout expires. Signed-off-by: Farah Kassabri <fkassabri@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs: additional print in device-in-use infoIlia Levi2024-06-234-9/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When device release triggers a hard reset, there is a printout of the cause. Currently listed causes (that increment context refcount) are active command submissions and exported DMA buffer objects. In any other case, the printout emits "unknown reason". We identify and print another reason - allocated command buffers. Signed-off-by: Ilia Levi <illevi@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalbs/gaudi2: reduce interrupt count to 128Ofir Bitton2024-06-232-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | Some systems allow a maximum number of 128 MSI-X interrupts. Hence we reduce the interrupt count to 128 instead of 512. Reviewed-by: Tomer Tayar <ttayar@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs: disable EQ interrupt after disabling pciTal Cohen2024-06-231-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When sending disable pci msg towards firmware, there is a possibility that an EQ packet is already pending, disabling EQ interrupt will prevent this from happening. The interrupt will be re-enabled after reset. Signed-off-by: Tal Cohen <talcohen@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs: change the heartbeat scheduling pointFarah Kassabri2024-06-231-21/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we schedule the heartbeat thread at late init, only then we set the INTS_REGISTER packet which enables events to be received from firmware. Init may take some time and we want to give firmware 2 full cycles of heartbeat thread after it received INTS_REGISTER. The patch will move the heartbeat thread scheduling to be after driver is done with all initializations. Signed-off-by: Farah Kassabri <fkassabri@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs/gaudi2: unsecure edma max outstanding registerRakesh Ughreja2024-06-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Netowrk EDMAs uses more outstanding transfers so this needs to be programmed by EDMA firmware. Signed-off-by: Rakesh Ughreja <rughreja@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs: remove timestamp registration debug printsOfir Bitton2024-06-231-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | There are several timestamp registration debug prints which spams the kernel log whenever dyn debug is enabled. Remove those prints. Reviewed-by: Tomer Tayar <ttayar@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs: add cpld ts cpld_timestamp cpucpVitaly Margolin2024-06-231-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add cpld_timestamp field to cpucp_info structure and return cpld timestamp as part of cpld version Signed-off-by: Vitaly Margolin <vmargolin@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs: add a common handler for clock change eventsTomer Tayar2024-06-232-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | As the new dynamic EQ includes clock change events which are common and not ASIC-specific, add a common handler for these events. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs/gaudi2: add GAUDI2D revision supportFarah Kassabri2024-06-236-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | Gaudi2 with PCI revision ID with the value of '4' represents Gaudi2D device and should be detected and initialized as Gaudi2. Signed-off-by: Farah Kassabri <fkassabri@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs: move hl_eq_heartbeat_event_handle() to common codeTomer Tayar2024-06-233-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hl_eq_heartbeat_event_handle() doesn't have ASIC specific code, and therefore can be moved from Gaudi2-only code to common code, and possibly used for other ASICs. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs: add an EQ size ASIC propertyTomer Tayar2024-06-232-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Future supported ASICs might use the dynamic EQ mechanism with the firmware, and in that case the EQ size won't be equal to the default HL_EQ_SIZE_IN_BYTES value. Add an ASIC property to enable overriding this value. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs/gaudi2: assume hard-reset by FW upon MC SEI severe errorTomer Tayar2024-06-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FW initiates a hard reset upon an MC SEI severe error. Align the driver to expect this reset and avoid accessing the device until the reset is done. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs/gaudi2: revise return value handling in ↵Tomer Tayar2024-06-231-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gaudi2_hbm_sei_handle_read_err() The return value in gaudi2_hbm_sei_handle_read_err() is boolean and not a bitmask, so there is need for "|= true". In addition, rename the 'rc' variable, as no "return code" is returned here but an indication if a hard reset is required. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs/gaudi2: align interrupt names to tableAriel Suller2024-06-231-75/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | when reporting tpc events, the dcore and tpc in dcore should be reported and propagated, and not the generatl tpc number Signed-off-by: Ariel Suller <asuller@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs: check for errors after preboot is readyFarah Kassabri2024-06-231-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Driver should check and report any fatal errors detected by preboot, before it attempts to load the boot fit. Some errors may cause the driver to stop the boot process and mark the device as unusable. This check will allow the driver to fail and print the error reported by preboot and skip the time wasting attempt of trying to load the boot fit, which will fail due to the error. Signed-off-by: Farah Kassabri <fkassabri@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs: use msg_header instead of desc_headerIgal Zeltser2024-06-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Struct comms_desc_header is deprecated and replaced by struct comms_msg_header. As a preparation for removing comms_desc_header from FW, all it's usage in code is replaced by comms_msg_header. Signed-off-by: Igal Zeltser <izeltser@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs: add heartbeat debug infoFarah Kassabri2024-06-233-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is hard to debug the reason for heartbeat check failures. As an attempt to ease this task, this patch will provide more information when this failure happens. Heartbeat checks the communication with FW, so printing the CPU queue pi/ci and the counter of how many times that event was received would help in debugging the issue. Signed-off-by: Farah Kassabri <fkassabri@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs: add device name to invalidation failure msgOhad Sharabi2024-06-231-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | This addition helps log parsers better define the error without the need to go back and search the device name on former log lines. Signed-off-by: Ohad Sharabi <osharabi@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs: expose server type in debugfsTal Risin2024-06-231-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Exposing server type through debugfs to enable easier access via scripts. Signed-off-by: Tal Risin <trisin@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs: use parent device for trace eventsTomer Tayar2024-06-234-20/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trace events might still be recorded after the accel device is released, while the device name is no longer available. Modify the trace functions to use the parent device instead, which is available at that point and still informative as the device name. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs: no CPUCP prints on heartbeat failureOhad Sharabi2024-06-237-132/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we detected heartbet event while some daemon in the background send (via driver interface) CPUCP messages the dmesg will be flooded. Instead, a slight refactor in hl_fw_send_cpu_message() returns -EAGAIN when CPU is disabled (i.e. heartbeat failure) and only then. Later, all calling functions that may be invoked by user space can issue prints only if the error code is not -EAGAIN. Signed-off-by: Ohad Sharabi <osharabi@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs/gaudi2: align embedded specs headersOfir Bitton2024-06-232-20/+15
| | | | | | | | | | | | | | | | | | | | | Align embedded headers to latest release. Reviewed-by: Tomer Tayar <ttayar@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs: restructure function that checks heartbeat receivedOhad Sharabi2024-06-231-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function returned an error code which isn't propagated up the stack (nor is it printed). The return value is only checked for =0 or !=0 which implies bool return value. The function signature is updated accordingly, renamed, and slightly refactored. Signed-off-by: Ohad Sharabi <osharabi@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs/gaudi2: update interrupts related headersFarah Kassabri2024-06-231-47/+47
| | | | | | | | | | | | | | | | | | | | | | | | Align the interrupts related headers to latest release. Signed-off-by: Farah Kassabri <fkassabri@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs: add device name to error printDani Liberman2024-06-231-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | The extra info will help in better traceability and debug. Signed-off-by: Dani Liberman <dliberman@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
| | * accel/habanalabs/gaudi2: use single function to compare FW versionsOhad Sharabi2024-06-233-68/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the code contains 2 types of FW version comparison functions: - hl_is_fw_sw_ver_[below/equal_or_greater]() - gaudi2 specific function of the type gaudi2_is_fw_ver_[below/above]x_y_z() Moreover, some functions use the inner FW version which shuold be only stage during development but not version dependencies. Finally, some tests are done to deprecated FW version to which LKD should hold no compatibility. This commit aligns all APIs to a single function that just compares the version and return an integers indicator (similar in some way to strcmp()). In 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 <osharabi@habana.ai> Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Ofir Bitton <obitton@habana.ai>
* | | accel/ivpu: Add missing MODULE_FIRMWARE metadataAlexander F. Lent2024-07-151-0/+4
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modules that load firmware from various paths at runtime must declare those paths at compile time, via the MODULE_FIRMWARE macro, so that the firmware paths are included in the module's metadata. The accel/ivpu driver loads firmware but lacks this metadata, preventing dracut from correctly locating firmware files. Fix it. Fixes: 9ab43e95f922 ("accel/ivpu: Switch to generation based FW names") Fixes: 02d5b0aacd05 ("accel/ivpu: Implement firmware parsing and booting") Signed-off-by: Alexander F. Lent <lx@xanderlent.com> Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240709-fix-ivpu-firmware-metadata-v3-1-55f70bba055b@xanderlent.com
* | accel/ivpu: Remove unused ivpu_rpm_get_if_active()Jacek Lawrynowicz2024-06-142-11/+0
| | | | | | | | | | | | | | | | This is now dead code and has to be removed. Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Reviewed-by: Wachowski, Karol <karol.wachowski@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240611120433.1012423-16-jacek.lawrynowicz@linux.intel.com
* | accel/ivpu: Remove duplicated debug messagesJacek Lawrynowicz2024-06-141-14/+6
| | | | | | | | | | | | | | | | | | Remove duplicated debug messages from ivpu_jsm_(un)register_db(). Debug messages are already printed one level higher. Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Reviewed-by: Wachowski, Karol <karol.wachowski@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240611120433.1012423-15-jacek.lawrynowicz@linux.intel.com
* | accel/ivpu: Increase autosuspend delay to 100ms on 40xxAndrzej Kacprowski2024-06-141-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | The new HW is more power efficient and there is no need to enter the D0i3/D3 so quickly. Increasing autosuspend delay reduces latency in certain usage scenarios. Signed-off-by: Andrzej Kacprowski <Andrzej.Kacprowski@intel.com> Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240611120433.1012423-14-jacek.lawrynowicz@linux.intel.com
* | accel/ivpu: Synchronize device unbind with recovery workWachowski, Karol2024-06-141-2/+2
| | | | | | | | | | | | | | | | | | Do not allow unbinding device in the middle of recovery flow. Signed-off-by: Wachowski, Karol <karol.wachowski@intel.com> Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240611120433.1012423-13-jacek.lawrynowicz@linux.intel.com
* | accel/ivpu: Disable MMU before checking for idleJacek Lawrynowicz2024-06-141-0/+2
| | | | | | | | | | | | | | | | | | Disable MMU communication before checking if NPU is idle. NPU may otherwise be woken up when adding/removing contexts. Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Reviewed-by: Wachowski, Karol <karol.wachowski@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240611120433.1012423-12-jacek.lawrynowicz@linux.intel.com
* | accel/ivpu: Add test mode flag for disabling timeoutsMaciej Falkowski2024-06-142-5/+8
| | | | | | | | | | | | | | | | | | | | | | Add new test mode flag that will disable all timeouts defined in timeout fields of struct ivpu_device. Remove also reschedule_suspend field as it is unused. Signed-off-by: Maciej Falkowski <maciej.falkowski@linux.intel.com> Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240611120433.1012423-11-jacek.lawrynowicz@linux.intel.com
* | accel/ivpu: Make parts of FW image read-onlyWachowski, Karol2024-06-144-1/+120
| | | | | | | | | | | | | | | | | | | | | | | | Implement setting specified buffer ranges as read-only. In case if specified range is not 64K aligned and 64K contiguous MMU600 pages are turned on, split 64K mapping to allow 4K granularity for read-only configuration. Signed-off-by: Wachowski, Karol <karol.wachowski@intel.com> Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240611120433.1012423-10-jacek.lawrynowicz@linux.intel.com
* | accel/ivpu: Update FW BOOT API headersWachowski, Karol2024-06-141-2/+14
| | | | | | | | | | | | | | | | | | This commit bumps BOOT API version to 3.24 Signed-off-by: Wachowski, Karol <karol.wachowski@intel.com> Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240611120433.1012423-9-jacek.lawrynowicz@linux.intel.com
* | accel/ivpu: Make selected params read-onlyJacek Lawrynowicz2024-06-141-2/+2
| | | | | | | | | | | | | | | | | | Make disable_mmu_cont_pages and force_snoop params read-only. It is unsafe to change these params after driver is loaded. Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Reviewed-by: Wachowski, Karol <karol.wachowski@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240611120433.1012423-8-jacek.lawrynowicz@linux.intel.com
* | accel/ivpu: Implement DCT handlingJacek Lawrynowicz2024-06-1410-20/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When host system is under heavy load and the NPU is already running on the lowest frequency, PUNIT may request Duty Cycle Throttling (DCT). This will further reduce NPU power usage. PUNIT requests DCT mode using Survabilty IRQ and mailbox register. The driver then issues a JSM message to the FW that enables the DCT mode. If the NPU resets while in DCT mode, the driver request DCT mode during FW boot. Also add debugfs "dct" file that allows to set arbitrary DCT percentage, which is used by driver tests. Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Reviewed-by: Wachowski, Karol <karol.wachowski@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240611120433.1012423-7-jacek.lawrynowicz@linux.intel.com