mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	Johan Hovold <johan@kernel.org>
Subject: [PATCH 0/3] tty: n_hdlc: fix hangup handling
Date: Wed, 28 Oct 2026 14:20:46 +0100	[thread overview]
Message-ID: <20261028132049.728457-1-johan@kernel.org> (raw)

An LLM incorrectly flagged three hangup issues in n_hdlc as leading to
hangups stuck in uninterruptible sleep.

This used to be the case before commit c96cf923a98d ("tty: Don't block
on IO when ldisc change is pending") which incidentally fixed the stuck
hangup issues by turning tty_io_nonblock() into an indirect hangup
check.

Since then read() and write() can return -EAGAIN also for files opened
in blocking mode on ldisc changes, which looks questionable. This change
was added to address a regression introduced by a series adding missing
locking to tty_reopen() but should probably be reconsidered. [1]

This series addresses the underlying hangup issues and incorrect -EAGAIN
on hangup meanwhile.

Johan


[1] https://lore.kernel.org/all/alpine.LRH.2.02.1809191330590.19146@file01.intranet.prod.int.rdu2.redhat.com/


Johan Hovold (3):
  tty: n_hdlc: fix missing write() hangup check
  tty: n_hdlc: fix read() hangup race
  tty: n_hdlc: fix read() hangup check

 drivers/tty/n_hdlc.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

-- 
2.55.0


             reply	other threads:[~2026-10-28 13:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-28 13:20 Johan Hovold [this message]
2026-10-28 13:20 ` [PATCH 1/3] tty: n_hdlc: fix missing write() hangup check Johan Hovold
2026-10-28 13:20 ` [PATCH 2/3] tty: n_hdlc: fix read() hangup race Johan Hovold
2026-10-28 13:20 ` [PATCH 3/3] tty: n_hdlc: fix read() hangup check Johan Hovold

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=20261028132049.728457-1-johan@kernel.org \
    --to=johan@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®