Skip to content

Commit

Permalink
habanalabs: fix backward compatibility of idle check
Browse files Browse the repository at this point in the history
Need to take the lower 32 bits of the driver's 64-bit idle mask and put
it in the legacy 32-bit variable that the userspace reads to know the
idle mask.

Signed-off-by: Oded Gabbay <[email protected]>
  • Loading branch information
ogabbay committed Jan 21, 2021
1 parent 9354f1b commit f8abaf3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/misc/habanalabs/common/habanalabs_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ static int hw_idle(struct hl_device *hdev, struct hl_info_args *args)

hw_idle.is_idle = hdev->asic_funcs->is_device_idle(hdev,
&hw_idle.busy_engines_mask_ext, NULL);
hw_idle.busy_engines_mask =
lower_32_bits(hw_idle.busy_engines_mask_ext);

return copy_to_user(out, &hw_idle,
min((size_t) max_size, sizeof(hw_idle))) ? -EFAULT : 0;
Expand Down

0 comments on commit f8abaf3

Please sign in to comment.