From: Ofir Bitton <obitton@habana.ai>
To: Oded Gabbay <ogabbay@kernel.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] accel/habanalabs/gaudi2: fix spmu mask creation
Date: Sun, 1 Oct 2023 09:14:00 +0000 [thread overview]
Message-ID: <e73b2f24-0a12-c8c6-cbc8-ecea9bfa803a@habana.ai> (raw)
In-Reply-To: <20230928132527.89451-1-ogabbay@kernel.org>
On 28/09/2023 16:25, Oded Gabbay wrote:
> event_types_num received from the user can be 0. In that case, the
> event_mask should be 0.
>
> In addition, to create a correct mask we need to match the number
> of event types to the bit location such that bit 0 represents a single
> event type, bit 1 represents 2 types and so on.
>
> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
> ---
> drivers/accel/habanalabs/gaudi2/gaudi2_coresight.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/accel/habanalabs/gaudi2/gaudi2_coresight.c b/drivers/accel/habanalabs/gaudi2/gaudi2_coresight.c
> index 14a855cdc96b..2423620ff358 100644
> --- a/drivers/accel/habanalabs/gaudi2/gaudi2_coresight.c
> +++ b/drivers/accel/habanalabs/gaudi2/gaudi2_coresight.c
> @@ -2500,7 +2500,8 @@ static int gaudi2_config_spmu(struct hl_device *hdev, struct hl_debug_params *pa
> * set enabled events mask based on input->event_types_num
> */
> event_mask = 0x80000000;
> - event_mask |= GENMASK(input->event_types_num, 0);
> + if (input->event_types_num)
> + event_mask |= GENMASK(input->event_types_num - 1, 0);
>
> WREG32(base_reg + mmSPMU_PMCNTENSET_EL0_OFFSET, event_mask);
> } else {
Reviewed-by: Ofir Bitton <obitton@habana.ai>
prev parent reply other threads:[~2023-10-01 9:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-28 13:25 Oded Gabbay
2023-10-01 9:14 ` Ofir Bitton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e73b2f24-0a12-c8c6-cbc8-ecea9bfa803a@habana.ai \
--to=obitton@habana.ai \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ogabbay@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®