Re: [PATCH] irqchip/bcm-6345-l1: show MMIO address

From: Marc Zyngier
Date: Thu Mar 16 2023 - 14:25:37 EST


On 2023-03-16 18:13, Florian Fainelli wrote:
On 3/16/23 11:07, Álvaro Fernández Rojas wrote:
It's safe to show MMIO address.

Signed-off-by: Álvaro Fernández Rojas <noltari@xxxxxxxxx>

This is going to be the kernel virtual address, and while on MIPS it
is easy to resolve to the physical address because these platforms map
registers through KSEG0/1, on other platforms like ARM/ARM64 the
kernel virtual addresses are pretty meaningless unless what you want
to debug is how ioremap() mapped the address.

I would rather do the following change:

diff --git a/drivers/irqchip/irq-bcm6345-l1.c b/drivers/irqchip/irq-bcm6345-l1.c
index 1bd0621c4ce2..832957d363a4 100644
--- a/drivers/irqchip/irq-bcm6345-l1.c
+++ b/drivers/irqchip/irq-bcm6345-l1.c
@@ -261,6 +261,8 @@ static int __init bcm6345_l1_init_one(struct
device_node *dn,
if (!cpu->map_base)
return -ENOMEM;

+ request_mem_region(res.start, sz, res.name);
+
for (i = 0; i < n_words; i++) {
cpu->enable_cache[i] = 0;
__raw_writel(0, cpu->map_base + reg_enable(intc, i));

such that this shows up in /proc/iomem. WDYT?

That's certainly much more useful in general.

Also, the current pr_info() is probably pretty useless, given
that the OP was trying to circumvent the obfuscation. Either
printing the PA or removing the message altogether would be
good.

Thanks,

M.
--
Jazz is not dead. It just smells funny...