From patchwork Tue Jan 20 23:43:35 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1724 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=1768952724; bh=w22o4FLZZE64vxlzrOgWuEYJ58ivE5qP6sOgKu7JNig=; 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=UdEMTN+nl7LcopcLKgbYUjMg4Om85+gFSIPCgVU5w9gle37Aaz+vB0J+jloXI27PD IAyhgX3c1izIvXfZ0thgzTW/5mxF+QaxM8Z7a0lDiGyoN9FewilIE5meVGzCrYfpMb EwSmwVPWSvPK/gYsgUxyWtat8nr04M5BGU+IOaf3HJyWyQzApFLNYwfSjslLs1PtwV 4boreuFlsIOZKFRb3S/JAJAq8/QY4InQbSnQzUZv90Dv4bg7jeJNvdFA6wk1rcGhF3 L20XyPZ4D+t7t9RDO3f4lO4uP5uHOdLxeYgSyPNFCzOD9klBX17wENB9XdgQ+H/k6L vPBCRF+PbUuuQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A2FB069555 for ; Tue, 20 Jan 2026 16:45:24 -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 CprufIxd2dNK for ; Tue, 20 Jan 2026 16:45:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768952724; bh=w22o4FLZZE64vxlzrOgWuEYJ58ivE5qP6sOgKu7JNig=; 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=UdEMTN+nl7LcopcLKgbYUjMg4Om85+gFSIPCgVU5w9gle37Aaz+vB0J+jloXI27PD IAyhgX3c1izIvXfZ0thgzTW/5mxF+QaxM8Z7a0lDiGyoN9FewilIE5meVGzCrYfpMb EwSmwVPWSvPK/gYsgUxyWtat8nr04M5BGU+IOaf3HJyWyQzApFLNYwfSjslLs1PtwV 4boreuFlsIOZKFRb3S/JAJAq8/QY4InQbSnQzUZv90Dv4bg7jeJNvdFA6wk1rcGhF3 L20XyPZ4D+t7t9RDO3f4lO4uP5uHOdLxeYgSyPNFCzOD9klBX17wENB9XdgQ+H/k6L vPBCRF+PbUuuQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8F41B695AD for ; Tue, 20 Jan 2026 16:45:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768952723; bh=Rj1CcwrH8XTEUYhPN3L8+q4p+ibe8y37dg/CflkMEd4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nq09m9vKoqsRZenJ1w7nTlS30dL/Q69eELW+sW6coa+w436DFUNGF51TKbTIy6c4e 4yXDBrcyBEWJgGRmSvUKRhtQpQpE5IIxIFHiLP4Y8vb3P+UghDJhmtf1BhncxvqeXT 8Cd3cfqzXR+nNVtZs9tgayoofCZ+ttWAfUwTSEBXnwdGHO3knYm+bqEtfhrblRAfE2 PXcGFiA3k42B9nHrYE8o6gD7tZQjAVH7m9Ep7n7+YhS9hDtNETXOd39GLh3oNedy/G WC44YFXkK9eqgJv8oxYW70JL+j9W8TVKpmRwZT9PHcvtaoZSWEg/iWK0nvtcjCrEuP PKQIwnebcxfYw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 559CF69597; Tue, 20 Jan 2026 16:45:23 -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 t5O00W7bUyPt; Tue, 20 Jan 2026 16:45:23 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768952719; bh=B9a4PgojkTZJQq+B/4CLucmpol2n31u/9M4c+3ASO7M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C/u1AwHiEyNKjOwcFO//5bLZBIK3CL7P4M/qz2FcRE5isbq+akSxZ9/I5mkeqAH6B yqkNfi0hyqUYhPVMBULZ4shxrlTCs48wF9sw+WoazS2GUy7Ub6Z42t3numrHyQ7e5V 0Dyvpp/vK2R2jNwUbYuVoF0noF4JZGIEyr8h92UlGomqA6YcjHie37pWXWJETC2nEO fcCfdMMftRwq9wREJLbqmEyDpT2fSqjfNrl4C0ZSsLa+3fyjGYGdfB26l/fTB/7Ar2 Or6sbKEBmIeLRSKwqurQnD41sNGSQyHQi6KahSzyMwgSW4eC5QNxjwzoRMxUEepi74 YJcaPa0rGayPA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 0677F69555; Tue, 20 Jan 2026 16:45:18 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 20 Jan 2026 16:43:35 -0700 Message-ID: <20260120234344.495605-16-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260120234344.495605-1-sjg@u-boot.org> References: <20260120234344.495605-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: FYKT3PSNZKDIHIDT77RSU5L3NJWQRXTD X-Message-ID-Hash: FYKT3PSNZKDIHIDT77RSU5L3NJWQRXTD 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 15/17] ext4l: Move lock and scheduler stubs to proper headers 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 Move mutex_lock_io() to linux/mutex.h where the Linux kernel defines it. Move spin_needbreak() to linux/spinlock.h where the Linux kernel defines it. Move cond_resched_lock() to linux/sched.h where the Linux kernel defines it. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 3 +-- include/linux/mutex.h | 1 + include/linux/sched.h | 1 + include/linux/spinlock.h | 3 +++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 1ac7b63819a..5ab32cba969 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1320,8 +1320,7 @@ struct disk_partition *ext4l_get_partition(void); /* DEFINE_WAIT stub - creates a wait queue entry */ #define DEFINE_WAIT(name) int name = 0 -/* cond_resched_lock - conditionally reschedule while holding a lock */ -#define cond_resched_lock(lock) do { (void)(lock); } while (0) +/* cond_resched_lock is in linux/sched.h */ /* JBD2 journal.c stubs */ /* alloc_buffer_head, __getblk are in linux/buffer_head.h */ diff --git a/include/linux/mutex.h b/include/linux/mutex.h index b13d85ef4e9..2246feaf261 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h @@ -25,6 +25,7 @@ struct mutex { #define mutex_trylock(lock) ({ 1; }) #define mutex_is_locked(lock) ({ 0; }) #define mutex_destroy(lock) do { } while (0) +#define mutex_lock_io(lock) mutex_lock(lock) #define __MUTEX_INITIALIZER(lockname) { .locked = 0 } diff --git a/include/linux/sched.h b/include/linux/sched.h index 579468ee414..9dca8f89f79 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -35,6 +35,7 @@ extern struct task_struct *current; #define TASK_UNINTERRUPTIBLE 2 #define cond_resched() do { } while (0) +#define cond_resched_lock(lock) do { (void)(lock); } while (0) #define yield() do { } while (0) /* Note: schedule() is implemented in common/cyclic.c */ diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 75afad92b9e..09fe285dfed 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h @@ -78,6 +78,9 @@ typedef struct { /* Assert variants */ #define assert_spin_locked(lock) do { } while (0) +/* spin_needbreak - check if lock should be released (always false in U-Boot) */ +#define spin_needbreak(lock) ({ (void)(lock); 0; }) + /* Read-write lock type - just an int for U-Boot */ typedef int rwlock_t;