All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "James Hilliard" <james.hilliard1@gmail.com>
Cc: linux-serial@vger.kernel.org
Subject: Re: [PATCH v2] Input: serport - defer write wakeups to a worker
Date: Wed, 28 Oct 2026 07:23:16 +0000	[thread overview]
Message-ID: <sashiko-outbox-187576@kernel.org> (raw)
In-Reply-To: <20261028-submit-serport-write-wakeup-v1-v2-1-c05d96259985@gmail.com>

> UART drivers can invoke the line discipline's write_wakeup() callback with
> their port lock held. serport forwards the notification directly to the
> serio driver. I-Force's callback can transmit a queued packet through
> serio_write(), which calls back into uart_write() and tries to acquire the
> same port lock. A notification after I-Force queues a packet but before it
> sets IFORCE_XMIT_RUNNING can therefore deadlock.
> 
> Defer the serio notification to a work item, as required for transmitting
> from a line discipline's write-wakeup path. Initialize the work disabled
> and enable it, along with TTY_DO_WRITE_WAKEUP, only when a serio driver
> with a write_wakeup() callback opens the port.
> 
> Clear TTY_DO_WRITE_WAKEUP and disable and drain the work when that driver
> closes the port, before the serio driver and port can be torn down. This
> allows the worker to call the driver without holding serport->lock,
> breaking the lock ordering cycle with input event callbacks that write
> to the UART.
> 
> Also clear TTY_DO_WRITE_WAKEUP and disable and drain the work on hangup,
> before waking the reader to unregister the serio port. The additional
> disable keeps the work disabled even if a driver opens the port while
> hangup is in progress.
> 
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261028-submit-serport-write-wakeup-v1-v2-1-c05d96259985@gmail.com?part=1


  reply	other threads:[~2026-10-28  7:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-28  7:14 [PATCH v2] Input: serport - defer write wakeups to a worker James Hilliard
2026-10-28  7:23 ` sashiko-bot [this message]
2026-10-28 17:09 ` Dmitry Torokhov

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-187576@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=james.hilliard1@gmail.com \
    --cc=linux-serial@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 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.