All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Álvaro Fernández Rojas" <noltari@gmail.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: jonas.gorski@gmail.com, bcm-kernel-feedback-list@broadcom.com,
	tglx@linutronix.de, maz@kernel.org, linux-mips@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] irqchip/bcm-6345-l1: show MMIO address
Date: Thu, 16 Mar 2023 20:04:51 +0100	[thread overview]
Message-ID: <CAKR-sGcuKoDyZSmprbFPHoHdKjk9N=q1SDLE0+qTVuXmuF=saA@mail.gmail.com> (raw)
In-Reply-To: <aa72bcfb-b366-f373-60c5-99404109c482@gmail.com>

El jue, 16 mar 2023 a las 19:13, Florian Fainelli
(<f.fainelli@gmail.com>) escribió:
>
> 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@gmail.com>
>
> 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?

I tried doing it that way, but it still shows (ptrval):
[    0.000000] irq_bcm6345_l1: registered BCM6345 L1 intc (IRQs: 32)
[    0.000000] irq_bcm6345_l1:   CPU0 at MMIO 0x(ptrval) (irq = 2)

I checked /proc/iomem and it's shown:
root@OpenWrt:/# cat /proc/iomem
00000000-03ffffff : System RAM
  00010000-0068e96f : Kernel code
  0068e970-008834ff : Kernel data
  01610000-016458e7 : Kernel bss
08000000-0800ffff : BCM6348 PCI IO space
1e000000-1fffffff : 1e000000.nor nor@1e000000
30000000-37ffffff : pci@fffe1000
  30000000-3000ffff : 0000:00:01.0
    30000000-3000ffff : ath9k
fffe0004-fffe0007 : fffe0004.clock-controller clock-controller@fffe0004
fffe000c-fffe0013 : interrupt-controller@fffe000c
fffe0034-fffe0037 : fffe0034.reset-controller reset-controller@fffe0034
fffe005c-fffe0067 : fffe005c.watchdog watchdog@fffe005c
fffe0100-fffe0117 : fffe0100.serial serial@fffe0100
fffe1000-fffe11ff : fffe1000.pci pci
fffe1300-fffe13ff : fffe1300.usb usb@fffe1300
fffe1400-fffe14ff : fffe1400.usb usb@fffe1400
fffe1500-fffe1537 : fffe1500.usb-phy usb-phy@fffe1500

Any idea why this could be hapenning?

>
> > ---
> >   drivers/irqchip/irq-bcm6345-l1.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/irqchip/irq-bcm6345-l1.c b/drivers/irqchip/irq-bcm6345-l1.c
> > index 6899e37810a8..55a2d9b31597 100644
> > --- a/drivers/irqchip/irq-bcm6345-l1.c
> > +++ b/drivers/irqchip/irq-bcm6345-l1.c
> > @@ -335,7 +335,7 @@ static int __init bcm6345_l1_of_init(struct device_node *dn,
> >       for_each_cpu(idx, &intc->cpumask) {
> >               struct bcm6345_l1_cpu *cpu = intc->cpus[idx];
> >
> > -             pr_info("  CPU%u at MMIO 0x%p (irq = %d)\n", idx,
> > +             pr_info("  CPU%u at MMIO 0x%px (irq = %d)\n", idx,
> >                               cpu->map_base, cpu->parent_irq);
> >       }
> >
>
> --
> Florian
>

Álvaro

  parent reply	other threads:[~2023-03-16 19:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-16 18:07 [PATCH] irqchip/bcm-6345-l1: show MMIO address Álvaro Fernández Rojas
2023-03-16 18:13 ` Florian Fainelli
2023-03-16 18:25   ` Marc Zyngier
2023-03-16 19:04   ` Álvaro Fernández Rojas [this message]
2023-03-16 19:10     ` Florian Fainelli
2023-03-16 19:34       ` Álvaro Fernández Rojas
2023-03-16 19:28 ` [PATCH v2] irqchip/bcm-6345-l1: request memory region Álvaro Fernández Rojas
2023-03-16 19:39   ` Florian Fainelli
2023-04-08 10:45   ` [irqchip: irq/irqchip-next] irqchip/bcm-6345-l1: Request " irqchip-bot for Álvaro Fernández Rojas

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='CAKR-sGcuKoDyZSmprbFPHoHdKjk9N=q1SDLE0+qTVuXmuF=saA@mail.gmail.com' \
    --to=noltari@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=f.fainelli@gmail.com \
    --cc=jonas.gorski@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.