From patchwork Sun Jan 18 20:37:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1586 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=1768768755; bh=v2FyVoUiSd9qerqIpILR/QQRj0lbhbWBn25ZlnORitM=; 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=EBdhfGB9A9qjrrJ6vNOb2pLvKUC2oRkNB5fslP2oKER27yt9K1nZk2RKKvcwQt/ID qN2npRr4Rurv7xn31oghBjXTuvpd77LFnWxXiqzZQk9fYBfm4Qj8jC+q4RmBGGHPr0 ZzmZl2skAT6HLbXILQCTxk44N/uIsrxqhO3JYqxWtBY+VDM0ofjy7vFxBcXagMZ304 nlCUKLvZ9ID1RCLK2joT3Qj6s2envouVmFY/HtSoFCee3Z6bapt15arA3qdn5A5ziP EEQKUFPgxmJtW2DIHPNOhUlQ+Lk8ZgM2oPZbRYSCEmqa6/ztRaalZpw9Vm3xuo4s9Z fFvJamGJ2vdcQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 10893693A2 for ; Sun, 18 Jan 2026 13:39: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 kMk79Eom2UoP for ; Sun, 18 Jan 2026 13:39:15 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768768754; bh=v2FyVoUiSd9qerqIpILR/QQRj0lbhbWBn25ZlnORitM=; 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=ub0M5ktdSrnYXrIpqbI6Ybz7+QheXjFzbjhp8RsZck/JesoiLsGF6dPotqhFRRUef LqNS66D2L0TQzxsiqIBVsN0nc9H3TatUjPNihG5RhkNyOBDgq8QQYrbKWA4j9qjEU/ E/oQ0EarBE829TRdSyWO631+J5b5MDBUCobTV3pqtdaPoSKuJYhdmqEFLf/4PkYkyi tQ4gFG31/VRWXxIq+so/sKe57lcHqB+qv5uKVbhYQwYBmReSALlj1A5zwMf8hsZGFL PWa+kBRvT59KC5BDS1p6GMliGbsZCNkFVeu4SUkeLfa0X5hqpaKX5W8241QVV9a+nz KOJ5XMnZdA1jQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E21EC6919C for ; Sun, 18 Jan 2026 13:39:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768768751; bh=o6uHWXmhnaOTI6uQv1QzC1YwO0G3+cycRlB/Z+oHwBY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TZ5ALV2zoBMvfjuxIxpsapblrDXdYd0qbQVcQ8Bi2t2ET80ci+4KaVm+16LBnJYxc HC4CikcEu9nh9i7YBtQubusxh59ZNT0SjKZZv/gWE/otJs+XetUe7d/saF7GyREo1J ddW5vuh/pL5pwMRp8RpVEuZRN9TOloDO/7eMP9iUSOiFxmuHW8eqgvBBvZa8kMTJoi 9ohiGn8lEX/J2wF8YZ6c7MBqV/OCAHjcFqRGkcI2+teftOyGf9fMUkInyhdRsZYlV4 STHu8GhhHHSz8NYb99RC15EYbIxiKpFuYjeToHfpsyGYZrjd7Tq3oDIHds18Rff4b6 rP5k8E0F3A7mw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 93A046919C; Sun, 18 Jan 2026 13:39:11 -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 sVOcWV_-uIx5; Sun, 18 Jan 2026 13:39:11 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768768747; bh=NSjFZusQZPptT0nE+k66Mjacb7gUFduza2ZSEUZFd80=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A1cbXUr02eYAocT4Fa83L6Rq21TrCRxRD7d135jL/ZpcEp7zvi3Ahn7rksvFvcUD9 Nxwa6f+B663TgvcxnNruZ3l0RBbkFoZlFKimzuWIcpiLLw6TaUfaLedG8UMF+pE5Qk 07uVf3TTXHbG5S5QmvehNdbf+0S55ZkOtnU5F2vpW3Y5IjbLrLPcSP+mFHiGcxY4oT Z94YVoOoG1Mci3F3Uqv8VeolLhPs92+ixcoHUMXacObiQpZapQZmNzAn1ovV2acngA bdBDn4gXvfU6G/xPpqnVaqV8TKGsd1PAHJeLrg7TUwZZZ2XjFrauoiLrQyi8uZKjmp RQl+kwe928xpw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id AF3CB69382; Sun, 18 Jan 2026 13:39:06 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 13:37:29 -0700 Message-ID: <20260118133734.7.73f5317cb9c72a1edf9cb4a73f3e67d5f1d94382@changeid> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260118203739.1974323-1-sjg@u-boot.org> References: <20260118203739.1974323-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: HSA566SXHGMHMMF4KTWV4L3ESIP4KHYF X-Message-ID-Hash: HSA566SXHGMHMMF4KTWV4L3ESIP4KHYF 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: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 07/12] linux: Add wait_bit.h header with wait bit stubs 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 Create linux/wait_bit.h with wait_bit_entry structure and wait bit operation stubs. These are no-ops in U-Boot's single-threaded environment. Update ext4_uboot.h to use the new header instead of duplicating these definitions. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 21 ++++-------------- include/linux/wait_bit.h | 47 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 17 deletions(-) create mode 100644 include/linux/wait_bit.h diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index ba90cce3e67..102f03fe002 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -213,7 +213,7 @@ extern struct user_namespace init_user_ns; #define mark_buffer_dirty_inode(bh, i) sync_dirty_buffer(bh) #define mark_buffer_dirty(bh) sync_dirty_buffer(bh) struct buffer_head *sb_getblk(struct super_block *sb, sector_t block); -#define wait_on_bit_io(addr, bit, mode) do { (void)(addr); (void)(bit); (void)(mode); } while (0) +/* wait_on_bit_io is now in linux/wait_bit.h */ /* inode_needs_sync - stub */ #define inode_needs_sync(inode) (0) @@ -1685,20 +1685,8 @@ bool __folio_start_writeback(struct folio *folio, bool keep_write); * Stubs for fast_commit.c */ -/* Wait bit operations - stubbed for single-threaded U-Boot */ -struct wait_bit_entry { - struct list_head wq_entry; -}; -#define DEFINE_WAIT_BIT(name, word, bit) \ - struct wait_bit_entry name = { } -#define bit_waitqueue(word, bit) \ - ({ (void)(word); (void)(bit); (wait_queue_head_t *)NULL; }) -#define prepare_to_wait(wq, wait, state) \ - do { (void)(wq); (void)(wait); (void)(state); } while (0) -#define prepare_to_wait_exclusive(wq, wait, state) \ - do { (void)(wq); (void)(wait); (void)(state); } while (0) -#define finish_wait(wq, wait) \ - do { (void)(wq); (void)(wait); } while (0) +/* Wait bit operations - use linux/wait_bit.h */ +#include /* Dentry name snapshot operations are now in linux/dcache.h */ @@ -1708,8 +1696,7 @@ struct wait_bit_entry { #define REQ_IDLE 0 #define REQ_PREFLUSH 0 -/* wake_up_bit - wake up threads waiting on a bit */ -#define wake_up_bit(word, bit) do { (void)(word); (void)(bit); } while (0) +/* wake_up_bit is now in linux/wait_bit.h */ /* d_alloc, d_drop are now in linux/dcache.h */ diff --git a/include/linux/wait_bit.h b/include/linux/wait_bit.h new file mode 100644 index 00000000000..ace3fbc1763 --- /dev/null +++ b/include/linux/wait_bit.h @@ -0,0 +1,47 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Wait bit definitions for U-Boot + * + * Based on Linux wait_bit.h - wait on a bit to be cleared/set. + * U-Boot stubs for single-threaded environment. + */ +#ifndef _LINUX_WAIT_BIT_H +#define _LINUX_WAIT_BIT_H + +#include +#include +#include + +/** + * struct wait_bit_entry - wait queue entry for bit waits + * @wq_entry: wait queue list entry + * + * U-Boot stub - bit waiting not needed in single-threaded environment. + */ +struct wait_bit_entry { + struct list_head wq_entry; +}; + +/* Wait bit macros - all no-ops in single-threaded U-Boot */ +#define DEFINE_WAIT_BIT(name, word, bit) \ + struct wait_bit_entry name = { } + +#define bit_waitqueue(word, bit) \ + ({ (void)(word); (void)(bit); (wait_queue_head_t *)NULL; }) + +#define prepare_to_wait(wq, wait, state) \ + do { (void)(wq); (void)(wait); (void)(state); } while (0) + +#define prepare_to_wait_exclusive(wq, wait, state) \ + do { (void)(wq); (void)(wait); (void)(state); } while (0) + +#define finish_wait(wq, wait) \ + do { (void)(wq); (void)(wait); } while (0) + +#define wake_up_bit(word, bit) \ + do { (void)(word); (void)(bit); } while (0) + +#define wait_on_bit_io(addr, bit, mode) \ + do { (void)(addr); (void)(bit); (void)(mode); } while (0) + +#endif /* _LINUX_WAIT_BIT_H */