Linux Input/HID development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Emfox Zhou" <emfox@debian.org>
Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com
Subject: Re: [PATCH 1/5] HID: intel-thc-hid: intel-thc: keep TxDMA write errors
Date: Mon, 16 Nov 2026 13:49:41 +0000	[thread overview]
Message-ID: <sashiko-outbox-217112@kernel.org> (raw)
In-Reply-To: <20261116133132.1282020-2-emfox@debian.org>

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [Medium] HID: intel-thc-hid: synchronous block in
  quicki2c_hid_output_report() [1]
--

commit 7d6243e52aaa280fbfaad43053698624190f219b
Author: Emfox Zhou <emfox@debian.org>

HID: intel-thc-hid: intel-thc: keep TxDMA write errors

This commit waits uninterruptibly for TxDMA completion in thc_dma_write(),
wakes all waiters on write_complete_wait, and preserves the write error code
when unquiescing interrupts during cleanup.

> diff --git a/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.c b/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.c
> index c80ef8c205742..c0dc44e26e0ac 100644
> --- a/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.c
> +++ b/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.c
> @@ -1045,8 +1045,9 @@ int thc_dma_write(struct thc_device *dev, void *buffer, size_t buf_len)
>  
>  	dma_set_start_bit(dev, &dev->dma_ctx->dma_config[THC_TXDMA]);
>  
> -	ret = wait_event_interruptible_timeout(dev->write_complete_wait, dev->write_done, 1 * HZ);
> -	if (ret <= 0 || !dev->write_done) {
> +	ret = wait_event_timeout(dev->write_complete_wait,
> +				 dev->write_done, 1 * HZ);

[Severity: Medium]
This problem wasn't introduced by this patch, but does calling
thc_dma_write() from quicki2c_hid_output_report() violate the HID
output_report contract [1] by blocking the caller?

The HID subsystem requires the .output_report callback to be asynchronous,
yet quicki2c_hid_output_report() -> quicki2c_output_report() ->
thc_dma_write() acquires dev->thc_bus_lock and blocks on
dev->write_complete_wait for up to a second, stalling the calling HID core
workqueue or thread.

[1] https://sashiko.dev/#/bug/linux-84fcc3fd-7b0c-485b-9da1-a71ea67e4f5e

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261116133132.1282020-1-emfox@debian.org?part=1

  reply	other threads:[~2026-11-16 13:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 13:31 [PATCH 0/5] HID: intel-thc-hid: intel-thc: DMA lifetime fixes Emfox Zhou
2026-11-16 13:31 ` [PATCH 1/5] HID: intel-thc-hid: intel-thc: keep TxDMA write errors Emfox Zhou
2026-11-16 13:49   ` sashiko-bot [this message]
2026-11-16 13:31 ` [PATCH 2/5] HID: intel-thc-hid: intel-thc: free the failed channel Emfox Zhou
2026-11-16 13:31 ` [PATCH 3/5] HID: intel-thc-hid: intel-thc: stop all engines first Emfox Zhou
2026-11-16 13:39   ` sashiko-bot
2026-11-16 13:31 ` [PATCH 4/5] HID: intel-thc-hid: intel-thc: add the slow SPI gears Emfox Zhou
2026-11-16 13:31 ` [PATCH 5/5] HID: intel-thc-hid: intel-thc: budget the receive drain Emfox Zhou

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-217112@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=emfox@debian.org \
    --cc=linux-input@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox