linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] irqchip: Use %px to print pointer value
@ 2018-02-09  2:10 Jaedon Shin
  2018-02-09  8:48 ` Geert Uytterhoeven
  2018-02-09  8:51 ` Marc Zyngier
  0 siblings, 2 replies; 7+ messages in thread
From: Jaedon Shin @ 2018-02-09  2:10 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier, Florian Fainelli
  Cc: Kevin Cernekee, Brian Norris, Gregory Fong,
	bcm-kernel-feedback-list, linux-mips, linux-kernel,
	linux-arm-kernel, Jaedon Shin

Since commit ad67b74d2469 ("printk: hash addresses printed with %p")
pointers printed with %p are hashed. Use %px instead of %p to print
pointer value.

Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
---
 drivers/irqchip/irq-bcm7038-l1.c | 2 +-
 drivers/irqchip/irq-bcm7120-l2.c | 2 +-
 drivers/irqchip/irq-brcmstb-l2.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/irqchip/irq-bcm7038-l1.c b/drivers/irqchip/irq-bcm7038-l1.c
index 55cfb986225b..f604c1d89b3b 100644
--- a/drivers/irqchip/irq-bcm7038-l1.c
+++ b/drivers/irqchip/irq-bcm7038-l1.c
@@ -339,7 +339,7 @@ int __init bcm7038_l1_of_init(struct device_node *dn,
 		goto out_unmap;
 	}
 
-	pr_info("registered BCM7038 L1 intc (mem: 0x%p, IRQs: %d)\n",
+	pr_info("registered BCM7038 L1 intc (mem: 0x%px, IRQs: %d)\n",
 		intc->cpus[0]->map_base, IRQS_PER_WORD * intc->n_words);
 
 	return 0;
diff --git a/drivers/irqchip/irq-bcm7120-l2.c b/drivers/irqchip/irq-bcm7120-l2.c
index 983640eba418..1cc4dd1d584a 100644
--- a/drivers/irqchip/irq-bcm7120-l2.c
+++ b/drivers/irqchip/irq-bcm7120-l2.c
@@ -318,7 +318,7 @@ static int __init bcm7120_l2_intc_probe(struct device_node *dn,
 		}
 	}
 
-	pr_info("registered %s intc (mem: 0x%p, parent IRQ(s): %d)\n",
+	pr_info("registered %s intc (mem: 0x%px, parent IRQ(s): %d)\n",
 			intc_name, data->map_base[0], data->num_parent_irqs);
 
 	return 0;
diff --git a/drivers/irqchip/irq-brcmstb-l2.c b/drivers/irqchip/irq-brcmstb-l2.c
index 691d20eb0bec..6760edeeb666 100644
--- a/drivers/irqchip/irq-brcmstb-l2.c
+++ b/drivers/irqchip/irq-brcmstb-l2.c
@@ -262,7 +262,7 @@ static int __init brcmstb_l2_intc_of_init(struct device_node *np,
 		ct->chip.irq_set_wake = irq_gc_set_wake;
 	}
 
-	pr_info("registered L2 intc (mem: 0x%p, parent irq: %d)\n",
+	pr_info("registered L2 intc (mem: 0x%px, parent irq: %d)\n",
 			base, parent_irq);
 
 	return 0;
-- 
2.16.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] irqchip: Use %px to print pointer value
  2018-02-09  2:10 [PATCH] irqchip: Use %px to print pointer value Jaedon Shin
@ 2018-02-09  8:48 ` Geert Uytterhoeven
  2018-02-09  8:51 ` Marc Zyngier
  1 sibling, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2018-02-09  8:48 UTC (permalink / raw)
  To: Jaedon Shin
  Cc: Thomas Gleixner, Jason Cooper, Marc Zyngier, Florian Fainelli,
	Kevin Cernekee, Brian Norris, Gregory Fong,
	bcm-kernel-feedback-list, Linux MIPS Mailing List,
	Linux Kernel Mailing List, linux-arm-kernel

Hi Jaedon,

On Fri, Feb 9, 2018 at 3:10 AM, Jaedon Shin <jaedon.shin@gmail.com> wrote:
> Since commit ad67b74d2469 ("printk: hash addresses printed with %p")
> pointers printed with %p are hashed. Use %px instead of %p to print
> pointer value.
>
> Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>

Thanks for your patch!

> --- a/drivers/irqchip/irq-bcm7038-l1.c
> +++ b/drivers/irqchip/irq-bcm7038-l1.c
> @@ -339,7 +339,7 @@ int __init bcm7038_l1_of_init(struct device_node *dn,
>                 goto out_unmap;
>         }
>
> -       pr_info("registered BCM7038 L1 intc (mem: 0x%p, IRQs: %d)\n",
> +       pr_info("registered BCM7038 L1 intc (mem: 0x%px, IRQs: %d)\n",
>                 intc->cpus[0]->map_base, IRQS_PER_WORD * intc->n_words);

I believe the printing of this value should just be removed.
Printing virtual addresses of mapped registers is usually not helpful, except
for an attacker.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] irqchip: Use %px to print pointer value
  2018-02-09  2:10 [PATCH] irqchip: Use %px to print pointer value Jaedon Shin
  2018-02-09  8:48 ` Geert Uytterhoeven
@ 2018-02-09  8:51 ` Marc Zyngier
  2018-02-09 15:54   ` Florian Fainelli
  1 sibling, 1 reply; 7+ messages in thread
From: Marc Zyngier @ 2018-02-09  8:51 UTC (permalink / raw)
  To: Jaedon Shin, Thomas Gleixner, Jason Cooper, Florian Fainelli
  Cc: Kevin Cernekee, Brian Norris, Gregory Fong,
	bcm-kernel-feedback-list, linux-mips, linux-kernel,
	linux-arm-kernel

On 09/02/18 02:10, Jaedon Shin wrote:
> Since commit ad67b74d2469 ("printk: hash addresses printed with %p")
> pointers printed with %p are hashed. Use %px instead of %p to print
> pointer value.
> 
> Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
> ---
>  drivers/irqchip/irq-bcm7038-l1.c | 2 +-
>  drivers/irqchip/irq-bcm7120-l2.c | 2 +-
>  drivers/irqchip/irq-brcmstb-l2.c | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/irqchip/irq-bcm7038-l1.c b/drivers/irqchip/irq-bcm7038-l1.c
> index 55cfb986225b..f604c1d89b3b 100644
> --- a/drivers/irqchip/irq-bcm7038-l1.c
> +++ b/drivers/irqchip/irq-bcm7038-l1.c
> @@ -339,7 +339,7 @@ int __init bcm7038_l1_of_init(struct device_node *dn,
>  		goto out_unmap;
>  	}
>  
> -	pr_info("registered BCM7038 L1 intc (mem: 0x%p, IRQs: %d)\n",
> +	pr_info("registered BCM7038 L1 intc (mem: 0x%px, IRQs: %d)\n",
>  		intc->cpus[0]->map_base, IRQS_PER_WORD * intc->n_words);
>  
>  	return 0;
> diff --git a/drivers/irqchip/irq-bcm7120-l2.c b/drivers/irqchip/irq-bcm7120-l2.c
> index 983640eba418..1cc4dd1d584a 100644
> --- a/drivers/irqchip/irq-bcm7120-l2.c
> +++ b/drivers/irqchip/irq-bcm7120-l2.c
> @@ -318,7 +318,7 @@ static int __init bcm7120_l2_intc_probe(struct device_node *dn,
>  		}
>  	}
>  
> -	pr_info("registered %s intc (mem: 0x%p, parent IRQ(s): %d)\n",
> +	pr_info("registered %s intc (mem: 0x%px, parent IRQ(s): %d)\n",
>  			intc_name, data->map_base[0], data->num_parent_irqs);
>  
>  	return 0;
> diff --git a/drivers/irqchip/irq-brcmstb-l2.c b/drivers/irqchip/irq-brcmstb-l2.c
> index 691d20eb0bec..6760edeeb666 100644
> --- a/drivers/irqchip/irq-brcmstb-l2.c
> +++ b/drivers/irqchip/irq-brcmstb-l2.c
> @@ -262,7 +262,7 @@ static int __init brcmstb_l2_intc_of_init(struct device_node *np,
>  		ct->chip.irq_set_wake = irq_gc_set_wake;
>  	}
>  
> -	pr_info("registered L2 intc (mem: 0x%p, parent irq: %d)\n",
> +	pr_info("registered L2 intc (mem: 0x%px, parent irq: %d)\n",
>  			base, parent_irq);
>  
>  	return 0;
> 

Why is that something useful to do? This just tells you where the device
is mapped in the VA space, and I doubt that's a useful information,
hashed pointers or not. Am I missing something obvious?

Thanks,

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] irqchip: Use %px to print pointer value
  2018-02-09  8:51 ` Marc Zyngier
@ 2018-02-09 15:54   ` Florian Fainelli
  2018-02-09 16:04     ` Marc Zyngier
  0 siblings, 1 reply; 7+ messages in thread
From: Florian Fainelli @ 2018-02-09 15:54 UTC (permalink / raw)
  To: Marc Zyngier, Jaedon Shin, Thomas Gleixner, Jason Cooper
  Cc: Kevin Cernekee, Brian Norris, Gregory Fong,
	bcm-kernel-feedback-list, linux-mips, linux-kernel,
	linux-arm-kernel

On February 9, 2018 12:51:33 AM PST, Marc Zyngier <marc.zyngier@arm.com> wrote:
>On 09/02/18 02:10, Jaedon Shin wrote:
>> Since commit ad67b74d2469 ("printk: hash addresses printed with %p")
>> pointers printed with %p are hashed. Use %px instead of %p to print
>> pointer value.
>> 
>> Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
>> ---
>>  drivers/irqchip/irq-bcm7038-l1.c | 2 +-
>>  drivers/irqchip/irq-bcm7120-l2.c | 2 +-
>>  drivers/irqchip/irq-brcmstb-l2.c | 2 +-
>>  3 files changed, 3 insertions(+), 3 deletions(-)
>> 
>> diff --git a/drivers/irqchip/irq-bcm7038-l1.c
>b/drivers/irqchip/irq-bcm7038-l1.c
>> index 55cfb986225b..f604c1d89b3b 100644
>> --- a/drivers/irqchip/irq-bcm7038-l1.c
>> +++ b/drivers/irqchip/irq-bcm7038-l1.c
>> @@ -339,7 +339,7 @@ int __init bcm7038_l1_of_init(struct device_node
>*dn,
>>  		goto out_unmap;
>>  	}
>>  
>> -	pr_info("registered BCM7038 L1 intc (mem: 0x%p, IRQs: %d)\n",
>> +	pr_info("registered BCM7038 L1 intc (mem: 0x%px, IRQs: %d)\n",
>>  		intc->cpus[0]->map_base, IRQS_PER_WORD * intc->n_words);
>>  
>>  	return 0;
>> diff --git a/drivers/irqchip/irq-bcm7120-l2.c
>b/drivers/irqchip/irq-bcm7120-l2.c
>> index 983640eba418..1cc4dd1d584a 100644
>> --- a/drivers/irqchip/irq-bcm7120-l2.c
>> +++ b/drivers/irqchip/irq-bcm7120-l2.c
>> @@ -318,7 +318,7 @@ static int __init bcm7120_l2_intc_probe(struct
>device_node *dn,
>>  		}
>>  	}
>>  
>> -	pr_info("registered %s intc (mem: 0x%p, parent IRQ(s): %d)\n",
>> +	pr_info("registered %s intc (mem: 0x%px, parent IRQ(s): %d)\n",
>>  			intc_name, data->map_base[0], data->num_parent_irqs);
>>  
>>  	return 0;
>> diff --git a/drivers/irqchip/irq-brcmstb-l2.c
>b/drivers/irqchip/irq-brcmstb-l2.c
>> index 691d20eb0bec..6760edeeb666 100644
>> --- a/drivers/irqchip/irq-brcmstb-l2.c
>> +++ b/drivers/irqchip/irq-brcmstb-l2.c
>> @@ -262,7 +262,7 @@ static int __init brcmstb_l2_intc_of_init(struct
>device_node *np,
>>  		ct->chip.irq_set_wake = irq_gc_set_wake;
>>  	}
>>  
>> -	pr_info("registered L2 intc (mem: 0x%p, parent irq: %d)\n",
>> +	pr_info("registered L2 intc (mem: 0x%px, parent irq: %d)\n",
>>  			base, parent_irq);
>>  
>>  	return 0;
>> 
>
>Why is that something useful to do? This just tells you where the
>device
>is mapped in the VA space, and I doubt that's a useful information,
>hashed pointers or not. Am I missing something obvious?

No you are right there is not much value in printing the register virtual address (sometimes there is e.g: on MIPS) either we fix the prints to show the physical address of the base register or we could possibly drop the prints entirely.

-- 
Florian

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] irqchip: Use %px to print pointer value
  2018-02-09 15:54   ` Florian Fainelli
@ 2018-02-09 16:04     ` Marc Zyngier
  2018-02-10  2:16       ` Jaedon Shin
  2018-02-12 22:17       ` Jonas Gorski
  0 siblings, 2 replies; 7+ messages in thread
From: Marc Zyngier @ 2018-02-09 16:04 UTC (permalink / raw)
  To: Florian Fainelli, Jaedon Shin, Thomas Gleixner, Jason Cooper
  Cc: Kevin Cernekee, Brian Norris, Gregory Fong,
	bcm-kernel-feedback-list, linux-mips, linux-kernel,
	linux-arm-kernel

On 09/02/18 15:54, Florian Fainelli wrote:
> On February 9, 2018 12:51:33 AM PST, Marc Zyngier <marc.zyngier@arm.com> wrote:
>> On 09/02/18 02:10, Jaedon Shin wrote:
>>> Since commit ad67b74d2469 ("printk: hash addresses printed with %p")
>>> pointers printed with %p are hashed. Use %px instead of %p to print
>>> pointer value.
>>>
>>> Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
>>> ---
>>>  drivers/irqchip/irq-bcm7038-l1.c | 2 +-
>>>  drivers/irqchip/irq-bcm7120-l2.c | 2 +-
>>>  drivers/irqchip/irq-brcmstb-l2.c | 2 +-
>>>  3 files changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/irqchip/irq-bcm7038-l1.c
>> b/drivers/irqchip/irq-bcm7038-l1.c
>>> index 55cfb986225b..f604c1d89b3b 100644
>>> --- a/drivers/irqchip/irq-bcm7038-l1.c
>>> +++ b/drivers/irqchip/irq-bcm7038-l1.c
>>> @@ -339,7 +339,7 @@ int __init bcm7038_l1_of_init(struct device_node
>> *dn,
>>>  		goto out_unmap;
>>>  	}
>>>  
>>> -	pr_info("registered BCM7038 L1 intc (mem: 0x%p, IRQs: %d)\n",
>>> +	pr_info("registered BCM7038 L1 intc (mem: 0x%px, IRQs: %d)\n",
>>>  		intc->cpus[0]->map_base, IRQS_PER_WORD * intc->n_words);
>>>  
>>>  	return 0;
>>> diff --git a/drivers/irqchip/irq-bcm7120-l2.c
>> b/drivers/irqchip/irq-bcm7120-l2.c
>>> index 983640eba418..1cc4dd1d584a 100644
>>> --- a/drivers/irqchip/irq-bcm7120-l2.c
>>> +++ b/drivers/irqchip/irq-bcm7120-l2.c
>>> @@ -318,7 +318,7 @@ static int __init bcm7120_l2_intc_probe(struct
>> device_node *dn,
>>>  		}
>>>  	}
>>>  
>>> -	pr_info("registered %s intc (mem: 0x%p, parent IRQ(s): %d)\n",
>>> +	pr_info("registered %s intc (mem: 0x%px, parent IRQ(s): %d)\n",
>>>  			intc_name, data->map_base[0], data->num_parent_irqs);
>>>  
>>>  	return 0;
>>> diff --git a/drivers/irqchip/irq-brcmstb-l2.c
>> b/drivers/irqchip/irq-brcmstb-l2.c
>>> index 691d20eb0bec..6760edeeb666 100644
>>> --- a/drivers/irqchip/irq-brcmstb-l2.c
>>> +++ b/drivers/irqchip/irq-brcmstb-l2.c
>>> @@ -262,7 +262,7 @@ static int __init brcmstb_l2_intc_of_init(struct
>> device_node *np,
>>>  		ct->chip.irq_set_wake = irq_gc_set_wake;
>>>  	}
>>>  
>>> -	pr_info("registered L2 intc (mem: 0x%p, parent irq: %d)\n",
>>> +	pr_info("registered L2 intc (mem: 0x%px, parent irq: %d)\n",
>>>  			base, parent_irq);
>>>  
>>>  	return 0;
>>>
>>
>> Why is that something useful to do? This just tells you where the
>> device
>> is mapped in the VA space, and I doubt that's a useful information,
>> hashed pointers or not. Am I missing something obvious?
> 
> No you are right there is not much value in printing the register
> virtual address (sometimes there is e.g: on MIPS) either we fix the
> prints to show the physical address of the base register or we could
> possibly drop the prints entirely.

Displaying the PA can be useful if you have several identical blocks in
your system and you want to be able to identify them. Given that there
is probably only one of these controllers per system, the address is
pretty pointless.

If you send me a patch removing the prints, I'll queue it.

Thanks,

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] irqchip: Use %px to print pointer value
  2018-02-09 16:04     ` Marc Zyngier
@ 2018-02-10  2:16       ` Jaedon Shin
  2018-02-12 22:17       ` Jonas Gorski
  1 sibling, 0 replies; 7+ messages in thread
From: Jaedon Shin @ 2018-02-10  2:16 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: Florian Fainelli, Thomas Gleixner, Jason Cooper, Kevin Cernekee,
	Brian Norris, Gregory Fong, bcm-kernel-feedback-list, linux-mips,
	linux-kernel, linux-arm-kernel



> On 10 Feb 2018, at 1:04 AM, Marc Zyngier <marc.zyngier@arm.com> wrote:
> 
> On 09/02/18 15:54, Florian Fainelli wrote:
>> On February 9, 2018 12:51:33 AM PST, Marc Zyngier <marc.zyngier@arm.com> wrote:
>>> On 09/02/18 02:10, Jaedon Shin wrote:
>>>> Since commit ad67b74d2469 ("printk: hash addresses printed with %p")
>>>> pointers printed with %p are hashed. Use %px instead of %p to print
>>>> pointer value.
>>>> 
>>>> Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
>>>> ---
>>>> drivers/irqchip/irq-bcm7038-l1.c | 2 +-
>>>> drivers/irqchip/irq-bcm7120-l2.c | 2 +-
>>>> drivers/irqchip/irq-brcmstb-l2.c | 2 +-
>>>> 3 files changed, 3 insertions(+), 3 deletions(-)
>>>> 
>>>> diff --git a/drivers/irqchip/irq-bcm7038-l1.c
>>> b/drivers/irqchip/irq-bcm7038-l1.c
>>>> index 55cfb986225b..f604c1d89b3b 100644
>>>> --- a/drivers/irqchip/irq-bcm7038-l1.c
>>>> +++ b/drivers/irqchip/irq-bcm7038-l1.c
>>>> @@ -339,7 +339,7 @@ int __init bcm7038_l1_of_init(struct device_node
>>> *dn,
>>>> 		goto out_unmap;
>>>> 	}
>>>> 
>>>> -	pr_info("registered BCM7038 L1 intc (mem: 0x%p, IRQs: %d)\n",
>>>> +	pr_info("registered BCM7038 L1 intc (mem: 0x%px, IRQs: %d)\n",
>>>> 		intc->cpus[0]->map_base, IRQS_PER_WORD * intc->n_words);
>>>> 
>>>> 	return 0;
>>>> diff --git a/drivers/irqchip/irq-bcm7120-l2.c
>>> b/drivers/irqchip/irq-bcm7120-l2.c
>>>> index 983640eba418..1cc4dd1d584a 100644
>>>> --- a/drivers/irqchip/irq-bcm7120-l2.c
>>>> +++ b/drivers/irqchip/irq-bcm7120-l2.c
>>>> @@ -318,7 +318,7 @@ static int __init bcm7120_l2_intc_probe(struct
>>> device_node *dn,
>>>> 		}
>>>> 	}
>>>> 
>>>> -	pr_info("registered %s intc (mem: 0x%p, parent IRQ(s): %d)\n",
>>>> +	pr_info("registered %s intc (mem: 0x%px, parent IRQ(s): %d)\n",
>>>> 			intc_name, data->map_base[0], data->num_parent_irqs);
>>>> 
>>>> 	return 0;
>>>> diff --git a/drivers/irqchip/irq-brcmstb-l2.c
>>> b/drivers/irqchip/irq-brcmstb-l2.c
>>>> index 691d20eb0bec..6760edeeb666 100644
>>>> --- a/drivers/irqchip/irq-brcmstb-l2.c
>>>> +++ b/drivers/irqchip/irq-brcmstb-l2.c
>>>> @@ -262,7 +262,7 @@ static int __init brcmstb_l2_intc_of_init(struct
>>> device_node *np,
>>>> 		ct->chip.irq_set_wake = irq_gc_set_wake;
>>>> 	}
>>>> 
>>>> -	pr_info("registered L2 intc (mem: 0x%p, parent irq: %d)\n",
>>>> +	pr_info("registered L2 intc (mem: 0x%px, parent irq: %d)\n",
>>>> 			base, parent_irq);
>>>> 
>>>> 	return 0;
>>>> 
>>> 
>>> Why is that something useful to do? This just tells you where the
>>> device
>>> is mapped in the VA space, and I doubt that's a useful information,
>>> hashed pointers or not. Am I missing something obvious?
>> 
>> No you are right there is not much value in printing the register
>> virtual address (sometimes there is e.g: on MIPS) either we fix the
>> prints to show the physical address of the base register or we could
>> possibly drop the prints entirely.
> 
> Displaying the PA can be useful if you have several identical blocks in
> your system and you want to be able to identify them. Given that there
> is probably only one of these controllers per system, the address is
> pretty pointless.
> 
> If you send me a patch removing the prints, I'll queue it.
> 
> Thanks,
> 
> 	M.
> -- 
> Jazz is not dead. It just smells funny...

I'll submit a new one to drop the entire print.

Thanks,
Jaedon

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] irqchip: Use %px to print pointer value
  2018-02-09 16:04     ` Marc Zyngier
  2018-02-10  2:16       ` Jaedon Shin
@ 2018-02-12 22:17       ` Jonas Gorski
  1 sibling, 0 replies; 7+ messages in thread
From: Jonas Gorski @ 2018-02-12 22:17 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: Florian Fainelli, Jaedon Shin, Thomas Gleixner, Jason Cooper,
	Kevin Cernekee, Brian Norris, Gregory Fong,
	bcm-kernel-feedback-list, MIPS Mailing List, linux-kernel,
	linux-arm-kernel

On 9 February 2018 at 17:04, Marc Zyngier <marc.zyngier@arm.com> wrote:
> On 09/02/18 15:54, Florian Fainelli wrote:
>> On February 9, 2018 12:51:33 AM PST, Marc Zyngier <marc.zyngier@arm.com> wrote:
>>> On 09/02/18 02:10, Jaedon Shin wrote:
>>>> Since commit ad67b74d2469 ("printk: hash addresses printed with %p")
>>>> pointers printed with %p are hashed. Use %px instead of %p to print
>>>> pointer value.
>>>>
>>>> Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
>>>> ---
>>>>  drivers/irqchip/irq-bcm7038-l1.c | 2 +-
>>>>  drivers/irqchip/irq-bcm7120-l2.c | 2 +-
>>>>  drivers/irqchip/irq-brcmstb-l2.c | 2 +-
>>>>  3 files changed, 3 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/drivers/irqchip/irq-bcm7038-l1.c
>>> b/drivers/irqchip/irq-bcm7038-l1.c
>>>> index 55cfb986225b..f604c1d89b3b 100644
>>>> --- a/drivers/irqchip/irq-bcm7038-l1.c
>>>> +++ b/drivers/irqchip/irq-bcm7038-l1.c
>>>> @@ -339,7 +339,7 @@ int __init bcm7038_l1_of_init(struct device_node
>>> *dn,
>>>>             goto out_unmap;
>>>>     }
>>>>
>>>> -   pr_info("registered BCM7038 L1 intc (mem: 0x%p, IRQs: %d)\n",
>>>> +   pr_info("registered BCM7038 L1 intc (mem: 0x%px, IRQs: %d)\n",
>>>>             intc->cpus[0]->map_base, IRQS_PER_WORD * intc->n_words);
>>>>
>>>>     return 0;
>>>> diff --git a/drivers/irqchip/irq-bcm7120-l2.c
>>> b/drivers/irqchip/irq-bcm7120-l2.c
>>>> index 983640eba418..1cc4dd1d584a 100644
>>>> --- a/drivers/irqchip/irq-bcm7120-l2.c
>>>> +++ b/drivers/irqchip/irq-bcm7120-l2.c
>>>> @@ -318,7 +318,7 @@ static int __init bcm7120_l2_intc_probe(struct
>>> device_node *dn,
>>>>             }
>>>>     }
>>>>
>>>> -   pr_info("registered %s intc (mem: 0x%p, parent IRQ(s): %d)\n",
>>>> +   pr_info("registered %s intc (mem: 0x%px, parent IRQ(s): %d)\n",
>>>>                     intc_name, data->map_base[0], data->num_parent_irqs);
>>>>
>>>>     return 0;
>>>> diff --git a/drivers/irqchip/irq-brcmstb-l2.c
>>> b/drivers/irqchip/irq-brcmstb-l2.c
>>>> index 691d20eb0bec..6760edeeb666 100644
>>>> --- a/drivers/irqchip/irq-brcmstb-l2.c
>>>> +++ b/drivers/irqchip/irq-brcmstb-l2.c
>>>> @@ -262,7 +262,7 @@ static int __init brcmstb_l2_intc_of_init(struct
>>> device_node *np,
>>>>             ct->chip.irq_set_wake = irq_gc_set_wake;
>>>>     }
>>>>
>>>> -   pr_info("registered L2 intc (mem: 0x%p, parent irq: %d)\n",
>>>> +   pr_info("registered L2 intc (mem: 0x%px, parent irq: %d)\n",
>>>>                     base, parent_irq);
>>>>
>>>>     return 0;
>>>>
>>>
>>> Why is that something useful to do? This just tells you where the
>>> device
>>> is mapped in the VA space, and I doubt that's a useful information,
>>> hashed pointers or not. Am I missing something obvious?
>>
>> No you are right there is not much value in printing the register
>> virtual address (sometimes there is e.g: on MIPS) either we fix the
>> prints to show the physical address of the base register or we could
>> possibly drop the prints entirely.
>
> Displaying the PA can be useful if you have several identical blocks in
> your system and you want to be able to identify them. Given that there
> is probably only one of these controllers per system, the address is
> pretty pointless.

Multiple instances are actually quite common in the STB SoCs, e.g.
bcm7362 has one instance of bcm7038-l1, two instances of bcm7120-l2
and four instances of brcmstb-l2.


Regards
Jonas

P.S: Also What about bcm6345-l1? It also prints it's mapped VAs, not the PAs.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-02-12 22:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-09  2:10 [PATCH] irqchip: Use %px to print pointer value Jaedon Shin
2018-02-09  8:48 ` Geert Uytterhoeven
2018-02-09  8:51 ` Marc Zyngier
2018-02-09 15:54   ` Florian Fainelli
2018-02-09 16:04     ` Marc Zyngier
2018-02-10  2:16       ` Jaedon Shin
2018-02-12 22:17       ` Jonas Gorski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).