1. 09 5月, 2019 2 次提交
  2. 08 5月, 2019 1 次提交
  3. 05 5月, 2019 1 次提交
  4. 25 5月, 2019 1 次提交
    • O
      habanalabs: halt debug engines on user process close · 89225ce4
      Omer Shpigelman 提交于
      This patch fix a potential bug where a user's process has closed
      unexpectedly without disabling the debug engines. In that case, the debug
      engines might continue running but because the user's MMU mappings are
      going away, we will get page fault errors.
      
      This behavior is also opposed to the general rule where nothing runs on
      the device after the user process closes.
      
      The patch stops the debug H/W engines upon process termination and thus
      makes sure nothing runs on the device after the process goes away.
      Signed-off-by: NOmer Shpigelman <oshpigelman@habana.ai>
      Signed-off-by: NOded Gabbay <oded.gabbay@gmail.com>
      89225ce4
  5. 02 5月, 2019 2 次提交
  6. 01 5月, 2019 4 次提交
  7. 30 4月, 2019 1 次提交
  8. 28 4月, 2019 1 次提交
    • O
      habanalabs: return old dram bar address upon change · a38693d7
      Oded Gabbay 提交于
      This patch changes the ASIC interface function that changes the DRAM bar
      window. The change is to return the old address that the DRAM bar pointed
      to instead of an error code.
      
      This simplifies the code that use this function (mainly in debugfs) to
      restore the bar to the old setting.
      
      This is also needed for easier support in future ASICs.
      Signed-off-by: NOded Gabbay <oded.gabbay@gmail.com>
      a38693d7
  9. 22 4月, 2019 1 次提交
    • O
      habanalabs: use ASIC functions interface for rreg/wreg · b2377e03
      Oded Gabbay 提交于
      This patch slightly changes the macros of RREG32 and WREG32, which are
      used when reading or writing from registers.
      
      Instead of directly calling a function in the common code from these
      macros, the new code calls a function from the ASIC functions interface.
      
      This change allows us to share much more code between real ASICs and
      simulators, which in turn reduces the maintenance burden and
      the chances for forgetting to port code between the ASIC files.
      
      The patch also implements the hl_poll_timeout macro, instead of calling
      the generic readl_poll_timeout macro. This is required to allow use of
      this macro in the simulator files.
      
      As a result from this change, more functions in goya.c are shared with the
      simulator and therefore, should not be defined as static.
      Signed-off-by: NOded Gabbay <oded.gabbay@gmail.com>
      b2377e03
  10. 21 4月, 2019 1 次提交
  11. 06 4月, 2019 1 次提交
    • O
      habanalabs: prevent device PTE read/write during hard-reset · 9f201aba
      Oded Gabbay 提交于
      During hard-reset, contexts are closed as part of the tear-down process.
      After a context is closed, the driver cleans up the page tables of that
      context in the device's DRAM. This action is both dangerous and
      unnecessary.
      
      It is unnecessary, because the device is going through a hard-reset, which
      means the device's DRAM contents are no longer valid and the device's MMU
      is being reset.
      
      It is dangerous, because if the hard-reset came as a result of a PCI
      freeze, this action may cause the entire host machine to hang.
      
      Therefore, prevent all device PTE updates when a hard-reset operation is
      pending.
      Signed-off-by: NOded Gabbay <oded.gabbay@gmail.com>
      9f201aba
  12. 02 4月, 2019 3 次提交
    • O
      habanalabs: refactoring in goya.c · bedd1442
      Oded Gabbay 提交于
      This patch does some refactoring in goya.c to make code more reusable
      between goya code and the goya simulator code (which is not upstreamed).
      
      In addition, the patch removes some dead functions from goya.c which are
      not used by the current upstream code
      Signed-off-by: NOded Gabbay <oded.gabbay@gmail.com>
      bedd1442
    • O
      habanalabs: add goya implementation for debug configuration · 8ba2876d
      Omer Shpigelman 提交于
      This patch adds the ASIC-specific function for GOYA to configure the
      coresight components.
      
      Most of the components have an enabled/disabled flag, depending on whether
      the user wants to enable the component or disable it.
      
      For some of the components, such as ETR and SPMU, the user can also
      request to read values from them. Those values are needed for the user to
      parse the trace data.
      
      The ETR configuration is also checked for security purposes, to make sure
      the trace data is written to the device's DRAM.
      Signed-off-by: NOmer Shpigelman <oshpigelman@habana.ai>
      Signed-off-by: NOded Gabbay <oded.gabbay@gmail.com>
      8ba2876d
    • O
      habanalabs: add new IOCTL for debug, tracing and profiling · 315bc055
      Omer Shpigelman 提交于
      Habanalabs ASICs use the ARM coresight infrastructure to support debug,
      tracing and profiling of neural networks topologies.
      
      Because the coresight is configured using register writes and reads, and
      some of the registers hold sensitive information (e.g. the address in
      the device's DRAM where the trace data is written to), the user must go
      through the kernel driver to configure this mechanism.
      
      This patch implements the common code of the IOCTL and calls the
      ASIC-specific function for the actual H/W configuration.
      
      The IOCTL supports configuration of seven coresight components:
      ETR, ETF, STM, FUNNEL, BMON, SPMU and TIMESTAMP
      
      The user specifies which component he wishes to configure and provides a
      pointer to a structure (located in its process space) that contains the
      relevant configuration.
      
      The common code copies the relevant data from the user-space to kernel
      space and then calls the ASIC-specific function to do the H/W
      configuration.
      
      After the configuration is done, which is usually composed
      of several IOCTL calls depending on what the user wanted to trace, the
      user can start executing the topology. The trace data will be written to
      the user's area in the device's DRAM.
      
      After the tracing operation is complete, and user will call the IOCTL
      again to disable the tracing operation. The user also need to read
      values from registers for some of the components (e.g. the size of the
      trace data in the device's DRAM). In that case, the user will provide a
      pointer to an "output" structure in user-space, which the IOCTL code will
      fill according the to selected component.
      Signed-off-by: NOmer Shpigelman <oshpigelman@habana.ai>
      Signed-off-by: NOded Gabbay <oded.gabbay@gmail.com>
      315bc055
  13. 25 3月, 2019 1 次提交
  14. 20 3月, 2019 1 次提交
  15. 08 3月, 2019 1 次提交
    • O
      habanalabs: keep track of the device's dma mask · d9973871
      Oded Gabbay 提交于
      This patch refactors the code that is responsible to set the DMA mask for
      the device.
      
      Upon each change of the dma mask, the driver will save the new value that
      was set. This is needed in order to make sure we don't try to increase the
      mask a second time, in case we failed in the first time. This is
      especially relevant for Power machines, as that may cause a change in
      configuration of the TVT which will break the device.
      
      Goya will first try to set the device's dma mask to 39 bits, so that the
      memory that is allocated on the host machine for communication with the
      device's cpu will be in a bus address which is lower then 39 bits. Later,
      Goya will try to increase that mask to 48 bits, but only if setting the
      mask to 39 bits was successful.
      Signed-off-by: NOded Gabbay <oded.gabbay@gmail.com>
      d9973871
  16. 03 3月, 2019 1 次提交
    • O
      habanalabs: cast to expected type · 7c22278e
      Oded Gabbay 提交于
      This patch fix the following sparse warning:
      
      drivers/misc/habanalabs/goya/goya.c:3646:14: warning: incorrect type in
      assignment (different address spaces)
      drivers/misc/habanalabs/goya/goya.c:3646:14:    expected void *base
      drivers/misc/habanalabs/goya/goya.c:3646:14:    got void [noderef] <asn:2> *
      Signed-off-by: NOded Gabbay <oded.gabbay@gmail.com>
      7c22278e
  17. 04 3月, 2019 1 次提交
    • O
      habanalabs: prevent host crash during suspend/resume · 7cb5101e
      Oded Gabbay 提交于
      This patch fixes the implementation of suspend/resume of the device so that
      upon resume of the device, the host won't crash due to PCI completion
      timeout.
      
      Upon suspend, the device is being reset due to PERST. Therefore, upon
      resume, the driver must initialize the PCI controller as if the driver was
      loaded. If the controller is not initialized and the device tries to
      access the device through the PCI bars, the host will crash with PCI
      completion timeout error.
      Signed-off-by: NOded Gabbay <oded.gabbay@gmail.com>
      7cb5101e
  18. 02 3月, 2019 1 次提交
  19. 28 2月, 2019 10 次提交
  20. 27 2月, 2019 1 次提交
    • O
      habanalabs: make functions static or declare them · 5e6e0239
      Oded Gabbay 提交于
      This patch fixes the below sparse warnings by either making the functions
      static or by adding a declaration in the relevant header file.
      
      In addition, the patch removes goya_mmap completely as it doesn't add any
      additional benefit.
      
      Fixes the following sparse warnings:
      
      drivers/misc/habanalabs/habanalabs_drv.c:24:1: warning: symbol 'hl_devs_idr' was not declared. Should it be static?
      drivers/misc/habanalabs/habanalabs_drv.c:25:1: warning: symbol 'hl_devs_idr_lock' was not declared. Should it be static?
      drivers/misc/habanalabs/memory.c:1451:5: warning: symbol 'hl_vm_ctx_init_with_ranges' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:396:5: warning: symbol 'goya_send_pci_access_msg' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:417:5: warning: symbol 'goya_pci_bars_map' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:557:6: warning: symbol 'goya_reset_link_through_bridge' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:774:5: warning: symbol 'goya_early_fini' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:857:6: warning: symbol 'goya_late_fini' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:971:5: warning: symbol 'goya_sw_fini' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:1233:5: warning: symbol 'goya_init_cpu_queues' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:2914:5: warning: symbol 'goya_suspend' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:2939:5: warning: symbol 'goya_resume' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:2952:5: warning: symbol 'goya_mmap' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:2957:5: warning: symbol 'goya_cb_mmap' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:2973:6: warning: symbol 'goya_ring_doorbell' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:3063:6: warning: symbol 'goya_flush_pq_write' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:3068:6: warning: symbol 'goya_dma_alloc_coherent' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:3074:6: warning: symbol 'goya_dma_free_coherent' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:3080:6: warning: symbol 'goya_get_int_queue_base' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:3138:5: warning: symbol 'goya_send_job_on_qman0' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:3295:5: warning: symbol 'goya_test_queue' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:3417:6: warning: symbol 'goya_dma_pool_zalloc' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:3426:6: warning: symbol 'goya_dma_pool_free' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:3432:6: warning: symbol 'goya_cpu_accessible_dma_pool_alloc' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:3448:6: warning: symbol 'goya_cpu_accessible_dma_pool_free' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:3458:5: warning: symbol 'goya_dma_map_sg' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:3467:6: warning: symbol 'goya_dma_unmap_sg' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:3473:5: warning: symbol 'goya_get_dma_desc_list_size' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:4210:5: warning: symbol 'goya_parse_cb_no_mmu' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:4261:5: warning: symbol 'goya_parse_cb_no_ext_quque' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:4294:5: warning: symbol 'goya_cs_parser' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:4307:6: warning: symbol 'goya_add_end_of_cb_packets' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:4334:5: warning: symbol 'goya_context_switch' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:4426:6: warning: symbol 'goya_restore_phase_topology' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:4460:5: warning: symbol 'goya_debugfs_read32' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:4510:5: warning: symbol 'goya_debugfs_write32' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:4738:6: warning: symbol 'goya_handle_eqe' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:4836:6: warning: symbol 'goya_get_events_stat' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:5075:5: warning: symbol 'goya_send_heartbeat' was not declared. Should it be static?
      drivers/misc/habanalabs/goya/goya.c:5253:5: warning: symbol 'goya_get_eeprom_data' was not declared. Should it be static?
      Reported-by: NYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: NOded Gabbay <oded.gabbay@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5e6e0239
  21. 26 2月, 2019 1 次提交
  22. 07 3月, 2019 1 次提交
  23. 06 3月, 2019 1 次提交
  24. 05 3月, 2019 1 次提交