linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 03/14] powerpc: use printk_once
       [not found] <1249847649-11631-1-git-send-email-marcin.slusarz@gmail.com>
@ 2009-08-09 19:53 ` Marcin Slusarz
  2009-08-10  8:00   ` Wolfram Sang
  0 siblings, 1 reply; 4+ messages in thread
From: Marcin Slusarz @ 2009-08-09 19:53 UTC (permalink / raw)
  To: LKML; +Cc: Paul Mackerras, linuxppc-dev

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
---
 arch/powerpc/kernel/iommu.c      |    6 +-----
 arch/powerpc/kernel/irq.c        |    5 ++---
 arch/powerpc/sysdev/ppc4xx_pci.c |    9 ++-------
 3 files changed, 5 insertions(+), 15 deletions(-)

diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
index fd51578..c7fa258 100644
--- a/arch/powerpc/kernel/iommu.c
+++ b/arch/powerpc/kernel/iommu.c
@@ -502,7 +502,6 @@ static void iommu_table_clear(struct iommu_table *tbl)
 struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid)
 {
 	unsigned long sz;
-	static int welcomed = 0;
 	struct page *page;
 
 	/* Set aside 1/4 of the table for large allocations. */
@@ -523,11 +522,8 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid)
 
 	iommu_table_clear(tbl);
 
-	if (!welcomed) {
-		printk(KERN_INFO "IOMMU table initialized, virtual merging %s\n",
+	printk_once(KERN_INFO "IOMMU table initialized, virtual merging %s\n",
 		       novmerge ? "disabled" : "enabled");
-		welcomed = 1;
-	}
 
 	return tbl;
 }
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index f7f376e..05ebd21 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -231,7 +231,6 @@ skip:
 void fixup_irqs(cpumask_t map)
 {
 	unsigned int irq;
-	static int warned;
 
 	for_each_irq(irq) {
 		cpumask_t mask;
@@ -246,8 +245,8 @@ void fixup_irqs(cpumask_t map)
 		}
 		if (irq_desc[irq].chip->set_affinity)
 			irq_desc[irq].chip->set_affinity(irq, &mask);
-		else if (irq_desc[irq].action && !(warned++))
-			printk("Cannot set affinity for irq %i\n", irq);
+		else if (irq_desc[irq].action)
+			printk_once("Cannot set affinity for irq %i\n", irq);
 	}
 
 	local_irq_enable();
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c
index 6ff9d71..4282dff 100644
--- a/arch/powerpc/sysdev/ppc4xx_pci.c
+++ b/arch/powerpc/sysdev/ppc4xx_pci.c
@@ -1243,19 +1243,14 @@ static int ppc4xx_pciex_validate_bdf(struct ppc4xx_pciex_port *port,
 				     struct pci_bus *bus,
 				     unsigned int devfn)
 {
-	static int message;
-
 	/* Endpoint can not generate upstream(remote) config cycles */
 	if (port->endpoint && bus->number != port->hose->first_busno)
 		return PCIBIOS_DEVICE_NOT_FOUND;
 
 	/* Check we are within the mapped range */
 	if (bus->number > port->hose->last_busno) {
-		if (!message) {
-			printk(KERN_WARNING "Warning! Probing bus %u"
-			       " out of range !\n", bus->number);
-			message++;
-		}
+		printk_once(KERN_WARNING
+			"Warning! Probing bus %u out of range!\n", bus->number);
 		return PCIBIOS_DEVICE_NOT_FOUND;
 	}
 
-- 
1.6.3.3

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

* Re: [PATCH 03/14] powerpc: use printk_once
  2009-08-09 19:53 ` [PATCH 03/14] powerpc: use printk_once Marcin Slusarz
@ 2009-08-10  8:00   ` Wolfram Sang
  2009-08-10 11:46     ` Michael Ellerman
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2009-08-10  8:00 UTC (permalink / raw)
  To: Marcin Slusarz; +Cc: linuxppc-dev, Paul Mackerras, LKML

[-- Attachment #1: Type: text/plain, Size: 2404 bytes --]


On Sun, Aug 09, 2009 at 09:53:58PM +0200, Marcin Slusarz wrote:
> Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: linuxppc-dev@ozlabs.org
> ---
>  arch/powerpc/kernel/iommu.c      |    6 +-----
>  arch/powerpc/kernel/irq.c        |    5 ++---
>  arch/powerpc/sysdev/ppc4xx_pci.c |    9 ++-------
>  3 files changed, 5 insertions(+), 15 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
> index fd51578..c7fa258 100644
> --- a/arch/powerpc/kernel/iommu.c
> +++ b/arch/powerpc/kernel/iommu.c
> @@ -502,7 +502,6 @@ static void iommu_table_clear(struct iommu_table *tbl)
>  struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid)
>  {
>  	unsigned long sz;
> -	static int welcomed = 0;
>  	struct page *page;
>  
>  	/* Set aside 1/4 of the table for large allocations. */
> @@ -523,11 +522,8 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid)
>  
>  	iommu_table_clear(tbl);
>  
> -	if (!welcomed) {
> -		printk(KERN_INFO "IOMMU table initialized, virtual merging %s\n",
> +	printk_once(KERN_INFO "IOMMU table initialized, virtual merging %s\n",
>  		       novmerge ? "disabled" : "enabled");
> -		welcomed = 1;
> -	}
>  
>  	return tbl;
>  }
> diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
> index f7f376e..05ebd21 100644
> --- a/arch/powerpc/kernel/irq.c
> +++ b/arch/powerpc/kernel/irq.c
> @@ -231,7 +231,6 @@ skip:
>  void fixup_irqs(cpumask_t map)
>  {
>  	unsigned int irq;
> -	static int warned;
>  
>  	for_each_irq(irq) {
>  		cpumask_t mask;
> @@ -246,8 +245,8 @@ void fixup_irqs(cpumask_t map)
>  		}
>  		if (irq_desc[irq].chip->set_affinity)
>  			irq_desc[irq].chip->set_affinity(irq, &mask);
> -		else if (irq_desc[irq].action && !(warned++))
> -			printk("Cannot set affinity for irq %i\n", irq);
> +		else if (irq_desc[irq].action)
> +			printk_once("Cannot set affinity for irq %i\n", irq);

Maybe we should add a loglevel to this printk (and the other one in fix_irqs)
while we are here?

Other than that:

Acked-by: Wolfram Sang <w.sang@pengutronix.de>

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: [PATCH 03/14] powerpc: use printk_once
  2009-08-10  8:00   ` Wolfram Sang
@ 2009-08-10 11:46     ` Michael Ellerman
  2009-08-10 11:56       ` Gary Thomas
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Ellerman @ 2009-08-10 11:46 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linuxppc-dev, Paul Mackerras, Marcin Slusarz, LKML

[-- Attachment #1: Type: text/plain, Size: 2528 bytes --]

On Mon, 2009-08-10 at 10:00 +0200, Wolfram Sang wrote:
> On Sun, Aug 09, 2009 at 09:53:58PM +0200, Marcin Slusarz wrote:
> > Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
> > Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > Cc: Paul Mackerras <paulus@samba.org>
> > Cc: linuxppc-dev@ozlabs.org
> > ---
> >  arch/powerpc/kernel/iommu.c      |    6 +-----
> >  arch/powerpc/kernel/irq.c        |    5 ++---
> >  arch/powerpc/sysdev/ppc4xx_pci.c |    9 ++-------
> >  3 files changed, 5 insertions(+), 15 deletions(-)
> > 
> > diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
> > index fd51578..c7fa258 100644
> > --- a/arch/powerpc/kernel/iommu.c
> > +++ b/arch/powerpc/kernel/iommu.c
> > @@ -502,7 +502,6 @@ static void iommu_table_clear(struct iommu_table *tbl)
> >  struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid)
> >  {
> >  	unsigned long sz;
> > -	static int welcomed = 0;
> >  	struct page *page;
> >  
> >  	/* Set aside 1/4 of the table for large allocations. */
> > @@ -523,11 +522,8 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid)
> >  
> >  	iommu_table_clear(tbl);
> >  
> > -	if (!welcomed) {
> > -		printk(KERN_INFO "IOMMU table initialized, virtual merging %s\n",
> > +	printk_once(KERN_INFO "IOMMU table initialized, virtual merging %s\n",
> >  		       novmerge ? "disabled" : "enabled");
> > -		welcomed = 1;
> > -	}
> >  
> >  	return tbl;
> >  }
> > diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
> > index f7f376e..05ebd21 100644
> > --- a/arch/powerpc/kernel/irq.c
> > +++ b/arch/powerpc/kernel/irq.c
> > @@ -231,7 +231,6 @@ skip:
> >  void fixup_irqs(cpumask_t map)
> >  {
> >  	unsigned int irq;
> > -	static int warned;
> >  
> >  	for_each_irq(irq) {
> >  		cpumask_t mask;
> > @@ -246,8 +245,8 @@ void fixup_irqs(cpumask_t map)
> >  		}
> >  		if (irq_desc[irq].chip->set_affinity)
> >  			irq_desc[irq].chip->set_affinity(irq, &mask);
> > -		else if (irq_desc[irq].action && !(warned++))
> > -			printk("Cannot set affinity for irq %i\n", irq);
> > +		else if (irq_desc[irq].action)
> > +			printk_once("Cannot set affinity for irq %i\n", irq);
> 
> Maybe we should add a loglevel to this printk (and the other one in fix_irqs)
> while we are here?

I think you should drop it, it's stupid. If we actually care about irqs
that don't have a set affinity we should keep a count and report that at
the end of the loop.

cheers

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: [PATCH 03/14] powerpc: use printk_once
  2009-08-10 11:46     ` Michael Ellerman
@ 2009-08-10 11:56       ` Gary Thomas
  0 siblings, 0 replies; 4+ messages in thread
From: Gary Thomas @ 2009-08-10 11:56 UTC (permalink / raw)
  To: michael; +Cc: linuxppc-dev, Paul Mackerras, LKML, Marcin Slusarz

Michael Ellerman wrote:
> On Mon, 2009-08-10 at 10:00 +0200, Wolfram Sang wrote:
>> On Sun, Aug 09, 2009 at 09:53:58PM +0200, Marcin Slusarz wrote:
>>> Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
>>> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>>> Cc: Paul Mackerras <paulus@samba.org>
>>> Cc: linuxppc-dev@ozlabs.org
>>> ---
>>>  arch/powerpc/kernel/iommu.c      |    6 +-----
>>>  arch/powerpc/kernel/irq.c        |    5 ++---
>>>  arch/powerpc/sysdev/ppc4xx_pci.c |    9 ++-------
>>>  3 files changed, 5 insertions(+), 15 deletions(-)
>>>
>>> diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
>>> index fd51578..c7fa258 100644
>>> --- a/arch/powerpc/kernel/iommu.c
>>> +++ b/arch/powerpc/kernel/iommu.c
>>> @@ -502,7 +502,6 @@ static void iommu_table_clear(struct iommu_table *tbl)
>>>  struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid)
>>>  {
>>>  	unsigned long sz;
>>> -	static int welcomed = 0;
>>>  	struct page *page;
>>>  
>>>  	/* Set aside 1/4 of the table for large allocations. */
>>> @@ -523,11 +522,8 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid)
>>>  
>>>  	iommu_table_clear(tbl);
>>>  
>>> -	if (!welcomed) {
>>> -		printk(KERN_INFO "IOMMU table initialized, virtual merging %s\n",
>>> +	printk_once(KERN_INFO "IOMMU table initialized, virtual merging %s\n",
>>>  		       novmerge ? "disabled" : "enabled");
>>> -		welcomed = 1;
>>> -	}
>>>  
>>>  	return tbl;
>>>  }
>>> diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
>>> index f7f376e..05ebd21 100644
>>> --- a/arch/powerpc/kernel/irq.c
>>> +++ b/arch/powerpc/kernel/irq.c
>>> @@ -231,7 +231,6 @@ skip:
>>>  void fixup_irqs(cpumask_t map)
>>>  {
>>>  	unsigned int irq;
>>> -	static int warned;
>>>  
>>>  	for_each_irq(irq) {
>>>  		cpumask_t mask;
>>> @@ -246,8 +245,8 @@ void fixup_irqs(cpumask_t map)
>>>  		}
>>>  		if (irq_desc[irq].chip->set_affinity)
>>>  			irq_desc[irq].chip->set_affinity(irq, &mask);
>>> -		else if (irq_desc[irq].action && !(warned++))
>>> -			printk("Cannot set affinity for irq %i\n", irq);
>>> +		else if (irq_desc[irq].action)
>>> +			printk_once("Cannot set affinity for irq %i\n", irq);
>> Maybe we should add a loglevel to this printk (and the other one in fix_irqs)
>> while we are here?
> 
> I think you should drop it, it's stupid. If we actually care about irqs
> that don't have a set affinity we should keep a count and report that at
> the end of the loop.

In addition, this change would prevent reporting missing
affinity on more than one IRQ if there were such.

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

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

end of thread, other threads:[~2009-08-10 12:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1249847649-11631-1-git-send-email-marcin.slusarz@gmail.com>
2009-08-09 19:53 ` [PATCH 03/14] powerpc: use printk_once Marcin Slusarz
2009-08-10  8:00   ` Wolfram Sang
2009-08-10 11:46     ` Michael Ellerman
2009-08-10 11:56       ` Gary Thomas

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