Re: [PATCH 1/3] powerpc/mpic: Fix confusion between hw_irq and virq

2012-04-23 Thread Grant Likely
On Fri, 20 Apr 2012 13:29:34 +1000, Benjamin Herrenschmidt 
b...@kernel.crashing.org wrote:
 mpic_is_ipi() takes a virq and immediately converts it to a hw_irq.
 
 However, one of the two call sites calls it with a ... hw_irq. The
 other call site also happens to have the hw_irq at hand, so let's
 change it to just take that as an argument. Also change mpic_is_tm()
 for consistency.
 
 Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org

Looks good to me.  Are you pushing these up to Linus for v3.4?

g.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 1/3] powerpc/mpic: Fix confusion between hw_irq and virq

2012-04-23 Thread Benjamin Herrenschmidt
On Mon, 2012-04-23 at 11:32 -0600, Grant Likely wrote:
 On Fri, 20 Apr 2012 13:29:34 +1000, Benjamin Herrenschmidt 
 b...@kernel.crashing.org wrote:
  mpic_is_ipi() takes a virq and immediately converts it to a hw_irq.
  
  However, one of the two call sites calls it with a ... hw_irq. The
  other call site also happens to have the hw_irq at hand, so let's
  change it to just take that as an argument. Also change mpic_is_tm()
  for consistency.
  
  Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org
 
 Looks good to me.  Are you pushing these up to Linus for v3.4?

Already did :-)

Cheers,
Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 1/3] powerpc/mpic: Fix confusion between hw_irq and virq

2012-04-19 Thread Benjamin Herrenschmidt
mpic_is_ipi() takes a virq and immediately converts it to a hw_irq.

However, one of the two call sites calls it with a ... hw_irq. The
other call site also happens to have the hw_irq at hand, so let's
change it to just take that as an argument. Also change mpic_is_tm()
for consistency.

Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org
---
 arch/powerpc/sysdev/mpic.c |   12 
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 9ac71eb..665b0f8 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -604,18 +604,14 @@ static struct mpic *mpic_find(unsigned int irq)
 }
 
 /* Determine if the linux irq is an IPI */
-static unsigned int mpic_is_ipi(struct mpic *mpic, unsigned int irq)
+static unsigned int mpic_is_ipi(struct mpic *mpic, unsigned int src)
 {
-   unsigned int src = virq_to_hw(irq);
-
return (src = mpic-ipi_vecs[0]  src = mpic-ipi_vecs[3]);
 }
 
 /* Determine if the linux irq is a timer */
-static unsigned int mpic_is_tm(struct mpic *mpic, unsigned int irq)
+static unsigned int mpic_is_tm(struct mpic *mpic, unsigned int src)
 {
-   unsigned int src = virq_to_hw(irq);
-
return (src = mpic-timer_vecs[0]  src = mpic-timer_vecs[7]);
 }
 
@@ -1555,12 +1551,12 @@ void mpic_irq_set_priority(unsigned int irq, unsigned 
int pri)
return;
 
raw_spin_lock_irqsave(mpic_lock, flags);
-   if (mpic_is_ipi(mpic, irq)) {
+   if (mpic_is_ipi(mpic, src)) {
reg = mpic_ipi_read(src - mpic-ipi_vecs[0]) 
~MPIC_VECPRI_PRIORITY_MASK;
mpic_ipi_write(src - mpic-ipi_vecs[0],
   reg | (pri  MPIC_VECPRI_PRIORITY_SHIFT));
-   } else if (mpic_is_tm(mpic, irq)) {
+   } else if (mpic_is_tm(mpic, src)) {
reg = mpic_tm_read(src - mpic-timer_vecs[0]) 
~MPIC_VECPRI_PRIORITY_MASK;
mpic_tm_write(src - mpic-timer_vecs[0],


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 1/3] powerpc/mpic: Fix confusion between hw_irq and virq

2012-04-19 Thread Benjamin Herrenschmidt
mpic_is_ipi() takes a virq and immediately converts it to a hw_irq.

However, one of the two call sites calls it with a ... hw_irq. The
other call site also happens to have the hw_irq at hand, so let's
change it to just take that as an argument. Also change mpic_is_tm()
for consistency.

Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org
---
 arch/powerpc/sysdev/mpic.c |   12 
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 9ac71eb..665b0f8 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -604,18 +604,14 @@ static struct mpic *mpic_find(unsigned int irq)
 }
 
 /* Determine if the linux irq is an IPI */
-static unsigned int mpic_is_ipi(struct mpic *mpic, unsigned int irq)
+static unsigned int mpic_is_ipi(struct mpic *mpic, unsigned int src)
 {
-   unsigned int src = virq_to_hw(irq);
-
return (src = mpic-ipi_vecs[0]  src = mpic-ipi_vecs[3]);
 }
 
 /* Determine if the linux irq is a timer */
-static unsigned int mpic_is_tm(struct mpic *mpic, unsigned int irq)
+static unsigned int mpic_is_tm(struct mpic *mpic, unsigned int src)
 {
-   unsigned int src = virq_to_hw(irq);
-
return (src = mpic-timer_vecs[0]  src = mpic-timer_vecs[7]);
 }
 
@@ -1555,12 +1551,12 @@ void mpic_irq_set_priority(unsigned int irq, unsigned 
int pri)
return;
 
raw_spin_lock_irqsave(mpic_lock, flags);
-   if (mpic_is_ipi(mpic, irq)) {
+   if (mpic_is_ipi(mpic, src)) {
reg = mpic_ipi_read(src - mpic-ipi_vecs[0]) 
~MPIC_VECPRI_PRIORITY_MASK;
mpic_ipi_write(src - mpic-ipi_vecs[0],
   reg | (pri  MPIC_VECPRI_PRIORITY_SHIFT));
-   } else if (mpic_is_tm(mpic, irq)) {
+   } else if (mpic_is_tm(mpic, src)) {
reg = mpic_tm_read(src - mpic-timer_vecs[0]) 
~MPIC_VECPRI_PRIORITY_MASK;
mpic_tm_write(src - mpic-timer_vecs[0],



___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev