linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] Fix printing when no interrupt is allocated
@ 2012-11-21  8:43 Daniel J Blueman
  2012-11-21 13:46 ` [PATCH RESEND] acpi: Fix logging when no pci_irq " Joe Perches
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel J Blueman @ 2012-11-21  8:43 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi, linux-kernel, Daniel J Blueman

Previously a new line is implicitly added in the no GSI case:

[    7.185182] pci 0001:00:12.0: can't derive routing for PCI INT A
[    7.191352] pci 0001:00:12.0: PCI INT A: no GSI
[    7.195956]  - using ISA IRQ 10

The code thus prints a blank line where no legacy IRQ is available:

[    1.650124] pci 0000:00:14.0: can't derive routing for PCI INT A
[    1.650126] pci 0000:00:14.0: PCI INT A: no GSI
[    1.650126] 
[    1.650180] pci 0000:00:14.0: can't derive routing for PCI INT A

Fix this by making the newline explicit and removing the superfluous
one.

Signed-off-by: Daniel J Blueman <daniel@numascale-asia.com>
---
 drivers/acpi/pci_irq.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
index 0eefa12..2c37996 100644
--- a/drivers/acpi/pci_irq.c
+++ b/drivers/acpi/pci_irq.c
@@ -459,7 +459,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
 	 */
 	if (gsi < 0) {
 		u32 dev_gsi;
-		dev_warn(&dev->dev, "PCI INT %c: no GSI", pin_name(pin));
+		dev_warn(&dev->dev, "PCI INT %c: no GSI\n", pin_name(pin));
 		/* Interrupt Line values above 0xF are forbidden */
 		if (dev->irq > 0 && (dev->irq <= 0xF) &&
 		    (acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0)) {
@@ -467,11 +467,9 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
 			acpi_register_gsi(&dev->dev, dev_gsi,
 					  ACPI_LEVEL_SENSITIVE,
 					  ACPI_ACTIVE_LOW);
-			return 0;
-		} else {
-			printk("\n");
-			return 0;
 		}
+
+		return 0;
 	}
 
 	rc = acpi_register_gsi(&dev->dev, gsi, triggering, polarity);
-- 
1.7.9.5


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

* Re: [PATCH RESEND] acpi: Fix logging when no pci_irq is allocated
  2012-11-21  8:43 [PATCH RESEND] Fix printing when no interrupt is allocated Daniel J Blueman
@ 2012-11-21 13:46 ` Joe Perches
  2012-11-21 20:50   ` Rafael J. Wysocki
  0 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2012-11-21 13:46 UTC (permalink / raw)
  To: Daniel J Blueman; +Cc: Len Brown, linux-acpi, linux-kernel

On Wed, 2012-11-21 at 16:43 +0800, Daniel J Blueman wrote:
> Previously a new line is implicitly added in the no GSI case:
> 
> [    7.185182] pci 0001:00:12.0: can't derive routing for PCI INT A
> [    7.191352] pci 0001:00:12.0: PCI INT A: no GSI
> [    7.195956]  - using ISA IRQ 10
> 
> The code thus prints a blank line where no legacy IRQ is available:
> 
> [    1.650124] pci 0000:00:14.0: can't derive routing for PCI INT A
> [    1.650126] pci 0000:00:14.0: PCI INT A: no GSI
> [    1.650126] 
> [    1.650180] pci 0000:00:14.0: can't derive routing for PCI INT A
> 
> Fix this by making the newline explicit and removing the superfluous
> one.

This breaks the logging code below it when there is an ISA irq.

The below works, but is a workaround for a defect in the printk
subsystem introduced by a logging change that will be fixed in
a near future release.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/acpi/pci_irq.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
index f288e00..68a921d 100644
--- a/drivers/acpi/pci_irq.c
+++ b/drivers/acpi/pci_irq.c
@@ -458,19 +458,19 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
 	 */
 	if (gsi < 0) {
 		u32 dev_gsi;
-		dev_warn(&dev->dev, "PCI INT %c: no GSI", pin_name(pin));
 		/* Interrupt Line values above 0xF are forbidden */
 		if (dev->irq > 0 && (dev->irq <= 0xF) &&
 		    (acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0)) {
-			printk(" - using ISA IRQ %d\n", dev->irq);
+			dev_warn(&dev->dev, "PCI INT %c: no GSI - using ISA IRQ %d\n",
+				 pin_name(pin), dev->irq);
 			acpi_register_gsi(&dev->dev, dev_gsi,
 					  ACPI_LEVEL_SENSITIVE,
 					  ACPI_ACTIVE_LOW);
-			return 0;
 		} else {
-			printk("\n");
-			return 0;
+			dev_warn(&dev->dev, "PCI INT %c: no GSI\n",
+				 pin_name(pin));
 		}
+		return 0;
 	}
 
 	rc = acpi_register_gsi(&dev->dev, gsi, triggering, polarity);



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

* Re: [PATCH RESEND] acpi: Fix logging when no pci_irq is allocated
  2012-11-21 13:46 ` [PATCH RESEND] acpi: Fix logging when no pci_irq " Joe Perches
@ 2012-11-21 20:50   ` Rafael J. Wysocki
  2012-11-21 20:53     ` Joe Perches
  0 siblings, 1 reply; 7+ messages in thread
From: Rafael J. Wysocki @ 2012-11-21 20:50 UTC (permalink / raw)
  To: Joe Perches; +Cc: Daniel J Blueman, Len Brown, linux-acpi, linux-kernel

On Wednesday, November 21, 2012 05:46:04 AM Joe Perches wrote:
> On Wed, 2012-11-21 at 16:43 +0800, Daniel J Blueman wrote:
> > Previously a new line is implicitly added in the no GSI case:
> > 
> > [    7.185182] pci 0001:00:12.0: can't derive routing for PCI INT A
> > [    7.191352] pci 0001:00:12.0: PCI INT A: no GSI
> > [    7.195956]  - using ISA IRQ 10
> > 
> > The code thus prints a blank line where no legacy IRQ is available:
> > 
> > [    1.650124] pci 0000:00:14.0: can't derive routing for PCI INT A
> > [    1.650126] pci 0000:00:14.0: PCI INT A: no GSI
> > [    1.650126] 
> > [    1.650180] pci 0000:00:14.0: can't derive routing for PCI INT A
> > 
> > Fix this by making the newline explicit and removing the superfluous
> > one.
> 
> This breaks the logging code below it when there is an ISA irq.
> 
> The below works, but is a workaround for a defect in the printk
> subsystem introduced by a logging change that will be fixed in
> a near future release.

What exactly do you mean by "near future"?

Rafael


> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/acpi/pci_irq.c |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
> index f288e00..68a921d 100644
> --- a/drivers/acpi/pci_irq.c
> +++ b/drivers/acpi/pci_irq.c
> @@ -458,19 +458,19 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
>  	 */
>  	if (gsi < 0) {
>  		u32 dev_gsi;
> -		dev_warn(&dev->dev, "PCI INT %c: no GSI", pin_name(pin));
>  		/* Interrupt Line values above 0xF are forbidden */
>  		if (dev->irq > 0 && (dev->irq <= 0xF) &&
>  		    (acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0)) {
> -			printk(" - using ISA IRQ %d\n", dev->irq);
> +			dev_warn(&dev->dev, "PCI INT %c: no GSI - using ISA IRQ %d\n",
> +				 pin_name(pin), dev->irq);
>  			acpi_register_gsi(&dev->dev, dev_gsi,
>  					  ACPI_LEVEL_SENSITIVE,
>  					  ACPI_ACTIVE_LOW);
> -			return 0;
>  		} else {
> -			printk("\n");
> -			return 0;
> +			dev_warn(&dev->dev, "PCI INT %c: no GSI\n",
> +				 pin_name(pin));
>  		}
> +		return 0;
>  	}
>  
>  	rc = acpi_register_gsi(&dev->dev, gsi, triggering, polarity);
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

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

* Re: [PATCH RESEND] acpi: Fix logging when no pci_irq is allocated
  2012-11-21 20:50   ` Rafael J. Wysocki
@ 2012-11-21 20:53     ` Joe Perches
  2012-11-21 21:25       ` Rafael J. Wysocki
  0 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2012-11-21 20:53 UTC (permalink / raw)
  To: Rafael J. Wysocki, Jan H. Schönherr
  Cc: Daniel J Blueman, Len Brown, linux-acpi, linux-kernel

On Wed, 2012-11-21 at 21:50 +0100, Rafael J. Wysocki wrote:
> On Wednesday, November 21, 2012 05:46:04 AM Joe Perches wrote:
> > On Wed, 2012-11-21 at 16:43 +0800, Daniel J Blueman wrote:
> > > Previously a new line is implicitly added in the no GSI case:
> > > 
> > > [    7.185182] pci 0001:00:12.0: can't derive routing for PCI INT A
> > > [    7.191352] pci 0001:00:12.0: PCI INT A: no GSI
> > > [    7.195956]  - using ISA IRQ 10
> > > 
> > > The code thus prints a blank line where no legacy IRQ is available:
> > > 
> > > [    1.650124] pci 0000:00:14.0: can't derive routing for PCI INT A
> > > [    1.650126] pci 0000:00:14.0: PCI INT A: no GSI
> > > [    1.650126] 
> > > [    1.650180] pci 0000:00:14.0: can't derive routing for PCI INT A
> > > 
> > > Fix this by making the newline explicit and removing the superfluous
> > > one.
> > 
> > This breaks the logging code below it when there is an ISA irq.
> > 
> > The below works, but is a workaround for a defect in the printk
> > subsystem introduced by a logging change that will be fixed in
> > a near future release.
> 
> What exactly do you mean by "near future"?

I mean Jan Schönherr's patches that should fix this are
likely to be picked up one day.

https://lkml.org/lkml/2012/11/13/678



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

* Re: [PATCH RESEND] acpi: Fix logging when no pci_irq is allocated
  2012-11-21 21:25       ` Rafael J. Wysocki
@ 2012-11-21 21:24         ` Joe Perches
  2012-11-22  0:14           ` Rafael J. Wysocki
  0 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2012-11-21 21:24 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Jan H. Schönherr, Daniel J Blueman, Len Brown, linux-acpi,
	linux-kernel

On Wed, 2012-11-21 at 22:25 +0100, Rafael J. Wysocki wrote:
> On Wednesday, November 21, 2012 12:53:55 PM Joe Perches wrote:
> > I mean Jan Schönherr's patches that should fix this are
> > likely to be picked up one day.
> > 
> > https://lkml.org/lkml/2012/11/13/678
> 
> Till then, we need the patch you sent, right?  And it won't hurt to apply it
> anyway?

If it's a real problem for someone, I guess so.
It shouldn't hurt anything.


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

* Re: [PATCH RESEND] acpi: Fix logging when no pci_irq is allocated
  2012-11-21 20:53     ` Joe Perches
@ 2012-11-21 21:25       ` Rafael J. Wysocki
  2012-11-21 21:24         ` Joe Perches
  0 siblings, 1 reply; 7+ messages in thread
From: Rafael J. Wysocki @ 2012-11-21 21:25 UTC (permalink / raw)
  To: Joe Perches
  Cc: Jan H. Schönherr, Daniel J Blueman, Len Brown, linux-acpi,
	linux-kernel

On Wednesday, November 21, 2012 12:53:55 PM Joe Perches wrote:
> On Wed, 2012-11-21 at 21:50 +0100, Rafael J. Wysocki wrote:
> > On Wednesday, November 21, 2012 05:46:04 AM Joe Perches wrote:
> > > On Wed, 2012-11-21 at 16:43 +0800, Daniel J Blueman wrote:
> > > > Previously a new line is implicitly added in the no GSI case:
> > > > 
> > > > [    7.185182] pci 0001:00:12.0: can't derive routing for PCI INT A
> > > > [    7.191352] pci 0001:00:12.0: PCI INT A: no GSI
> > > > [    7.195956]  - using ISA IRQ 10
> > > > 
> > > > The code thus prints a blank line where no legacy IRQ is available:
> > > > 
> > > > [    1.650124] pci 0000:00:14.0: can't derive routing for PCI INT A
> > > > [    1.650126] pci 0000:00:14.0: PCI INT A: no GSI
> > > > [    1.650126] 
> > > > [    1.650180] pci 0000:00:14.0: can't derive routing for PCI INT A
> > > > 
> > > > Fix this by making the newline explicit and removing the superfluous
> > > > one.
> > > 
> > > This breaks the logging code below it when there is an ISA irq.
> > > 
> > > The below works, but is a workaround for a defect in the printk
> > > subsystem introduced by a logging change that will be fixed in
> > > a near future release.
> > 
> > What exactly do you mean by "near future"?
> 
> I mean Jan Schönherr's patches that should fix this are
> likely to be picked up one day.
> 
> https://lkml.org/lkml/2012/11/13/678

Till then, we need the patch you sent, right?  And it won't hurt to apply it
anyway?

Rafael


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

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

* Re: [PATCH RESEND] acpi: Fix logging when no pci_irq is allocated
  2012-11-21 21:24         ` Joe Perches
@ 2012-11-22  0:14           ` Rafael J. Wysocki
  0 siblings, 0 replies; 7+ messages in thread
From: Rafael J. Wysocki @ 2012-11-22  0:14 UTC (permalink / raw)
  To: Joe Perches
  Cc: Jan H. Schönherr, Daniel J Blueman, Len Brown, linux-acpi,
	linux-kernel

On Wednesday, November 21, 2012 01:24:59 PM Joe Perches wrote:
> On Wed, 2012-11-21 at 22:25 +0100, Rafael J. Wysocki wrote:
> > On Wednesday, November 21, 2012 12:53:55 PM Joe Perches wrote:
> > > I mean Jan Schönherr's patches that should fix this are
> > > likely to be picked up one day.
> > > 
> > > https://lkml.org/lkml/2012/11/13/678
> > 
> > Till then, we need the patch you sent, right?  And it won't hurt to apply it
> > anyway?
> 
> If it's a real problem for someone, I guess so.
> It shouldn't hurt anything.

So I've applied it.

Thanks,
Rafael


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

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

end of thread, other threads:[~2012-11-22 20:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-21  8:43 [PATCH RESEND] Fix printing when no interrupt is allocated Daniel J Blueman
2012-11-21 13:46 ` [PATCH RESEND] acpi: Fix logging when no pci_irq " Joe Perches
2012-11-21 20:50   ` Rafael J. Wysocki
2012-11-21 20:53     ` Joe Perches
2012-11-21 21:25       ` Rafael J. Wysocki
2012-11-21 21:24         ` Joe Perches
2012-11-22  0:14           ` Rafael J. Wysocki

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).