Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp770820ybc; Sat, 16 Nov 2019 08:23:44 -0800 (PST) X-Google-Smtp-Source: APXvYqydPnwqvaS//izdTh9habdmENgR0QTVc+hnU+PAEx4REQ9ksLEGYj5XQ5ds7sqhnR4zbloL X-Received: by 2002:a17:906:a989:: with SMTP id jr9mr10672779ejb.160.1573921424166; Sat, 16 Nov 2019 08:23:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573921424; cv=none; d=google.com; s=arc-20160816; b=0s7gOX8ht9ceAxjCR2MG+GY6//y4hSQjwR9GbAYmK6Xkji6hhf/6FdznUqPVIJIdU+ 25b058OtKz6uzp+en6MINfqjLr7MizNQ+SK7QyHpmnKP5ITHdXA+OAwPGvv0gJH3Ih+N F0NL6JXFvGwmWS4tkWCLxnTXPWAMhvVwsUHRrmDt14pE8t+NxKil8a4giCUTzdYF15xa wz9vVgh3Ok0FRTJQ2ftZMiQ9owMzdHTUWRH8bO3p2W0EOCPlU1TaL5VRdp2Kv7qhwKh/ 5qO0GmvHrjDKr3iDEhyNnW5bd6yI17P2D4MojdJcxmFAjvHXABL0GTv2EqEwjc/v9xDQ H5zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bpr18FOj9szHkjuCXoA7sDOThkz4zLA17yZDxqRdKWU=; b=CRUEQZIv76RAF9OGH03BHM8taoa7hJdpaTjDFnU1SU6ugv+akgMs4sXBdUhKEPZVt6 jFwUS3ZFkj/Q1jnCch1MEmUqS/aQIraXc9BMBcSPGaof2nW5yyQ4EiGQjZwPlj0BlsKo J5rVzn3sjjfmKNYJL1yUclEni/EvcsHqgXER9+j94ftE9Yo0nfl+5WdPImCe4Ot1GH5I oGxXAzDlMVXh6zQ3jC50FSZDqtcNalA+fQ7IqBsOHg4AZeysyguYWbvqkm8K1VErtzst SmPoXjKLT0lqO2OV/76aerO+cNK+GH0UiW7QCtp4aO8ixjOv4hdwNsH4WHfMiWWN+M8o EVmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=i2TsweSq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m15si7916087ejk.320.2019.11.16.08.23.19; Sat, 16 Nov 2019 08:23:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=i2TsweSq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728985AbfKPPob (ORCPT + 99 others); Sat, 16 Nov 2019 10:44:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:49344 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727880AbfKPPo3 (ORCPT ); Sat, 16 Nov 2019 10:44:29 -0500 Received: from sasha-vm.mshome.net (unknown [50.234.116.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4F52020803; Sat, 16 Nov 2019 15:44:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573919068; bh=DYDeOGRcI4kuQWrRA6hmaepxNa+IRLppnQKcvt38DBs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i2TsweSq3Q7NI+TkM2IrnEvvf6i4gWnfpimWLbLTZZ3uVSwfe8yRDoQy6TCMS0opo y/h6DXcMF2/wXSEHUKLnEH3X0ONxRv8BedLNDd1GGV4d4vv99fgqom0WuSBAMh+NO9 T2oSO4UvnLNGKq40MePp9C6nosrY0Kx8qd0a47is= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Anton Ivanov , Richard Weinberger , Sasha Levin , linux-um@lists.infradead.org Subject: [PATCH AUTOSEL 4.19 140/237] um: Make line/tty semantics use true write IRQ Date: Sat, 16 Nov 2019 10:39:35 -0500 Message-Id: <20191116154113.7417-140-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191116154113.7417-1-sashal@kernel.org> References: <20191116154113.7417-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anton Ivanov [ Upstream commit 917e2fd2c53eb3c4162f5397555cbd394390d4bc ] This fixes a long standing bug where large amounts of output could freeze the tty (most commonly seen on stdio console). While the bug has always been there it became more pronounced after moving to the new interrupt controller. The line semantics are now changed to have true IRQ write semantics which should further improve the tty/line subsystem stability and performance Signed-off-by: Anton Ivanov Signed-off-by: Richard Weinberger Signed-off-by: Sasha Levin --- arch/um/drivers/line.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index 8d80b27502e6a..7e524efed5848 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c @@ -261,7 +261,7 @@ static irqreturn_t line_write_interrupt(int irq, void *data) if (err == 0) { spin_unlock(&line->lock); return IRQ_NONE; - } else if (err < 0) { + } else if ((err < 0) && (err != -EAGAIN)) { line->head = line->buffer; line->tail = line->buffer; } @@ -284,7 +284,7 @@ int line_setup_irq(int fd, int input, int output, struct line *line, void *data) if (err) return err; if (output) - err = um_request_irq(driver->write_irq, fd, IRQ_NONE, + err = um_request_irq(driver->write_irq, fd, IRQ_WRITE, line_write_interrupt, IRQF_SHARED, driver->write_irq_name, data); return err; -- 2.20.1