From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A2B9B3B19B9; Sat, 17 Oct 2026 17:02:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792256575; cv=none; b=oZGpIrF3Fn3d7SKJAZm6syIBDQSRZ3wx0f4Y9pKLMe9Af823ZQmX//q4ZXvi1T48Ag+fBHYGhen1PZS7EXjhUCgt+HNevnQpM+rbTu2f0+lEH43ELY3pP2V8CYpPgErZ39Vq3he3+b7Yt6w4P+AU9us2By9qwJQ0Lz78o+oAa6g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792256575; c=relaxed/simple; bh=kFWLHlWA8G0hzeuXYs6uUwapQ1CQqeYiA1bGUq8MLvM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pdYSSmWzecsdJ+hQJzIibYnQnz+fUTjbEC0aXnn6DjyAWDIjPIBnlMg3d6DUczSbBpxK3ELVl1cFLtQiNNGCYCet3KaVvarxb+0bHiRlm6Ui2IworrP1LQZwQl2ZRBWy6YRGrOt9M/i+Y7oIPMNB5Yb8Nlv/nCuarwagBMbZ3H8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=AtftuRsF; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="AtftuRsF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA6F21F000C4; Sat, 17 Oct 2026 17:02:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1792256574; bh=0wCB+TTqlPi4MKgAzTeALWLw8Tb6JVzIalHjP6liv5o=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=AtftuRsFC24d5jzMldA83d18YNZG2FGbFjxPx7G3mbYCtIDJIr//c2fSIX2CJ8hzz bPq7Pi0p9W0m9lBAS0lR8SARn68uKVxQTLbyT0XT5OQgfKf3uIz+02y65VnIrZ1o8+ 2c3uWs/z5Eg2WKTo4AhWycfUxwcsN49h0B8nuJlY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, sashiko-bot@kernel.org, Arnd Bergmann , Johan Hovold , Jiri Slaby , stable@kernel.org Subject: [PATCH 6.6 0280/1674] tty: amiserial: fix broken TIOCMIWAIT Date: Sat, 17 Oct 2026 17:42:32 +0200 Message-ID: <20261017160438.301935669@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261017160431.119607952@linuxfoundation.org> References: <20261017160431.119607952@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold commit 615f35fd5aee169cc4881a8594f2fa234a4d0bb8 upstream. A change replacing interruptible_sleep_on() inadvertently broke the TIOCMIWAIT implementation which now immediately returns -EIO (unless there is a racing modem status update). Replace the old hangup (and signal) detection with a check for the TTY_IO_ERROR flag which is set on hangup. Fixes: 591cee0a3563 ("tty/amiserial: avoid interruptible_sleep_on") Reported-by: sashiko-bot@kernel.org Link: https://lore.kernel.org/20260910132029.D80801F00898@smtp.kernel.org Cc: stable@kernel.org # 3.14 Cc: Arnd Bergmann Signed-off-by: Johan Hovold Reviewed-by: Jiri Slaby Link: https://patch.msgid.link/20260911090132.723531-1-johan@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/tty/amiserial.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) --- a/drivers/tty/amiserial.c +++ b/drivers/tty/amiserial.c @@ -1140,11 +1140,6 @@ static int rs_ioctl(struct tty_struct *t local_irq_save(flags); cnow = info->icount; /* atomic copy */ local_irq_restore(flags); - if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr && - cnow.dcd == cprev.dcd && cnow.cts == cprev.cts) { - ret = -EIO; /* no change => error */ - break; - } if ( ((arg & TIOCM_RNG) && (cnow.rng != cprev.rng)) || ((arg & TIOCM_DSR) && (cnow.dsr != cprev.dsr)) || ((arg & TIOCM_CD) && (cnow.dcd != cprev.dcd)) || @@ -1152,6 +1147,10 @@ static int rs_ioctl(struct tty_struct *t ret = 0; break; } + if (tty_io_error(tty)) { + ret = -EIO; + break; + } schedule(); /* see if a signal did it */ if (signal_pending(current)) {