All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Carl Vanderlip" <carl.vanderlip@oss.qualcomm.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/6] accel/qaic: Isolate hw submission
Date: Sat, 03 Oct 2026 02:49:59 +0000	[thread overview]
Message-ID: <20261003024959.AD36C1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20261003023818.1161666-4-carl.vanderlip@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] qaic: redundant req_submit_ts assignment causes incorrect stats
--

commit 832ae6a6a52a6bd91f900e3b436da51c50e676e9
Author: Carl Vanderlip <carl.vanderlip@oss.qualcomm.com>

accel/qaic: Isolate hw submission

This commit merges two pathways used to submit a request to the DBC FIFO
into a single function. This simplifies the job submission logic in
preparation for using the DRM scheduler.

> diff --git a/drivers/accel/qaic/qaic_data.c b/drivers/accel/qaic/qaic_data.c
> index 3326d9da0e1e4..0208400d2636f 100644
> --- a/drivers/accel/qaic/qaic_data.c
> +++ b/drivers/accel/qaic/qaic_data.c
[ ... ]
> +/* Caller should be holding dbc->req_lock */
> +static inline int qaic_submit_reqs_to_hw(struct bo_slice *slice,
> +					 unsigned int num_req,
> +					 bool is_partial, u32 partial_size)
> +{
[ ... ]
> +	tail = (tail + num_req) % dbc->nelem;
> +
> +	/* Submit_ts will be taken for the last job of this BO */
> +	bo->perf_stats.req_submit_ts = ktime_get_ns();
> +
> +	/* Finalize commit to hardware */
> +	dma_sync_sgtable_for_device(&dbc->qdev->pdev->dev, bo->sgt, bo->dir);
> +	writel(tail, dbc->dbc_base + REQTP_OFF);
>  	return 0;
>  }

[Severity: Medium]
Does update_profiling_data() unconditionally overwrite this new timestamp?

In the IOCTL path, __qaic_execute_bo_ioctl() calls send_bo_list_to_device(),
which eventually reaches this code and records the per-job timestamp.
However, immediately after send_bo_list_to_device() returns,
__qaic_execute_bo_ioctl() calls update_profiling_data(&exec):

static void update_profiling_data(struct execute_info *exec)
{
        ...
        for (i = 0; i < exec->count; i++) {
                bo = exec->bo_arr[i];
                ...
                bo->perf_stats.req_submit_ts = exec->perf_stats.submit_ts;
        ...
}

Could this render the newly added per-job timestamp dead code? Since this
refactoring prepares for the DRM scheduler, might this overwrite also cause
a data race or incorrect profiling statistics when submissions become
asynchronous?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261003023818.1161666-1-carl.vanderlip@oss.qualcomm.com?part=3

  reply	other threads:[~2026-10-03  2:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-03  2:38 [PATCH 0/6] accel/qaic: Use DRM Scheduler for submitting BO reqs Carl Vanderlip
2026-10-03  2:38 ` [PATCH 1/6] accel/qaic: Centralize execution info Carl Vanderlip
2026-10-03  2:49   ` sashiko-bot
2026-10-03  2:38 ` [PATCH 2/6] accel/qaic: Replace transfer completion with dma-fence Carl Vanderlip
2026-10-03  2:54   ` sashiko-bot
2026-10-03  2:38 ` [PATCH 3/6] accel/qaic: Isolate hw submission Carl Vanderlip
2026-10-03  2:49   ` sashiko-bot [this message]
2026-10-03  2:38 ` [PATCH 4/6] accel/qaic: Use DRM_SCHED to handle FIFO submission Carl Vanderlip
2026-10-03  2:51   ` sashiko-bot
2026-10-03  2:38 ` [PATCH 5/6] accel/qaic: Split oversized BO requests into multiple jobs Carl Vanderlip
2026-10-03  2:51   ` sashiko-bot
2026-10-03  2:38 ` [PATCH 6/6] accel/qaic: Use reduced size allocation for FIFOs Carl Vanderlip
2026-10-03  2:51   ` sashiko-bot

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=20261003024959.AD36C1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=carl.vanderlip@oss.qualcomm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.