All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Yaohan Li" <shunsheng1218@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] accel/qaic: drain the control workqueue before the device is freed
Date: Wed, 18 Nov 2026 07:41:04 +0000	[thread overview]
Message-ID: <sashiko-outbox-220324@kernel.org> (raw)
In-Reply-To: <20261118072448.1259909-1-shunsheng1218@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] accel/qaic: Fixes trailer cites c501ca23a6a3 instead of
  22ec9a3b73dd
--

commit 4e36def68e52df8a1a1cb9f08c76e856b9e13fb0
Author: Yaohan Li <shunsheng1218@gmail.com>

> accel/qaic: drain the control workqueue before the device is freed
>
> qaic_pci_remove() tears the MHI controller down and destroys the DRM
> device, but nothing drains qdev->cntl_wq.  qdev itself is allocated with
> devm_kzalloc_flex() and is freed as soon as the PCI device is unbound,
> while cntl_wq is a DRM-managed resource that survives until the last
> open file drops its reference to the DRM device.
>
> resp_work is queued from qaic_mhi_dl_xfer_cb() and resp_worker()
> dereferences qdev, so a work item that is still queued, or still
> running, when the driver instance goes away touches freed memory.
>
> mhi_power_down() moves the controller to the shutdown state, disables
> the interrupt and flushes the state worker that destroys the channel
> devices, and mhi_unregister_controller() removes the controller, so no
> data event can reach qaic_mhi_dl_xfer_cb() once
> qaic_mhi_free_controller() has returned.  Flushing the workqueue after
> it therefore covers every work item that can still be queued.
>
> Fixes: c501ca23a6a3 ("accel/qaic: Add uapi and core driver file")
> Signed-off-by: Yaohan Li <shunsheng1218@gmail.com>

[Severity: Low]
In c501ca23a6a3 ("accel/qaic: Add uapi and core driver file"),
qaic_pci_remove() called cleanup_qdev(), which destroyed qdev->cntl_wq
synchronously via destroy_workqueue() before qdev was freed.  The
lifetime mismatch was introduced in 22ec9a3b73dd ("accel/qaic: Leverage
DRM managed APIs to release resources"), which switched qdev->cntl_wq to
qaicm_wq_init() and dropped cleanup_qdev() from qaic_pci_remove().

Should the Fixes tag reference that commit instead:

  Fixes: 22ec9a3b73dd ("accel/qaic: Leverage DRM managed APIs to release resources")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261118072448.1259909-1-shunsheng1218@gmail.com?part=1

      reply	other threads:[~2026-11-18  7:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18  7:24 [PATCH] accel/qaic: drain the control workqueue before the device is freed Yaohan Li
2026-11-18  7:41 ` sashiko-bot [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=sashiko-outbox-220324@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=shunsheng1218@gmail.com \
    /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.