From patchwork Sun Dec 14 17:54:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 895 Return-Path: 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=1765734913; bh=OmfPav9vrXOD3HDZLwjZF2oa6sF2tIOwyLyOVh+4uvY=; 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=LnKv0Hi+/cQAdUE9esWCi+mZyB+qzBHld3j5fJZdyZTWqGbqYPA5EreSxrGdi4Qlx N0YSQpUVUaJ2zSfk7+aKnWM0wvQlGlqLBjD1p0atA2lZ28EXmKTXeCEr3Yo/xq3v+V skQyaDmrVUos8M5X2WMxUWSMzSBn9stNc4HoQSzoIsrpU/MWSZ7dj/EIubdNd7qcXx NsgSdca70HvRvKG4eMj3rRivy4t1qbxkdil8fLg+QkFE0QzE7sbBlIdHE05SY5DxdW KZEfzPu6MZjsaSYjbBHfJoyE2hNRlrJZX/U1hLi2zGEnAKtQehwJwrorNDNZBNrlgi migmm5glIB92Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 294CF68B08 for ; Sun, 14 Dec 2025 10:55:13 -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 FZ_s4IzSpDtj for ; 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=1765734913; bh=OmfPav9vrXOD3HDZLwjZF2oa6sF2tIOwyLyOVh+4uvY=; 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=LnKv0Hi+/cQAdUE9esWCi+mZyB+qzBHld3j5fJZdyZTWqGbqYPA5EreSxrGdi4Qlx N0YSQpUVUaJ2zSfk7+aKnWM0wvQlGlqLBjD1p0atA2lZ28EXmKTXeCEr3Yo/xq3v+V skQyaDmrVUos8M5X2WMxUWSMzSBn9stNc4HoQSzoIsrpU/MWSZ7dj/EIubdNd7qcXx NsgSdca70HvRvKG4eMj3rRivy4t1qbxkdil8fLg+QkFE0QzE7sbBlIdHE05SY5DxdW KZEfzPu6MZjsaSYjbBHfJoyE2hNRlrJZX/U1hLi2zGEnAKtQehwJwrorNDNZBNrlgi migmm5glIB92Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1910F68AEA for ; 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=/PIWNU5WRgDgGaM64Ppwjniu92DFEuRJzc/+n25wekY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A9ggy7d69/OVopCGPXSTkj0152ppmrntwoZxx2CqzKwBLHDuTOAcgruE0hFzv2Lyh E/wFg2iZRarvHTLGgRTA/kA6D0tL48CfFmIqTUM8D1hrMJPKFK9GHHpqj3joNezk9Z bT91jEwgOLjschiZsavEbnwX4PSiZxFqwXYlBQPnhtboax9xUjhHXu037S8PBZvRIN gn0obVIMj5DeaYWT5VIW073cCAleyzk9MI5H+45eMFXm7tb7n9oUtfop/STvsckIDO xJSaLY3QRTKWsKZilk8Ko8P+OFGDW/4pnoVztf+IuNFLd3dEmfie5QTX4pmZiu+ZdO pI8qcQ3mrEDFg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0C01E68AC0; 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 wHzbZ3j0evQR; Sun, 14 Dec 2025 10:55:11 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765734907; bh=syP0b505fupAW33r1DzlYu/7xh2X2JcKp+cC1wbfbVk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DF/3xjZHq+9PatWZx0BqAHwR3ow32REMtqfyPcsSIiWzY0Co0pZotzesTGcG/tmIu s8nfR7kh8a/uY0AmjaxMVFOCzmeboSRx9SZI6vmnkltyMda5M0ystjBtO3Hl+Erd0w 6imTHBdFjjSrD0HRUaM8nePiMHsOt47sh+6jCpmiNmNv/i9UrjJ/8lPxclSQg1/mIK mlnuiaTrgOp9DIQHs3EYLoKRY0xdMRui6aatuW0YQUPOu4zQcRJJ9cswmqSEN42gZr K1Gv92tXmq+TROhx6xx93PVaJx2H70508K6AQYjiOwdWOo/abbBNLYBg9j1NAOzli0 MnT1VeTIJDOEA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E3EBE68A91; Sun, 14 Dec 2025 10:55:06 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 14 Dec 2025 10:54:24 -0700 Message-ID: <20251214175449.3799539-3-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: MGMP57TXKVCCJCBH4ZS2YMSSHSMRLYUT X-Message-ID-Hash: MGMP57TXKVCCJCBH4ZS2YMSSHSMRLYUT 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 , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 02/21] serial: Retry output if it fails List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass If something goes wrong when writing to the serial device, take notice of the error code and try again, if needed. Signed-off-by: Simon Glass --- drivers/serial/serial-uclass.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c index 8644d210770..8d330d687a3 100644 --- a/drivers/serial/serial-uclass.c +++ b/drivers/serial/serial-uclass.c @@ -271,6 +271,8 @@ static int __serial_puts(struct udevice *dev, const char *str, size_t len) do { ssize_t written = ops->puts(dev, str, len); + if (written == -EAGAIN) + continue; if (written < 0) return written; str += written;