Skip to contentSkip to conversation

irqchip/mbigen: stop printing kernel addresses

PATCH Superseded Kefeng Wang 3 participants 8 messages Jun 18, 2019 irqchip drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 irqchip/mbigen: stop printing kernel addresses

After commit ad67b74d2469d9b8 ("printk: hash addresses printed with %p"), it will print "____ptrval____" instead of actual addresses when mbigen create domain fails,

Hisilicon MBIGEN-V2 HISI0152:00: Failed to create mbi-gen@(____ptrval____) irqdomain Hisilicon MBIGEN-V2: probe of HISI0152:00 failed with error -12

Instead of changing the print to "%px", and leaking kernel addresses, just remove the print completely.

---
 drivers/irqchip/irq-mbigen.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/irqchip/irq-mbigen.c +1 -2
index 98b6e1d4b1a6..d0cf596c801b 100644
@@ -355,8 +355,7 @@ static int mbigen_device_probe(struct platform_device *pdev)
 		err = -EINVAL;
 
 	if (err) {
-		dev_err(&pdev->dev, "Failed to create mbi-gen@%p irqdomain",
-			mgn_chip->base);
+		dev_err(&pdev->dev, "Failed to create mbi-gen irqdomain");
 		return err;
 	}
 
Signature · 1 line
2.20.1
#1 lore raw

Hi Kefeng,

Quoted 21 lines · Kefeng Wang

After commit ad67b74d2469d9b8 ("printk: hash addresses printed with %p"), it will print "____ptrval____" instead of actual addresses when mbigen create domain fails,

Hisilicon MBIGEN-V2 HISI0152:00: Failed to create mbi-gen@(____ptrval____) irqdomain Hisilicon MBIGEN-V2: probe of HISI0152:00 failed with error -12

Instead of changing the print to "%px", and leaking kernel addresses, just remove the print completely.

---
 drivers/irqchip/irq-mbigen.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/irqchip/irq-mbigen.c +0 -0
index 98b6e1d4b1a6..d0cf596c801b 100644

drivers/irqchip/irq-mbigen.c static int mbigen_device_probe(struct platform_device *pdev) · line 358

Quoted 6 lines
drivers/irqchip/irq-mbigen.c +1 -2
@@ -355,8 +355,7 @@ static int mbigen_device_probe(struct platform_device *pdev)
 		err = -EINVAL;
 
 	if (err) {
-		dev_err(&pdev->dev, "Failed to create mbi-gen@%p irqdomain",
-			mgn_chip->base);
+		dev_err(&pdev->dev, "Failed to create mbi-gen irqdomain");

The alternative would be to print res as a resource, which would still help identifying the offending device by printing its physical layout, and still not reveal much.

Just let me know what you prefer.

Thanks,

	M.
Quoted 6 lines
drivers/irqchip/irq-mbigen.c +0 -0
 		return err;
 	}
 
Signature · 1 line
2.20.1
Signature · 1 line
Jazz is not dead, it just smells funny.
#2 lore raw
Quoted 27 lines · Marc Zyngier

Hi Kefeng,

Quoted 23 lines · Kefeng Wang

After commit ad67b74d2469d9b8 ("printk: hash addresses printed with %p"), it will print "____ptrval____" instead of actual addresses when mbigen create domain fails,

Hisilicon MBIGEN-V2 HISI0152:00: Failed to create mbi-gen@(____ptrval____) irqdomain Hisilicon MBIGEN-V2: probe of HISI0152:00 failed with error -12

Instead of changing the print to "%px", and leaking kernel addresses, just remove the print completely.

---
 drivers/irqchip/irq-mbigen.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/irqchip/irq-mbigen.c +0 -0
index 98b6e1d4b1a6..d0cf596c801b 100644
@@ -355,8 +355,7 @@ static int mbigen_device_probe(struct platform_device *pdev)
 		err = -EINVAL;
 
Quoted 8 lines

drivers/irqchip/irq-mbigen.c static int mbigen_device_probe(struct platform_device *pdev) · line 358

Quoted 4 lines
drivers/irqchip/irq-mbigen.c +1 -2
 	if (err) {
-		dev_err(&pdev->dev, "Failed to create mbi-gen@%p irqdomain",
-			mgn_chip->base);
+		dev_err(&pdev->dev, "Failed to create mbi-gen irqdomain");

The alternative would be to print res as a resource, which would still help identifying the offending device by printing its physical layout, and still not reveal much.

It's better to print res to show the physical layout, and add missing "\n", will resend v2.

Thanks.

Quoted 14 lines

Just let me know what you prefer.

Thanks,

	M.
Quoted 6 lines
drivers/irqchip/irq-mbigen.c +0 -0
 		return err;
 	}
 
Signature · 1 line
2.20.1
#3 lore raw
Quoted 39 lines · Kefeng Wang
Quoted 27 lines · Marc Zyngier

Hi Kefeng,

Quoted 23 lines · Kefeng Wang

After commit ad67b74d2469d9b8 ("printk: hash addresses printed with %p"), it will print "____ptrval____" instead of actual addresses when mbigen create domain fails,

Hisilicon MBIGEN-V2 HISI0152:00: Failed to create mbi-gen@(____ptrval____) irqdomain Hisilicon MBIGEN-V2: probe of HISI0152:00 failed with error -12

Instead of changing the print to "%px", and leaking kernel addresses, just remove the print completely.

---
 drivers/irqchip/irq-mbigen.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/irqchip/irq-mbigen.c +0 -0
index 98b6e1d4b1a6..d0cf596c801b 100644
@@ -355,8 +355,7 @@ static int mbigen_device_probe(struct platform_device *pdev)
 		err = -EINVAL;
 
Quoted 8 lines

drivers/irqchip/irq-mbigen.c static int mbigen_device_probe(struct platform_device *pdev) · line 358

Quoted 4 lines
drivers/irqchip/irq-mbigen.c +1 -2
 	if (err) {
-		dev_err(&pdev->dev, "Failed to create mbi-gen@%p irqdomain",
-			mgn_chip->base);
+		dev_err(&pdev->dev, "Failed to create mbi-gen irqdomain");

The alternative would be to print res as a resource, which would still help identifying the offending device by printing its physical layout, and still not reveal much.

Quoted 2 lines

It's better to print res to show the physical layout, and add missing "\n", will resend v2.

As Hanjun mentioned in a separate email, pdev->dev seems to be enough to identify which MBIGEN has failed to probe. So maybe all you need to do is to add the missing '\n', and tidy up the commit message to reflect that.

Thanks,

	M.
Signature · 1 line
Jazz is not dead. It just smells funny...
#4 lore raw
Quoted 40 lines · Marc Zyngier
Quoted 39 lines · Kefeng Wang
Quoted 35 lines · Marc Zyngier

Hi Kefeng,

Quoted 21 lines · Kefeng Wang

After commit ad67b74d2469d9b8 ("printk: hash addresses printed with %p"), it will print "____ptrval____" instead of actual addresses when mbigen create domain fails,

Hisilicon MBIGEN-V2 HISI0152:00: Failed to create mbi-gen@(____ptrval____) irqdomain Hisilicon MBIGEN-V2: probe of HISI0152:00 failed with error -12

Instead of changing the print to "%px", and leaking kernel addresses, just remove the print completely.

---
 drivers/irqchip/irq-mbigen.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/irqchip/irq-mbigen.c +0 -0
index 98b6e1d4b1a6..d0cf596c801b 100644

drivers/irqchip/irq-mbigen.c static int mbigen_device_probe(struct platform_device *pdev) · line 358

Quoted 6 lines
drivers/irqchip/irq-mbigen.c +1 -2
@@ -355,8 +355,7 @@ static int mbigen_device_probe(struct platform_device *pdev)
 		err = -EINVAL;
 
 	if (err) {
-		dev_err(&pdev->dev, "Failed to create mbi-gen@%p irqdomain",
-			mgn_chip->base);
+		dev_err(&pdev->dev, "Failed to create mbi-gen irqdomain");

The alternative would be to print res as a resource, which would still help identifying the offending device by printing its physical layout, and still not reveal much.

Quoted 6 lines
Quoted 2 lines

It's better to print res to show the physical layout, and add missing "\n", will resend v2.

As Hanjun mentioned in a separate email, pdev->dev seems to be enough to identify which MBIGEN has failed to probe. So maybe all you need to do is to add the missing '\n', and tidy up the commit message to reflect that.

OK, done in v2.

Quoted 5 lines

Thanks,

	M.
#5 lore raw
In reply to Kefeng Wang
Quoted 9 lines · Kefeng Wang

After commit ad67b74d2469d9b8 ("printk: hash addresses printed with %p"), it will print "____ptrval____" instead of actual addresses when mbigen create domain fails,

Hisilicon MBIGEN-V2 HISI0152:00: Failed to create mbi-gen@(____ptrval____) irqdomain Hisilicon MBIGEN-V2: probe of HISI0152:00 failed with error -12

Instead of changing the print to "%px", and leaking kernel addresses, just remove the print completely.

This is a little bit misleading, as the "base" was used for identify which mbigen failed, so saying 'remove completely' will make people think that we will miss some debug information.

In fact, we have HISI0152:00 stands for mbigen ACPI HID and its UID, so we can identify the failing probed mbigen even we remove the printing "mgn_chip->base". It's better to add this clarify in the commit message as well.

Thanks
Hanjun

#6 lore raw

PATCH v2 1/1 irqchip/mbigen: stop printing kernel addresses

In reply to Kefeng Wang

After commit ad67b74d2469d9b8 ("printk: hash addresses printed with %p"), it will print "____ptrval____" instead of actual addresses when mbigen create domain fails,

Hisilicon MBIGEN-V2 HISI0152:00: Failed to create mbi-gen@(____ptrval____) irqdomain Hisilicon MBIGEN-V2: probe of HISI0152:00 failed with error -12

dev_xxx() helper contains the device info, HISI0152:00, which stands for mbigen ACPI HID and its UID, we can identify the failing probed mbigen, so just remove the printing "mgn_chip->base", and also add missing "\n".

---
 drivers/irqchip/irq-mbigen.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/irqchip/irq-mbigen.c +1 -2
index 98b6e1d4b1a6..c0f65ea0ae0f 100644
@@ -355,8 +355,7 @@ static int mbigen_device_probe(struct platform_device *pdev)
 		err = -EINVAL;
 
 	if (err) {
-		dev_err(&pdev->dev, "Failed to create mbi-gen@%p irqdomain",
-			mgn_chip->base);
+		dev_err(&pdev->dev, "Failed to create mbi-gen irqdomain\n");
 		return err;
 	}
 
Signature · 1 line
2.20.1
Reviewed-by on v2 1/1
#7 lore raw
Quoted 21 lines · Kefeng Wang

After commit ad67b74d2469d9b8 ("printk: hash addresses printed with %p"), it will print "____ptrval____" instead of actual addresses when mbigen create domain fails,

Hisilicon MBIGEN-V2 HISI0152:00: Failed to create mbi-gen@(____ptrval____) irqdomain Hisilicon MBIGEN-V2: probe of HISI0152:00 failed with error -12

dev_xxx() helper contains the device info, HISI0152:00, which stands for mbigen ACPI HID and its UID, we can identify the failing probed mbigen, so just remove the printing "mgn_chip->base", and also add missing "\n".

---
 drivers/irqchip/irq-mbigen.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/irqchip/irq-mbigen.c +0 -0
index 98b6e1d4b1a6..c0f65ea0ae0f 100644

drivers/irqchip/irq-mbigen.c static int mbigen_device_probe(struct platform_device *pdev) · line 359

Quoted 7 lines
drivers/irqchip/irq-mbigen.c +1 -2
@@ -355,8 +355,7 @@ static int mbigen_device_probe(struct platform_device *pdev)
 		err = -EINVAL;
 
 	if (err) {
-		dev_err(&pdev->dev, "Failed to create mbi-gen@%p irqdomain",
-			mgn_chip->base);
+		dev_err(&pdev->dev, "Failed to create mbi-gen irqdomain\n");
 		return err;