From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v2 13/20] include: linux/idr.h: implement more Linux API
Date: Thu, 30 Nov 2023 21:37:23 +0100 [thread overview]
Message-ID: <20231130203723.GD963049@pengutronix.de> (raw)
In-Reply-To: <20231122172951.376531-14-a.fatoum@pengutronix.de>
On Wed, Nov 22, 2023 at 06:29:44PM +0100, Ahmad Fatoum wrote:
> Upcoming sync of SCMI with the kernel will start using IDR API, which we
> lack in barebox, so let's retrofit it.
>
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> v1 -> v2:
> - factor out longer IDR functions into separate source file
> instead of header
> - add IDR Kconfig symbol
> - fix implementation of idr_remove, idr_destory, idr_for_each_entry
> - keep IDR sorted
There's a bug in this patch. With this one applied my Rock3a fails with:
SCMI DRIVER - Requesting SCMI device (clocks) for protocol 0x14
SCMI DRIVER - Requesting SCMI device (regulator) for protocol 0x17
scmi_protocol_device_request: id_table: 0x0000000000000018
scmi_protocol_device_request: name: 0x00786f6265726162
DABT (current EL) exception (ESR 0x96000004) at 0x00786f6265726162
elr: 000000007fd6b8c8 lr : 000000007fd6c3a0
x0 : 00786f6265726162 x1 : 00786f6265726161
x2 : 00786f6265726162 x3 : 00000000ffffffff
x4 : 00000000ffffffff x5 : 0000000000000000
x6 : 00000000ffffffd8 x7 : 000000007fff7a52
x8 : 000000007fff7e48 x9 : 0000000000000020
x10: 0000000000000000 x11: 0000000000000011
x12: 0000000000000010 x13: 000000007fdb34fa
x14: 0000000000000000 x15: 0000000000000007
x16: 000000007fff77b8 x17: 0000000000000007
x18: 000000007fff7e80 x19: 000000007fff7a3e
x20: 00000000ffffffff x21: 00786f6265726162
x22: 000000007fff7e3a x23: 0000000000000000
x24: 000000007fd90dbd x25: 000000007fff7a20
x26: 000000007fff7e80 x27: 000000007fff7e3a
x28: 000000007fff7e80 x29: 000000007fff7910
Call trace:
[<7fd6b8c8>] (strnlen+0x10/0x28) from [<7fd6ca90>] (vsnprintf+0x440/0x71c)
[<7fd6ca90>] (vsnprintf+0x440/0x71c) from [<7fd01198>] (printf+0x6c/0x90)
[<7fd01198>] (printf+0x6c/0x90) from [<7fd5dabc>] (scmi_protocol_device_request+0x154/0x320)
[<7fd5dabc>] (scmi_protocol_device_request+0x154/0x320) from [<7fd5ca38>] (scmi_driver_register+0x34/0x84)
[<7fd5ca38>] (scmi_driver_register+0x34/0x84) from [<7fd59920>] (scmi_drv_register+0x14/0x1c)
[<7fd59920>] (scmi_drv_register+0x14/0x1c) from [<7fd01a2c>] (start_barebox+0x60/0x8c)
[<7fd01a2c>] (start_barebox+0x60/0x8c) from [<7fd8e71c>] (barebox_non_pbl_start+0x11c/0x150)
[<7fd8e71c>] (barebox_non_pbl_start+0x11c/0x150) from [<7fd0000c>] (__bare_init_start+0x0/0x4)
[<7fd0000c>] (__bare_init_start+0x0/0x4) from [<00a01b3c>] (0xa01b3c)
[<00a01b3c>] (0xa01b3c) from [<00a014ec>] (0xa014ec)
The above was printed with these printfs added to scmi_protocol_device_request():
list_for_each_entry(rdev, head, node) {
printf("%s: id_table: 0x%p\n", rdev->id_table);
printf("%s: name: 0x%p\n", rdev->id_table_name);
if (!strcmp(rdev->id_table->name, id_table->name)) {
...
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2023-11-30 20:39 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-22 17:29 [PATCH v2 00/20] prepare for porting OP-TEE communication support Ahmad Fatoum
2023-11-22 17:29 ` [PATCH v2 01/20] include: provide linux/errno.h Ahmad Fatoum
2023-11-22 17:29 ` [PATCH v2 02/20] include: add linux/refcount.h Ahmad Fatoum
2023-11-22 17:29 ` [PATCH v2 03/20] bitops: split off linux/bits.h Ahmad Fatoum
2023-11-22 17:29 ` [PATCH v2 04/20] include: import <linux/instruction_pointer.h> Ahmad Fatoum
2023-11-22 17:29 ` [PATCH v2 05/20] asm-generic: split off typeconfused readl and friends Ahmad Fatoum
2023-11-22 17:29 ` [PATCH v2 06/20] asm-generic: migrate relaxed helpers into asm-generic/io.h Ahmad Fatoum
2023-11-22 17:29 ` [PATCH v2 07/20] include: add linux/io.h with strict prototypes Ahmad Fatoum
2023-11-22 17:29 ` [PATCH v2 08/20] include: import Linux word-at-a-time.h Ahmad Fatoum
2023-11-23 8:16 ` [PATCH] fixup! " Ahmad Fatoum
2023-11-22 17:29 ` [PATCH v2 09/20] string: implement strscpy Ahmad Fatoum
2023-11-22 17:29 ` [PATCH v2 10/20] of: add CONFIG_OF for Linux compatibility Ahmad Fatoum
2023-11-22 17:29 ` [PATCH v2 11/20] include: asm-generic/atomic.h: define atomic_cmpxchg Ahmad Fatoum
2023-11-22 17:29 ` [PATCH v2 12/20] kbuild: build barebox for -std=gnu11 Ahmad Fatoum
2023-11-22 17:29 ` [PATCH v2 13/20] include: linux/idr.h: implement more Linux API Ahmad Fatoum
2023-11-30 20:37 ` Sascha Hauer [this message]
2023-11-22 17:29 ` [PATCH v2 14/20] test: self: add simple IDR test Ahmad Fatoum
2023-11-22 17:29 ` [PATCH v2 15/20] include: implement dev_warn_once and friends Ahmad Fatoum
2023-11-22 17:29 ` [PATCH v2 16/20] include: add blocking notifier aliases Ahmad Fatoum
2023-11-22 17:29 ` [PATCH v2 17/20] include: add Linux ktime API Ahmad Fatoum
2023-11-22 17:29 ` [PATCH v2 18/20] of: constify string pointed to by struct of_device_id::compatible Ahmad Fatoum
2023-11-22 17:29 ` [PATCH v2 19/20] of: define of_devices_ensure_probed_by_compatible Ahmad Fatoum
2023-11-22 17:29 ` [PATCH v2 20/20] include: add linux/device.h wrapper around driver.h Ahmad Fatoum
2023-11-23 14:50 ` [PATCH v2 00/20] prepare for porting OP-TEE communication support Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231130203723.GD963049@pengutronix.de \
--to=sha@pengutronix.de \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox