From: Oded Gabbay Date: Mon, 18 Jan 2021 11:19:51 +0000 (+0200) Subject: habanalabs: fix backward compatibility of idle check X-Git-Tag: accepted/tizen/unified/20230118.172025~8019^2~1^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f8abaf379bfe19600f96ae79a6759eb37039ae05;p=platform%2Fkernel%2Flinux-rpi.git habanalabs: fix backward compatibility of idle check 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 --- diff --git a/drivers/misc/habanalabs/common/habanalabs_ioctl.c b/drivers/misc/habanalabs/common/habanalabs_ioctl.c index 12efbd9..d25892d 100644 --- a/drivers/misc/habanalabs/common/habanalabs_ioctl.c +++ b/drivers/misc/habanalabs/common/habanalabs_ioctl.c @@ -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;