From: Sascha Hauer <s.hauer@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@barebox.org>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v3 3/3] commands: iomem: add support for printing type/attributes
Date: Tue, 10 Jun 2025 12:18:41 +0200 [thread overview]
Message-ID: <aEgGgVGRrprdIWjz@pengutronix.de> (raw)
In-Reply-To: <20250605194401.1841679-3-a.fatoum@barebox.org>
On Thu, Jun 05, 2025 at 09:44:01PM +0200, Ahmad Fatoum wrote:
> To make it easier to verify attributes, let's teach iomem to print the
> newly added information. This intentionally only operates on the
> resources, the mmuinfo command is what should print information actually
> in the page tables.
>
> Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
> ---
> v2 -> v3:
> - new commit
> ---
> commands/iomemport.c | 55 +++++++++++++++++++++++++++++++----
> common/resource.c | 66 ++++++++++++++++++++++++++++++++++++++++++
> include/linux/ioport.h | 3 ++
> 3 files changed, 119 insertions(+), 5 deletions(-)
>
> diff --git a/commands/iomemport.c b/commands/iomemport.c
> index bbe41f571b48..04d7b100a755 100644
> --- a/commands/iomemport.c
> +++ b/commands/iomemport.c
> @@ -6,13 +6,23 @@
> #include <asm/io.h>
> #include <common.h>
> #include <command.h>
> +#include <getopt.h>
> +#include <range.h>
>
> -static void __print_resources(struct resource *res, int indent)
> +static void __print_resources(struct resource *res, int indent,
> + ulong *addr, bool verbose)
> {
> + char buf[64];
> struct resource *r;
> resource_size_t size = resource_size(res);
> int i;
>
> + if (addr && !region_overlap_end(*addr, *addr, res->start, res->end))
> + return;
> +
> + if (verbose)
> + printf("%-58s", resource_typeattr_format(buf, sizeof(buf), res) ?: "");
> +
> for (i = 0; i < indent; i++)
> printf(" ");
>
> @@ -22,26 +32,61 @@ static void __print_resources(struct resource *res, int indent)
> res->name);
>
> list_for_each_entry(r, &res->children, sibling) {
> - __print_resources(r, indent + 1);
> + __print_resources(r, indent + 1, addr, verbose);
> }
> +
> }
>
> -static void print_resources(struct resource *res)
> +static void print_resources(struct resource *res, ulong *addr, bool verbose)
> {
Dropped this patch:
commands/iomemport.c: In function 'do_ioport':
commands/iomemport.c:95:9: error: too few arguments to function 'print_resources'
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:[~2025-06-10 12:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-05 19:43 [PATCH v3 1/3] resource: supply memory type/attrs on all SDRAM requests Ahmad Fatoum
2025-06-05 19:44 ` [PATCH v3 2/3] resource: retire IORESOURCE_BUSY in favor of resource::type Ahmad Fatoum
2025-06-05 19:44 ` [PATCH v3 3/3] commands: iomem: add support for printing type/attributes Ahmad Fatoum
2025-06-10 10:18 ` Sascha Hauer [this message]
2025-06-10 6:42 ` [PATCH v3 1/3] resource: supply memory type/attrs on all SDRAM requests 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=aEgGgVGRrprdIWjz@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=a.fatoum@barebox.org \
--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