Re: [PATCH] habanalabs/gaudi2: added memset for the cq_size register

From: Oded Gabbay
Date: Wed Nov 23 2022 - 09:33:23 EST


On Wed, Nov 23, 2022 at 10:59 AM Marco Pagani <marpagan@xxxxxxxxxx> wrote:
>
> The clang-analyzer reported a warning: "Value stored to
> 'cq_size_addr' is never read".
>
> The cq_size register of dcore0 is not being zeroed using
> gaudi2_memset_device_lbw(), along with the other cq_* registers,
> even though the corresponding cq_size_addr variable is set.
>
> Signed-off-by: Marco Pagani <marpagan@xxxxxxxxxx>
> ---
> drivers/misc/habanalabs/gaudi2/gaudi2.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/misc/habanalabs/gaudi2/gaudi2.c b/drivers/misc/habanalabs/gaudi2/gaudi2.c
> index 65e6cae6100a..05f30adefb32 100644
> --- a/drivers/misc/habanalabs/gaudi2/gaudi2.c
> +++ b/drivers/misc/habanalabs/gaudi2/gaudi2.c
> @@ -9165,6 +9165,7 @@ static void gaudi2_restore_user_sm_registers(struct hl_device *hdev)
> gaudi2_memset_device_lbw(hdev, cq_lbw_data_addr, size, 0);
> gaudi2_memset_device_lbw(hdev, cq_base_l_addr, size, 0);
> gaudi2_memset_device_lbw(hdev, cq_base_h_addr, size, 0);
> + gaudi2_memset_device_lbw(hdev, cq_size_addr, size, 0);
>
> cq_lbw_l_addr = mmDCORE0_SYNC_MNGR_GLBL_LBW_ADDR_L_0 + DCORE_OFFSET;
> cq_lbw_h_addr = mmDCORE0_SYNC_MNGR_GLBL_LBW_ADDR_H_0 + DCORE_OFFSET;
> --
> 2.38.1
>
Reviewed-by: Oded Gabbay <ogabbay@xxxxxxxxxx>
Applied to -next.
Thanks,
Oded