All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Harish Chegondi <harish.chegondi@intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v11 5/8] drm/xe/eustall: Add support to handle dropped EU stall data
Date: Tue, 25 Feb 2025 15:34:52 -0800	[thread overview]
Message-ID: <85a5a9k38j.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <33eb4ea0ee3097eef392b837205c21a78e4c64ea.1740474556.git.harish.chegondi@intel.com>

On Tue, 25 Feb 2025 01:20:22 -0800, Harish Chegondi wrote:
>
>  static int xe_eu_stall_data_buf_read(struct xe_eu_stall_data_stream *stream,
>				     char __user *buf, size_t count,
>				     size_t *total_data_size, struct xe_gt *gt,
> @@ -362,6 +378,9 @@ static int xe_eu_stall_data_buf_read(struct xe_eu_stall_data_stream *stream,
>	buf_size = stream->per_xecore_buf_size;
>
>	read_data_size = buf_data_size(buf_size, read_ptr, write_ptr);
> +	if (read_data_size == 0)
> +		goto exit_drop;
> +

This is not needed. Just add the 'goto exit_drop;' to the 'if
(read_data_size == 0)' a couple of lines below.

>	/* Read only the data that the user space buffer can accommodate */
>	read_data_size = min_t(size_t, count - *total_data_size, read_data_size);
>	if (read_data_size == 0)

Add 'goto exit_drop;' here instead of 'return 0;'.

Note that here count must be > *total_data_size, because in
xe_eu_stall_stream_read_locked, we break out and don't call
xe_eu_stall_data_buf_read() if count == total_size. Therefore, for
read_data_size to be 0 here, read_data_size on the right hand side must
already be zero. So the two 'goto exit_drop;''s are equivalent.

After moving the 'goto exit_drop;' this patch is also:

Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>

  reply	other threads:[~2025-02-25 23:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-25  9:20 [PATCH v11 0/8] Add support for EU stall sampling Harish Chegondi
2025-02-25  9:20 ` [PATCH v11 1/8] drm/xe/topology: Add a function to find the index of the last enabled DSS in a mask Harish Chegondi
2025-02-25  9:20 ` [PATCH v11 2/8] drm/xe/uapi: Introduce API for EU stall sampling Harish Chegondi
2025-02-25  9:20 ` [PATCH v11 3/8] drm/xe/eustall: Add support to init, enable and disable " Harish Chegondi
2025-02-25  9:20 ` [PATCH v11 4/8] drm/xe/eustall: Add support to read() and poll() EU stall data Harish Chegondi
2025-02-25 20:55   ` Dixit, Ashutosh
2025-02-25  9:20 ` [PATCH v11 5/8] drm/xe/eustall: Add support to handle dropped " Harish Chegondi
2025-02-25 23:34   ` Dixit, Ashutosh [this message]
2025-02-25  9:20 ` [PATCH v11 6/8] drm/xe/eustall: Add EU stall sampling support for Xe2 Harish Chegondi
2025-02-25  9:20 ` [PATCH v11 7/8] drm/xe/uapi: Add a device query to get EU stall sampling information Harish Chegondi
2025-02-25 16:56   ` Dixit, Ashutosh
2025-02-25  9:20 ` [PATCH v11 8/8] drm/xe/eustall: Add workaround 22016596838 which applies to PVC Harish Chegondi
2025-02-25  9:35 ` ✓ CI.Patch_applied: success for Add support for EU stall sampling Patchwork
2025-02-25  9:35 ` ✗ CI.checkpatch: warning " Patchwork
2025-02-25  9:36 ` ✓ CI.KUnit: success " Patchwork
2025-02-25  9:53 ` ✓ CI.Build: " Patchwork
2025-02-25  9:55 ` ✗ CI.Hooks: failure " Patchwork
2025-02-25  9:56 ` ✓ CI.checksparse: success " Patchwork
2025-02-25 10:16 ` ✓ Xe.CI.BAT: " Patchwork
2025-02-25 16:21 ` ✓ Xe.CI.Full: " Patchwork

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=85a5a9k38j.wl-ashutosh.dixit@intel.com \
    --to=ashutosh.dixit@intel.com \
    --cc=harish.chegondi@intel.com \
    --cc=intel-xe@lists.freedesktop.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 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.