All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeffrey Hugo <quic_jhugo@quicinc.com>
To: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>,
	<dri-devel@lists.freedesktop.org>, <oded.gabbay@gmail.com>,
	<airlied@gmail.com>, <daniel@ffwll.ch>, <tzimmermann@suse.de>
Cc: andrzej.kacprowski@linux.intel.com,
	Krystian Pradzynski <krystian.pradzynski@linux.intel.com>,
	stanislaw.gruszka@linux.intel.com
Subject: Re: [PATCH v5 4/7] accel/ivpu: Add IPC driver and JSM messages
Date: Thu, 12 Jan 2023 11:18:24 -0700	[thread overview]
Message-ID: <6811c853-aaa7-3bf1-c098-d6ca0e875e75@quicinc.com> (raw)
In-Reply-To: <20230109122344.253994-5-jacek.lawrynowicz@linux.intel.com>

On 1/9/2023 5:23 AM, Jacek Lawrynowicz wrote:
> The IPC driver is used to send and receive messages to/from firmware
> running on the VPU.
> 
> The only supported IPC message format is Job Submission Model (JSM)
> defined in vpu_jsm_api.h header.
> 
> Co-developed-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
> Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
> Co-developed-by: Krystian Pradzynski <krystian.pradzynski@linux.intel.com>
> Signed-off-by: Krystian Pradzynski <krystian.pradzynski@linux.intel.com>
> Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>

Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>

> +int ivpu_ipc_irq_handler(struct ivpu_device *vdev)
> +{
> +	struct ivpu_ipc_info *ipc = vdev->ipc;
> +	struct ivpu_ipc_consumer *cons;
> +	struct ivpu_ipc_hdr *ipc_hdr;
> +	struct vpu_jsm_msg *jsm_msg;
> +	unsigned long flags;
> +	bool dispatched;
> +	u32 vpu_addr;
> +
> +	/* Driver needs to purge all messages from IPC FIFO to clear IPC interrupt.
> +	 * Without purge IPC FIFO to 0 next IPC interrupts won't be generated.
> +	 */
> +	while (ivpu_hw_reg_ipc_rx_count_get(vdev)) {

Ick.  Please no in the long term?

This is an infinite loop.  In hard IRQ context.  Controlled by the 
device, which you probably shouldn't trust.

However the real fix for this is to move to threaded_irqs.  Which is 
going to be a huge refactor for you.  Rate limiting doesn't appear viable.

If I understand things correctly, the chances that the device will 
generate a large count, or update the count as fast or faster than the 
driver are low, but it should still be fixed.

How about a high priority todo to convert to threaded irqs?  At the same 
time you can update the return value for this function which seems to 
not be checked anywhere, and also the comment here which is not proper 
multi-line style.


  reply	other threads:[~2023-01-12 18:18 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09 12:23 [PATCH v5 0/7] New DRM accel driver for Intel VPU Jacek Lawrynowicz
2023-01-09 12:23 ` [PATCH v5 1/7] accel/ivpu: Introduce a new DRM " Jacek Lawrynowicz
2023-01-12 17:34   ` Jeffrey Hugo
2023-01-13  8:23     ` Jacek Lawrynowicz
2023-01-13 16:28       ` Jeffrey Hugo
2023-01-09 12:23 ` [PATCH v5 2/7] accel/ivpu: Add Intel VPU MMU support Jacek Lawrynowicz
2023-01-12 17:41   ` Jeffrey Hugo
2023-01-09 12:23 ` [PATCH v5 3/7] accel/ivpu: Add GEM buffer object management Jacek Lawrynowicz
2023-01-10 14:34   ` Oded Gabbay
2023-01-11  7:58     ` Jacek Lawrynowicz
2023-01-12 17:52   ` Jeffrey Hugo
2023-01-13  8:33     ` Jacek Lawrynowicz
2023-01-09 12:23 ` [PATCH v5 4/7] accel/ivpu: Add IPC driver and JSM messages Jacek Lawrynowicz
2023-01-12 18:18   ` Jeffrey Hugo [this message]
2023-01-13  8:46     ` Jacek Lawrynowicz
2023-01-09 12:23 ` [PATCH v5 5/7] accel/ivpu: Implement firmware parsing and booting Jacek Lawrynowicz
2023-01-10 15:34   ` Oded Gabbay
2023-01-11  8:15     ` Jacek Lawrynowicz
2023-01-11  8:20       ` Oded Gabbay
2023-01-12 18:22   ` Jeffrey Hugo
2023-01-09 12:23 ` [PATCH v5 6/7] accel/ivpu: Add command buffer submission logic Jacek Lawrynowicz
2023-01-12 18:32   ` Jeffrey Hugo
2023-01-09 12:23 ` [PATCH v5 7/7] accel/ivpu: Add PM support Jacek Lawrynowicz
2023-01-12 19:03   ` Jeffrey Hugo
2023-01-10 19:34 ` [PATCH v5 0/7] New DRM accel driver for Intel VPU Oded Gabbay
2023-01-19  9:07   ` Daniel Vetter
2023-01-12 17:10 ` Jeffrey Hugo
2023-01-13  9:32   ` Jacek Lawrynowicz

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=6811c853-aaa7-3bf1-c098-d6ca0e875e75@quicinc.com \
    --to=quic_jhugo@quicinc.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.kacprowski@linux.intel.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jacek.lawrynowicz@linux.intel.com \
    --cc=krystian.pradzynski@linux.intel.com \
    --cc=oded.gabbay@gmail.com \
    --cc=stanislaw.gruszka@linux.intel.com \
    --cc=tzimmermann@suse.de \
    /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.