From: sashiko-bot@kernel.org
To: "Myeonghun Pak" <mhun512@gmail.com>
Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com
Subject: Re: [PATCH v2 1/2] HID: intel-thc-hid: quickspi: quiesce IRQs during teardown
Date: Tue, 10 Nov 2026 05:11:44 +0000 [thread overview]
Message-ID: <sashiko-outbox-206266@kernel.org> (raw)
In-Reply-To: <20261109-thc-rebase-v2-1-mhun512@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] HID: intel-thc-hid: quickspi: broken HID teardown in
quickspi_remove()
--
commit fefc2e678efd20341c68b06e3be50ff1570c6a3b
Author: Myeonghun Pak <mhun512@gmail.com>
HID: intel-thc-hid: quickspi: quiesce IRQs during teardown
This commit disables and frees the device IRQ and stops recovery work
before tearing down HID and DMA resources during probe error unwind,
driver removal, and shutdown.
> diff --git a/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c b/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
> index bf49d8ce5f07b..acb4d2716ea74 100644
> --- a/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
> +++ b/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
[ ... ]
> @@ -721,9 +731,12 @@ static void quickspi_remove(struct pci_dev *pdev)
> if (!qsdev)
> return;
>
> - quickspi_hid_remove(qsdev);
> -
> + WRITE_ONCE(qsdev->recovery_disabled, true);
> + disable_irq(pdev->irq);
> quickspi_dev_deinit(qsdev);
> + devm_free_irq(&pdev->dev, pdev->irq, qsdev);
> +
> + quickspi_hid_remove(qsdev);
>
> quickspi_dma_deinit(qsdev);
[Severity: Medium]
Does moving quickspi_hid_remove() after disable_irq(),
quickspi_dev_deinit(), and devm_free_irq() break synchronous HID requests
issued during hid_destroy_device()?
When a hid-multitouch input device is open during unbind,
hid_destroy_device() closes it synchronously via mt_on_hid_hw_close() ->
mt_set_modes(), which calls quickspi_hid_raw_request() ->
quickspi_set_report() -> write_cmd_to_txdma() -> thc_dma_write(). Because
neither quickspi_hid_raw_request() nor thc_dma_write() checks qsdev->state
and THC_TXDMA remains enabled until quickspi_dma_deinit(), thc_dma_write()
starts hardware TxDMA and stalls until timeout waiting for a THC_TXDMA_INT
completion interrupt that can no longer fire.
In addition, when thc_dma_write() times out or is interrupted by a signal,
its error path calls thc_interrupt_quiesce(dev, false) if dev->perf_limit
is set (re-enabling external touch interrupts after quickspi_dev_deinit()),
and quickspi_dma_deinit() then unmaps and frees the TxDMA scatterlist and
PRD table while hardware TxDMA may still be active.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261109-thc-rebase-v2-0-mhun512@gmail.com?part=1
next prev parent reply other threads:[~2026-11-10 5:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 4:47 [PATCH v2 0/2] HID: intel-thc-hid: quiesce IRQs during teardown Myeonghun Pak
2026-11-10 4:47 ` [PATCH v2 1/2] HID: intel-thc-hid: quickspi: " Myeonghun Pak
2026-11-10 5:11 ` sashiko-bot [this message]
2026-11-10 5:59 ` Xu, Even
2026-11-10 4:47 ` [PATCH v2 2/2] HID: intel-thc-hid: quicki2c: " Myeonghun Pak
2026-11-10 5:06 ` 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=sashiko-outbox-206266@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=mhun512@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox