From patchwork Wed Jan 14 22:56:12 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1516 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=1768431507; bh=jhvNcFIYpAiMWZjvSq8G2bx/WT+snuDVQWFody5DiEg=; 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=DJiFN33NOdBzRkoSoRwXVZ0BTEj9R0RCq1HJ/X+dDcJKfE0u02jgFdSMCNj4xR5rP Pq3tqYd29xnITbH42kivtnU4IXb2rJKun4aZB8KHQ6kWKbDlQcgErQl3aROY+3Dqn1 KXFfC6GcO0Eo6mZpNTrvGfUFB6KaQkD7KCbc5IwAIZfdyTK+gnBLLwugT+pzsevBWQ MAzcukd4IPUho0e7Tp7uwxZZP89+s3p9rrsjb9WHhSzqdSFcrNf1vMwHvpW3f2KZ1n WOamiGD3MbbqxItI/29CxviR9qCGWkDIkVgOPHSetS0V0VQEa1gtOt1GA9pmprkbfA 2eoqbl1jyzRug== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CF68B6935F for ; Wed, 14 Jan 2026 15:58:27 -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 DF1-ZQ2uREjr for ; Wed, 14 Jan 2026 15:58:27 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431507; bh=jhvNcFIYpAiMWZjvSq8G2bx/WT+snuDVQWFody5DiEg=; 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=DJiFN33NOdBzRkoSoRwXVZ0BTEj9R0RCq1HJ/X+dDcJKfE0u02jgFdSMCNj4xR5rP Pq3tqYd29xnITbH42kivtnU4IXb2rJKun4aZB8KHQ6kWKbDlQcgErQl3aROY+3Dqn1 KXFfC6GcO0Eo6mZpNTrvGfUFB6KaQkD7KCbc5IwAIZfdyTK+gnBLLwugT+pzsevBWQ MAzcukd4IPUho0e7Tp7uwxZZP89+s3p9rrsjb9WHhSzqdSFcrNf1vMwHvpW3f2KZ1n WOamiGD3MbbqxItI/29CxviR9qCGWkDIkVgOPHSetS0V0VQEa1gtOt1GA9pmprkbfA 2eoqbl1jyzRug== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BDA6669345 for ; Wed, 14 Jan 2026 15:58:27 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431506; bh=N1ooO7Mm1brEoCtPxuR1bR2L8c7J8UlUuYJC6jjXmQk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FrcENL+KlWKgYWbfEqlh8c4CzLQ5KkieKeT8ProICNToYsCoB2XL8YsMzIN0jWIW1 U64FKeHPYsCG/4p79BuMKj8t5njfw9hnfXpq9pUMH1wRJACixGWBCFVBHA6wimmEID vhkcxF+AtNrCLApm++GWxZjkFJdG2wjnUCYH/fLxoP69g6C5JGucgxPxlJ8qlYUIgE RKmVERjCnGc9kLfBlhS9D4PD+4i0BGWA+O7R254StnuYotQtuE6FBq/nIupSYg8Cav BIdpTg76ERUMcN6kjEaargi9NtBSgdC6ayPlJhiQeFsDmLwwaNkFHWfx/wzF6YiX1R M7TXIILlcReGg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1F3F96913F; Wed, 14 Jan 2026 15:58:26 -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 XlCPLvl0jQfa; Wed, 14 Jan 2026 15:58:26 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431502; bh=NbG9G5hx/pZDfNEY5NlnXkrez4QXr+7k7o6q6CmPLUc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fhgps9PS9LESn1Doyi9JetpgiYX94m0DUGrzmdcNwEOhAyTKfcymO4eZF0wiGLRh+ 17rOKO0rXYIzB+r4rDo1X0oyzsLfeUrZJqjZQMQyMxxjcj/E4y43nC1Y5Z20GSR99I E3pwQQKObtezIqmMk4IvcFQ6H8rNbZL54MXqZVzYTS/WV2LnrxEej3Sx/ieivMcn8y F3zIoMaKc4xWg81wTDKZDW4M/2xdiFEV9JsnyE9uHG8hoe8z76l4+3hCjADA5w0iyc sJy8abng1m7v51N0C6O+sgnXGBtXJfDTgTAUxMjiGq8NFVGNfLBXj0rE6cI259/44Y f22Z56PJXA0Pw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B9E16692EF; Wed, 14 Jan 2026 15:58:21 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:12 -0700 Message-ID: <20260114225635.3407989-23-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: NRKPXY536MQ3NDK4CFSRPKM5ZYXWSFGO X-Message-ID-Hash: NRKPXY536MQ3NDK4CFSRPKM5ZYXWSFGO 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 22/34] ext4l: Create linux/lockdep.h for lock dependency 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 a new linux/lockdep.h header to consolidate all the scattered lockdep stubs from ext4_uboot.h. This includes lock_class_key, lockdep_map, and all the lockdep assertion macros. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 22 ++++++---------------- include/linux/lockdep.h | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 16 deletions(-) create mode 100644 include/linux/lockdep.h diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 4c214fa5bdc..ce40888879e 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -123,11 +123,7 @@ struct kobject { }; /* lockdep stubs - needed before jbd2.h is included */ -struct lockdep_map { int dummy; }; -struct lock_class_key { int dummy; }; -#define rwsem_acquire(l, s, t, i) do { } while (0) -#define rwsem_acquire_read(l, s, t, i) do { } while (0) -#define rwsem_release(l, i) do { } while (0) +#include #define _THIS_IP_ ((unsigned long)0) /* completion - use Linux header */ @@ -388,8 +384,7 @@ int __ext4_xattr_set_credits(struct super_block *sb, struct inode *inode, /* RCU head for callbacks - defined in linux/compat.h as callback_head */ -/* lockdep stubs */ -#define lockdep_is_held(lock) (1) +/* lockdep_is_held is in linux/lockdep.h */ /* Memory allocation - use linux/slab.h which is already available */ #include @@ -938,8 +933,7 @@ struct dx_hash_info { /* WARN_ON, WARN_ON_ONCE, WARN_ONCE are in linux/bug.h */ /* pr_warn_once is in linux/printk.h */ -/* lockdep stubs */ -#define lockdep_assert_held_read(l) do { (void)(l); } while (0) +/* lockdep_assert_held_read is in linux/lockdep.h */ /* strtomem_pad - copy string to fixed-size buffer with padding */ #define strtomem_pad(dest, src, pad) do { \ @@ -987,9 +981,7 @@ static inline unsigned long memweight(const void *ptr, size_t bytes) #define inode_trylock_shared(inode) (1) #define inode_dio_wait(inode) do { } while (0) -/* Lock debugging - no-ops in U-Boot */ -#define lockdep_assert_held_write(l) do { } while (0) -#define lockdep_assert_held(l) do { } while (0) +/* Lock debugging stubs are in linux/lockdep.h */ /* File operations */ #define file_modified(file) ({ (void)(file); 0; }) @@ -2502,8 +2494,7 @@ struct wait_bit_entry { #define release_dentry_name_snapshot(snap) \ do { (void)(snap); } while (0) -/* lockdep stubs */ -#define lockdep_assert_not_held(lock) do { (void)(lock); } while (0) +/* lockdep_assert_not_held is in linux/lockdep.h */ /* Request flags for block I/O */ #define REQ_IDLE 0 @@ -2591,8 +2582,7 @@ loff_t seq_lseek(struct file *f, loff_t o, int w); ({ (void)(n); (void)(m); (void)(p); (void)(ops); (void)(d); (struct proc_dir_entry *)NULL; }) #define remove_proc_entry(n, p) do { (void)(n); (void)(p); } while (0) -/* lockdep stubs (struct lock_class_key defined earlier) */ -#define lockdep_init_map(...) do { } while (0) +/* lockdep_init_map and lock_class_key are in linux/lockdep.h */ /* Block device operations for journal.c */ int bh_read(struct buffer_head *bh, int flags); diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h new file mode 100644 index 00000000000..e95b6d171ad --- /dev/null +++ b/include/linux/lockdep.h @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Lock dependency validator stubs for U-Boot + * + * U-Boot is single-threaded, so lock dependency checking is not needed. + * These stubs allow Linux kernel code to compile unchanged. + */ +#ifndef _LINUX_LOCKDEP_H +#define _LINUX_LOCKDEP_H + +/* Lock class key - used for lockdep annotations */ +struct lock_class_key { + int dummy; +}; + +/* Lockdep map - used for lock tracking */ +struct lockdep_map { + int dummy; +}; + +/* Lockdep assertion macros - all no-ops in U-Boot */ +#define lockdep_is_held(lock) (1) +#define lockdep_assert_held(lock) do { (void)(lock); } while (0) +#define lockdep_assert_held_read(lock) do { (void)(lock); } while (0) +#define lockdep_assert_held_write(lock) do { (void)(lock); } while (0) +#define lockdep_assert_not_held(lock) do { (void)(lock); } while (0) + +/* Lockdep initialisation and tracking - no-ops */ +#define lockdep_init_map(...) do { } while (0) + +/* RW semaphore lockdep stubs */ +#define rwsem_acquire(l, s, t, i) do { } while (0) +#define rwsem_acquire_read(l, s, t, i) do { } while (0) +#define rwsem_release(l, i) do { } while (0) + +#endif /* _LINUX_LOCKDEP_H */