All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oded Gabbay <ogabbay@kernel.org>
To: dri-devel@lists.freedesktop.org
Cc: Tal Cohen <talcohen@habana.ai>
Subject: [PATCH 2/6] accel/habanalabs: print event type when device is disabled
Date: Thu, 23 Mar 2023 13:35:21 +0200	[thread overview]
Message-ID: <20230323113525.959176-2-ogabbay@kernel.org> (raw)
In-Reply-To: <20230323113525.959176-1-ogabbay@kernel.org>

From: Tal Cohen <talcohen@habana.ai>

When the device is in disabled state, the driver isn't suppose to
receive any events from FW. Printing the event type, as part of the
message that was already printed, shall help to get more info if this
unexpected message is received.

Signed-off-by: Tal Cohen <talcohen@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
---
 drivers/accel/habanalabs/common/irq.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/accel/habanalabs/common/irq.c b/drivers/accel/habanalabs/common/irq.c
index fab1abc5c910..0d59bb7c9063 100644
--- a/drivers/accel/habanalabs/common/irq.c
+++ b/drivers/accel/habanalabs/common/irq.c
@@ -415,8 +415,8 @@ irqreturn_t hl_irq_handler_eq(int irq, void *arg)
 	struct hl_eq_entry *eq_base;
 	struct hl_eqe_work *handle_eqe_work;
 	bool entry_ready;
-	u32 cur_eqe;
-	u16 cur_eqe_index;
+	u32 cur_eqe, ctl;
+	u16 cur_eqe_index, event_type;
 
 	eq_base = eq->kernel_address;
 
@@ -449,7 +449,10 @@ irqreturn_t hl_irq_handler_eq(int irq, void *arg)
 		dma_rmb();
 
 		if (hdev->disabled && !hdev->reset_info.in_compute_reset) {
-			dev_warn(hdev->dev, "Device disabled but received an EQ event\n");
+			ctl = le32_to_cpu(eq_entry->hdr.ctl);
+			event_type = ((ctl & EQ_CTL_EVENT_TYPE_MASK) >> EQ_CTL_EVENT_TYPE_SHIFT);
+			dev_warn(hdev->dev,
+				"Device disabled but received an EQ event (%u)\n", event_type);
 			goto skip_irq;
 		}
 
-- 
2.40.0


  reply	other threads:[~2023-03-23 11:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23 11:35 [PATCH 1/6] accel/habanalabs: unmap mapped memory when TLB inv fails Oded Gabbay
2023-03-23 11:35 ` Oded Gabbay [this message]
2023-03-24  8:19   ` [PATCH 2/6] accel/habanalabs: print event type when device is disabled Stanislaw Gruszka
2023-03-23 11:35 ` [PATCH 3/6] accel/habanalabs: check return value of add_va_block_locked Oded Gabbay
2023-03-24  8:28   ` Stanislaw Gruszka
2023-03-23 11:35 ` [PATCH 4/6] accel/habanalabs: change COMMS warning messages to error level Oded Gabbay
2023-03-24  8:28   ` Stanislaw Gruszka
2023-03-23 11:35 ` [PATCH 5/6] accel/habanalabs: remove duplicated disable pci msg Oded Gabbay
2023-03-24  8:31   ` Stanislaw Gruszka
2023-03-23 11:35 ` [PATCH 6/6] accel/habanalabs: send disable pci when compute ctx is active Oded Gabbay
2023-03-24  8:31   ` Stanislaw Gruszka
2023-03-24  8:18 ` [PATCH 1/6] accel/habanalabs: unmap mapped memory when TLB inv fails Stanislaw Gruszka

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=20230323113525.959176-2-ogabbay@kernel.org \
    --to=ogabbay@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=talcohen@habana.ai \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.