Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] accel/habanalabs: missing Fixes trailer for hl_device_fini()
  reset work fix
--

commit e560ec133709db78ecf2c5f01a23a035c9ef7ca3
Author: Chengyu Liu <[email protected]>

> accel/habanalabs: disable pending-reset work in hl_device_fini()
>
> hl_device_fini() uses flush_delayed_work() to drain
> device_reset_work.reset_work, but a flush cannot stop the work from
> being armed again afterwards, so the reset work can still fire while -
> or after - the device is torn down.
>
> Simply switching the flush to disable_delayed_work_sync() is not
> enough: a reset retry sitting on its timer holds reset_info.in_reset,
> and only the work itself clears it (via out_err once
> device_fini_pending is set).  Killing the work without running it
> strands in_reset, and hl_device_fini() then waits for the full
> HL_HARD_RESET_MAX_TIMEOUT and returns without tearing the device
> down.
>
> So keep the flush first: with device_fini_pending set, a pending
> retry runs immediately and clears in_reset via out_err.  Then, after
> in_reset has been claimed for fini - so no new reset can be queued
> and the reset thread does not re-arm - disable the work to guarantee
> nothing is pending or running during the teardown.
>
> Found by static analysis.
>
> Signed-off-by: Chengyu Liu <[email protected]>

[Severity: Low]
This fixes the incomplete draining of device_reset_work.reset_work in
hl_device_fini().  Should this include:

  Fixes: adb51298fdc4 ("habanalabs: improve hard reset procedure")

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=1

Reply via email to