Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965768AbbEERLh (ORCPT ); Tue, 5 May 2015 13:11:37 -0400 Received: from mail-am1on0078.outbound.protection.outlook.com ([157.56.112.78]:29318 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965751AbbEERLe (ORCPT ); Tue, 5 May 2015 13:11:34 -0400 Authentication-Results: spf=fail (sender IP is 12.216.194.146) smtp.mailfrom=ezchip.com; ezchip.com; dkim=none (message not signed) header.d=none; From: Chris Metcalf To: Greg Kroah-Hartman , Jiri Slaby , , CC: Chris Metcalf Subject: [PATCH] drivers/tty/hvc/hvc_tile.c: properly return -EAGAIN Date: Tue, 5 May 2015 13:11:28 -0400 Message-ID: <1430845888-22164-1-git-send-email-cmetcalf@ezchip.com> X-Mailer: git-send-email 2.1.2 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:12.216.194.146;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(339900001)(189002)(199003)(47776003)(6806004)(5001960100002)(77156002)(62966003)(107886002)(19580405001)(33646002)(50226001)(19580395003)(92566002)(5001770100001)(85426001)(2201001)(50986999)(104016003)(229853001)(105606002)(36756003)(46102003)(48376002)(86362001)(42186005)(50466002)(87936001)(106466001)(2101003)(4001430100001);DIR:OUT;SFP:1101;SCL:1;SRVR:DB5PR02MB0775;H:ld-1.internal.tilera.com;FPR:;SPF:Fail;MLV:sfv;MX:1;A:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR02MB0775; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:DB5PR02MB0775;BCL:0;PCL:0;RULEID:;SRVR:DB5PR02MB0775; X-Forefront-PRVS: 0567A15835 X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2015 17:11:31.1364 (UTC) X-MS-Exchange-CrossTenant-Id: 0fc16e0a-3cd3-4092-8b2f-0a42cff122c3 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0fc16e0a-3cd3-4092-8b2f-0a42cff122c3;Ip=[12.216.194.146];Helo=[ld-1.internal.tilera.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR02MB0775 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1345 Lines: 36 We were returning zero if no bytes could be written to the Tilera hypervisor console device, but this causes the output to be truncated. By returning -EAGAIN the tty hvc driver will come back and try again, which gives the semantics we want, and avoids dropping console output. Signed-off-by: Chris Metcalf --- I have queued this in the tile tree as a tile-specific device, but if someone would prefer to pick it up for a tty or tty/hvc tree, that's fine too; just let me know. drivers/tty/hvc/hvc_tile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/tty/hvc/hvc_tile.c b/drivers/tty/hvc/hvc_tile.c index 3f6cd3102db5..9da1e842bbe9 100644 --- a/drivers/tty/hvc/hvc_tile.c +++ b/drivers/tty/hvc/hvc_tile.c @@ -51,7 +51,8 @@ int tile_console_write(const char *buf, int count) _SIM_CONTROL_OPERATOR_BITS)); return 0; } else { - return hv_console_write((HV_VirtAddr)buf, count); + /* Translate 0 bytes written to EAGAIN for hvc_console_print. */ + return hv_console_write((HV_VirtAddr)buf, count) ?: -EAGAIN; } } -- 2.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/