| Message ID | 20251214175449.3799539-4-sjg@u-boot.org |
|---|---|
| State | New |
| Headers |
Return-Path: <concept-bounces+u-boot-concept=u-boot.org@u-boot.org> X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765734915; bh=aBdtptYUIzjwj2aPO448rcBfBLsnIdPmsgYfA8ZwXAE=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=eTxWFvyECMdqiuRGFhi5WeDR1WA/yweQokzhmbzluZQrPCHoiS5rQNC6kjWx46F5j oX5vIxIAhzma2z21eMRx9lisBVjwwjVWDSi9VnDwdxTjd8KnmIpG40B0wEGIIcd3Js CRefZyAfjP4rRr2ZmTjDrM/6ERDk2e5vQZyMIueIoI2vuu3D/6LrhMmNwBepDBhy5q o74uVVfMYgVh24xXgbk5YR7a1ajcV4+qShLCbOFJgxv78TZvJ88gUFtpGLwbfy9Wvu zkMpSut7ydlHZy4ADqeXZTpsdR+H8tk8yewoqxFtZo/rR0teVz8NIPCrCu9vXull+y 6QVy/WDkY0m7Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8334C68A84 for <u-boot-concept@u-boot.org>; Sun, 14 Dec 2025 10:55:15 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id fqXs88TOmXCQ for <u-boot-concept@u-boot.org>; Sun, 14 Dec 2025 10:55:15 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765734913; bh=aBdtptYUIzjwj2aPO448rcBfBLsnIdPmsgYfA8ZwXAE=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Ux0TQosG99t4P+jA1gwRubcgbtJESydaXXaIT2M11mqDVvlhfQUgByjEd+X1XeAzC oBPUOaCpD6c8USPcWIUSmRXucPVx+gN1UlzBefx5NiQwwZkRmP8S52jyUhg2C2ijqE xJXSQ5+AKKSPHtIuU7CI3LXbjdWi0rl/aNvENe2axhvRaJ9KKyCrIkrN438ixE00tW hNwhi3CQrJPaL73t/yMZ04OkcRqiIiveR7zXns01Cl2LpXhEYRBwF/R5fLFzK0q8Ib TI74V5xoG7lsu2hhYwmFwTBbuVnPrv1BVV/s7tCx4/BkdOfjC/1w3t1L/YtJ9diHqe qLz1UH8es1r1A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E24E068A89 for <u-boot-concept@u-boot.org>; Sun, 14 Dec 2025 10:55:13 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765734912; bh=XmCvCxCy+VXBfsmKDCA0oYsr7riercLUpSX4cGc2hrU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qhiBock7BJeeWD/aNBoC+7orVKAhc12ulBfs7m2cTu+iX2BfY5rUDDiRsSdWOyVWM XOZsgAUyUflcolUD48YeH1GdMwq6fo1UjsIO5aAV6cFlWMAzD4YzFoMMDbT+jHw3ht CkkVQZ3nL2qaOvC95VsmyRQGrCBMc3qpmKdYDX2NIk3S3eaH7N13RqJ3sxRCGhTWis EE8+oCnhMe3yypQoEexZE66RdCzKq2hQejgZ6sfWjwIXorXaHLLNhK2kA5VONEUi8L d5lWYjsT4hgi3UcViq9F2uGYz7PvjA7J3AqsGKcaaW5oLOGMAsnZri1NYvHWDmKUx6 cfrPYTKZTZ0DA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 446FE68A89; Sun, 14 Dec 2025 10:55:12 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id RNpMJpOy-9iA; Sun, 14 Dec 2025 10:55:12 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765734911; bh=m5wUhDCwFL1bvv8gvnUDB4T3L44+bR97ASLsZP/0+9A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YMadbsC6l77Ddanei60sB4F6BR/CuRTxjXkkNvVo98LrLNRC3BR8clM+5O2baSaqp 9I6pUnXfER2p19QW/txg1f/3cM7wHhA1gV3ml6ktF4TFTOrq8piLulQ0qNTuWoO1Fp 2gLac+BXQLEiTjACIrVO/oMxMTcIwq/6rx62VmFMvZ0I99UjKSwfBsm9aaEswvewHt oWStZfXwTBCQ/X4HSnlvLBPH+dKU4Ncuu/zkydcOQ27XLPVa0OhuOpWV8vtb+q8H2T cOkezevQ61uraG2FtwB005uzK1ytXtiB7lOaU3ZJ0nbWsA5FKdT+YbfJrPPMJjsLGP 4oUvukunlKnsg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 81F0868A96; Sun, 14 Dec 2025 10:55:11 -0700 (MST) From: Simon Glass <sjg@u-boot.org> To: U-Boot Concept <concept@u-boot.org> Date: Sun, 14 Dec 2025 10:54:25 -0700 Message-ID: <20251214175449.3799539-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251214175449.3799539-1-sjg@u-boot.org> References: <20251214175449.3799539-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 27KZRZWDWCDCS2BWYQUL7U62XAHMCZK6 X-Message-ID-Hash: 27KZRZWDWCDCS2BWYQUL7U62XAHMCZK6 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt <xypron.glpk@gmx.de>, Simon Glass <simon.glass@canonical.com> X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 03/21] sandbox: serial: Report output failurs List-Id: Discussion and patches related to U-Boot Concept <concept.u-boot.org> Archived-At: <https://lists.u-boot.org/archives/list/concept@u-boot.org/message/27KZRZWDWCDCS2BWYQUL7U62XAHMCZK6/> List-Archive: <https://lists.u-boot.org/archives/list/concept@u-boot.org/> List-Help: <mailto:concept-request@u-boot.org?subject=help> List-Owner: <mailto:concept-owner@u-boot.org> List-Post: <mailto:concept@u-boot.org> List-Subscribe: <mailto:concept-join@u-boot.org> List-Unsubscribe: <mailto:concept-leave@u-boot.org> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit |
| Series |
test: Add support for passing arguments to C unit tests
|
|
Commit Message
Simon Glass
Dec. 14, 2025, 5:54 p.m. UTC
From: Simon Glass <simon.glass@canonical.com> When characters cannot be sent to the serial port, return an error code so that the uclass can try again. This fixes a problem with gnome-terminal which seems to get behind and then drop output when a large amount of output is produced quickly (e.g. 100K in under a second). Since sandbox often writes to the device one character at a time it does place a substantial load on the other end of the PTY. Quite possibly it does not empty the pipe quickly enough and so writing to the PTY fails. Signed-off-by: Simon Glass <simon.glass@canonical.com> --- drivers/serial/sandbox.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/serial/sandbox.c b/drivers/serial/sandbox.c index cc0491bc3c8..227524ae911 100644 --- a/drivers/serial/sandbox.c +++ b/drivers/serial/sandbox.c @@ -94,13 +94,16 @@ static void sandbox_print_color(struct udevice *dev) static int sandbox_serial_putc(struct udevice *dev, const char ch) { struct sandbox_serial_priv *priv = dev_get_priv(dev); + ssize_t ret; if (ch == '\n') priv->start_of_line = true; if (sandbox_serial_enabled) { sandbox_print_color(dev); - os_write(1, &ch, 1); + ret = os_write(1, &ch, 1); + if (ret != 1) + return -EAGAIN; } _sandbox_serial_written += 1; return 0; @@ -120,6 +123,8 @@ static ssize_t sandbox_serial_puts(struct udevice *dev, const char *s, ret = os_write(1, s, len); if (ret < 0) return ret; + if (ret != len) + return -EAGAIN; } else { ret = len; }